From 8700aab62a63307a75f7095bab208f828d5e88c3 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 16 Aug 2016 13:09:50 -0400 Subject: [PATCH] API CHANGE In the sysadm/users "action"="usershow" output, put a "canremove"="false" within the object of the currently-active user (so the client knows which user(s) cannot be removed right now). We might be able to extend this later on the server side to set that flag for *all* active users on the system instead. --- src/server/library/sysadm-users.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/library/sysadm-users.cpp b/src/server/library/sysadm-users.cpp index 087e1bf..d8e3b98 100644 --- a/src/server/library/sysadm-users.cpp +++ b/src/server/library/sysadm-users.cpp @@ -36,6 +36,7 @@ bool UserManager::listUsers(QJsonObject *out, bool showall, QString user){ uinfo.insert("home_dir", info[8]); uinfo.insert("shell", info[9]); if(PCinstalled && QFile::exists("/var/db/personacrypt/" + info[0] + ".key") ){ uinfo.insert("personacrypt_enabled","true"); } + if(info[0]==user){ uinfo.insert("canremove","false"); } //current user requesting info - cannot remove it out->insert(info[0], uinfo); //use the username as the unique object name }else if(info.length() == 7){ QJsonObject uinfo;