[PC-BSD Commits] r144 - pcbsd/trunk/pcbsdusermanager

svn at pcbsd.org svn at pcbsd.org
Tue Mar 20 09:16:23 PST 2007


Author: tim
Date: 2007-03-20 18:16:23 +0100 (Tue, 20 Mar 2007)
New Revision: 144

Modified:
   pcbsd/trunk/pcbsdusermanager/maindlgcode.cpp
Log:
Instead of checking for wheel & root when disabling form elements, we now check for a gid or uid of 0. This lets us catch things like the 'toor' user with the same conditional.

Modified: pcbsd/trunk/pcbsdusermanager/maindlgcode.cpp
===================================================================
--- pcbsd/trunk/pcbsdusermanager/maindlgcode.cpp	2007-03-17 09:32:19 UTC (rev 143)
+++ pcbsd/trunk/pcbsdusermanager/maindlgcode.cpp	2007-03-20 17:16:23 UTC (rev 144)
@@ -132,7 +132,7 @@
     User *user = back->getUser(username);
     
     //Disable certain form fields if the user is root, to stop changing of important fields
-    enableEdits(username != "root");
+    enableEdits(user->getUid() != 0);
     QString uid = QString::number(user->getUid());
     if (uid == "-1") { uid = tr("New User"); }
     uidBox->setText(uid);
@@ -157,7 +157,7 @@
     Group *group = back->getGroup(groupname);
 
     //Disable remove button if we're wheel
-    removeGroupBut->setEnabled(groupname != "wheel");
+    removeGroupBut->setEnabled(group->getGid() != 0);
     memberPointer = memberList->currentItem();
     availablePointer = availableList->currentItem();
     memberList->clear();



More information about the Commits mailing list