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

Method UpdateProject

AdaptixClient/Source/Client/Storage.cpp:213–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void Storage::UpdateProject(AuthProfile profile)
214{
215 QJsonObject json;
216 json["host"] = profile.GetHost();
217 json["port"] = profile.GetPort();
218 json["endpoint"] = profile.GetEndpoint();
219 json["username"] = profile.GetUsername();
220 json["password"] = profile.GetPassword();
221 json["projectDir"] = profile.GetProjectDir();
222 json["subscriptions"] = QJsonArray::fromStringList(profile.GetSubscriptions());
223 json["consoleMultiuser"] = profile.GetConsoleMultiuser();
224 QString data = QJsonDocument(json).toJson(QJsonDocument::Compact);
225
226 QSqlQuery query(QSqlDatabase::database(DB_CONNECTION_NAME));
227 query.prepare("UPDATE Projects SET data = :Data WHERE project = :Project;");
228 query.bindValue(":Project", profile.GetProject());
229 query.bindValue(":Data", data);
230 if (!query.exec())
231 LogError("The project has not been updated in the database: %s\n", query.lastError().text().toStdString().c_str());
232}
233
234void Storage::RemoveProject(const QString &project)
235{

Callers 4

onApplyMethod · 0.80
onSyncInactiveAgentsMethod · 0.80
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