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.
This commit is contained in:
Ken Moore
2016-08-16 13:09:50 -04:00
parent f073d2aa17
commit 8700aab62a

View File

@@ -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;