Oops - fix a true/false reversal in the sysadm/users "userdelete" "clean_home" optional argument.

This commit is contained in:
Ken Moore
2016-08-16 09:32:14 -04:00
parent dac91284c8
commit 216ca5a9f2
2 changed files with 9 additions and 9 deletions

View File

@@ -931,7 +931,7 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmUserRequest(bool allaccess,
QString deluser = in_args.toObject().value("name").toString();
if(deluser != user){ //cannot delete the currently-used user
bool clean = true;
if(in_args.toObject().contains("clean_home")){ clean = (in_args.toObject().value("clean_home").toString().toLower() == "false"); }
if(in_args.toObject().contains("clean_home")){ clean = (in_args.toObject().value("clean_home").toString().toLower() != "false"); }
ok = sysadm::UserManager::removeUser(deluser, clean);
if(ok){ out->insert("result","success"); }
else{ out->insert("error","Could not delete user"); }

View File

@@ -212,14 +212,14 @@ QJsonObject BEADM::listBEs() {
// Unmount the given boot environment immediately. Confirmation should be done through the client.
QJsonObject BEADM::umountBE(QJsonObject jsin) {
QJsonObject retObject;
QJsonObject BEADM::umountBE(QJsonObject jsin) {
QJsonObject retObject;
QStringList keys = jsin.keys();
if (! keys.contains("be") ) {
retObject.insert("error", "Missing required key(s) 'be'");
return retObject;
}
QStringList keys = jsin.keys();
if (! keys.contains("be") ) {
retObject.insert("error", "Missing required key(s) 'be'");
return retObject;
}
// Get the key values
@@ -238,4 +238,4 @@ QJsonObject BEADM::listBEs() {
retObject.insert("be", be);
return retObject;
}
}