diff options
author | Ray Strode <rstrode@redhat.com> | 2013-06-11 11:42:43 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2013-06-11 11:50:37 -0400 |
commit | c8ac5bcaeda49bdb8fb129019ef82a292e7b54d2 (patch) | |
tree | 4bd1015c9d0cf4ee89aa3aad9121c4a815c3f45d /src/user.c | |
parent | 54a1c5efa5e209fa522e8c0acfaf9868257e95cf (diff) | |
download | accountsservice-c8ac5bcaeda49bdb8fb129019ef82a292e7b54d2.tar.gz |
daemon: turn off autologin for disabled users
This is like the previous commit, but for disabled
users instead of deleted users.
Diffstat (limited to 'src/user.c')
-rw-r--r-- | src/user.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -1287,6 +1287,28 @@ user_change_locked_authorized_cb (Daemon *daemon, user->locked = locked; + if (user->automatic_login) { + User *automatic_login_user; + + automatic_login_user = daemon_local_get_automatic_login_user (daemon); + if (user->locked) { + /* If automatic login is enabled for the user then + * disable it in the config file, but keep the state + * attached to the user unharmed so it can be restored + * later in the session + */ + if (user == automatic_login_user) { + daemon_local_set_automatic_login (daemon, user, FALSE, NULL); + user->automatic_login = TRUE; + } + } else { + if (automatic_login_user == NULL) { + user->automatic_login = FALSE; + daemon_local_set_automatic_login (daemon, user, TRUE, NULL); + } + } + } + accounts_user_emit_changed (ACCOUNTS_USER (user)); g_object_notify (G_OBJECT (user), "locked"); |