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

svn at pcbsd.org svn at pcbsd.org
Tue Jan 8 16:07:40 PST 2008


Author: tim
Date: 2008-01-08 16:07:39 -0800 (Tue, 08 Jan 2008)
New Revision: 1113

Modified:
   pcbsd/trunk/pcbsdusermanager/maindlgcode.cpp
   pcbsd/trunk/pcbsdusermanager/simpledlgcode.cpp
Log:
Fixed bug #85 - Do not allow deletion of the currently logged in user

Modified: pcbsd/trunk/pcbsdusermanager/maindlgcode.cpp
===================================================================
--- pcbsd/trunk/pcbsdusermanager/maindlgcode.cpp	2008-01-08 18:05:30 UTC (rev 1112)
+++ pcbsd/trunk/pcbsdusermanager/maindlgcode.cpp	2008-01-09 00:07:39 UTC (rev 1113)
@@ -139,6 +139,9 @@
     
     //Disable certain form fields if the user is root, to stop changing of important fields
     enableEdits(user->getUid() != 0);
+    //Do not allow the removal of the currently logged in user
+    if (getenv("USER") == username) deleteButton->setEnabled(false);
+    
     QString uid = QString::number(user->getUid());
     if (uid == "-1") { uid = tr("New User"); }
     uidBox->setText(uid);

Modified: pcbsd/trunk/pcbsdusermanager/simpledlgcode.cpp
===================================================================
--- pcbsd/trunk/pcbsdusermanager/simpledlgcode.cpp	2008-01-08 18:05:30 UTC (rev 1112)
+++ pcbsd/trunk/pcbsdusermanager/simpledlgcode.cpp	2008-01-09 00:07:39 UTC (rev 1113)
@@ -83,6 +83,10 @@
     fullnameBox->setText(user->getFullname());
     
     canAdminCheck->setChecked(wheel->isMember(user->getUsername()));
+    
+    //Do not allow the removal of the currently logged in user
+    removeUserBut->setEnabled(getenv("USER") != user->getUsername());
+    
     systemChange = false;
 }
 



More information about the Commits mailing list