Fixed the query account password change parameter
This commit is contained in:
parent
d6314f22b2
commit
3f9ee1c444
@ -371,18 +371,13 @@ int main(int argc, char** argv) {
|
|||||||
auto password = arguments.cmdOptionExists("-q") ? arguments.get_option("-q") : arguments.get_option("--set_query_password");
|
auto password = arguments.cmdOptionExists("-q") ? arguments.get_option("-q") : arguments.get_option("--set_query_password");
|
||||||
if(!password.empty()) {
|
if(!password.empty()) {
|
||||||
logMessageFmt(true, LOG_GENERAL, "Updating server admin query password to \"{}\"", password);
|
logMessageFmt(true, LOG_GENERAL, "Updating server admin query password to \"{}\"", password);
|
||||||
auto accounts = serverInstance->getQueryServer()->find_query_accounts_by_unique_id(serverInstance->getInitialServerAdmin()->getUid());
|
auto account = serverInstance->getQueryServer()->find_query_account_by_name("serveradmin");
|
||||||
bool found = false;
|
if(!account) {
|
||||||
for(const auto& account : accounts) {
|
logErrorFmt(true, LOG_GENERAL, "Failed to update server admin query password! Login does not exists!");
|
||||||
if(account->bound_server != 0) continue;
|
} else {
|
||||||
if(!serverInstance->getQueryServer()->change_query_password(account, password)) {
|
if(!serverInstance->getQueryServer()->change_query_password(account, password)) {
|
||||||
logErrorFmt(true, LOG_GENERAL, "Failed to update server admin query password! (Internal error)");
|
logErrorFmt(true, LOG_GENERAL, "Failed to update server admin query password! (Internal error)");
|
||||||
}
|
}
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(!found) {
|
|
||||||
logErrorFmt(true, LOG_GENERAL, "Failed to update server admin query password! Login does not exists!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user