user-accounts: prevent the only admin from being deleted or disabled
https://bugzilla.gnome.org/show_bug.cgi?id=690246
This commit is contained in:
parent
0adf7c2073
commit
3af1b72691
4 changed files with 46 additions and 40 deletions
|
@ -644,7 +644,8 @@ visible_func (GtkTreeModel *model,
|
|||
* 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 ()))
|
||||
(locked || act_user_get_uid (um->user) == getuid ()
|
||||
|| would_demote_only_admin (um->user)))
|
||||
return FALSE;
|
||||
|
||||
if (mode == UM_PASSWORD_DIALOG_MODE_UNLOCK_ACCOUNT && !locked)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue