MCPcopy Create free account
hub / github.com/Adaptix-Framework/AdaptixC2 / AddProject

Method AddProject

AdaptixClient/Source/Client/Storage.cpp:192–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void Storage::AddProject(AuthProfile profile)
193{
194 QJsonObject json;
195 json["host"] = profile.GetHost();
196 json["port"] = profile.GetPort();
197 json["endpoint"] = profile.GetEndpoint();
198 json["username"] = profile.GetUsername();
199 json["password"] = profile.GetPassword();
200 json["projectDir"] = profile.GetProjectDir();
201 json["subscriptions"] = QJsonArray::fromStringList(profile.GetSubscriptions());
202 json["consoleMultiuser"] = profile.GetConsoleMultiuser();
203 QString data = QJsonDocument(json).toJson(QJsonDocument::Compact);
204
205 QSqlQuery query(QSqlDatabase::database(DB_CONNECTION_NAME));
206 query.prepare( "INSERT INTO Projects (project, data) VALUES (:Project, :Data);");
207 query.bindValue(":Project", profile.GetProject());
208 query.bindValue(":Data", data);
209 if (!query.exec())
210 LogError("The project has not been added to the database: %s\n", query.lastError().text().toStdString().c_str());
211}
212
213void Storage::UpdateProject(AuthProfile profile)
214{

Callers 2

StartDialogMethod · 0.80
onButton_LoadMethod · 0.80

Calls 14

LogErrorFunction · 0.85
GetHostMethod · 0.80
GetPortMethod · 0.80
GetUsernameMethod · 0.80
GetPasswordMethod · 0.80
GetProjectDirMethod · 0.80
GetConsoleMultiuserMethod · 0.80
GetProjectMethod · 0.80
execMethod · 0.80
toStdStringMethod · 0.80
GetEndpointMethod · 0.45
GetSubscriptionsMethod · 0.45

Tested by

no test coverage detected