[gnome-control-center/gnome-3-8] user-accounts: Don't let user disable own account



commit a107db388fff055b8be370cee5454de4e8489387
Author: Chris Cummins <christopher e cummins intel com>
Date:   Mon May 20 14:27:32 2013 +0100

    user-accounts: Don't let user disable own account
    
    This removes the 'Disable this account' action for the currently logged
    in user, as this can lead to them being 'locked out'.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700715

 panels/user-accounts/um-password-dialog.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/panels/user-accounts/um-password-dialog.c b/panels/user-accounts/um-password-dialog.c
index 041f85f..f694456 100644
--- a/panels/user-accounts/um-password-dialog.c
+++ b/panels/user-accounts/um-password-dialog.c
@@ -638,7 +638,11 @@ visible_func (GtkTreeModel     *model,
 
                 gtk_tree_model_get (model, iter, 1, &mode, -1);
 
-                if (mode == UM_PASSWORD_DIALOG_MODE_LOCK_ACCOUNT && locked)
+                /* We don't allow the current user to disable their own account,
+                 * as this can lead to them being 'locked out'.
+                 */
+                if (mode == UM_PASSWORD_DIALOG_MODE_LOCK_ACCOUNT &&
+                    (locked || act_user_get_uid (um->user) == getuid ()))
                         return FALSE;
 
                 if (mode == UM_PASSWORD_DIALOG_MODE_UNLOCK_ACCOUNT && !locked)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]