diff options
author | Papoteur <papoteur@mageialinux-online.org> | 2016-10-23 10:20:26 +0200 |
---|---|---|
committer | Papoteur <papoteur@mageialinux-online.org> | 2016-10-23 10:20:26 +0200 |
commit | 5ed5287f56339f39e36aa50ed5e081fec58ef6a8 (patch) | |
tree | 7a3b8e21d8a3c491cc9b4deabe89943db84ed41b | |
parent | 92eaf5dc921ce15a367d9d183c2a7dc69b69bcad (diff) | |
download | msec-5ed5287f56339f39e36aa50ed5e081fec58ef6a8.tar msec-5ed5287f56339f39e36aa50ed5e081fec58ef6a8.tar.gz msec-5ed5287f56339f39e36aa50ed5e081fec58ef6a8.tar.bz2 msec-5ed5287f56339f39e36aa50ed5e081fec58ef6a8.tar.xz msec-5ed5287f56339f39e36aa50ed5e081fec58ef6a8.zip |
manage RememberLastUser in sddm.conf according to allow_user_list (mga#19188)
-rwxr-xr-x | src/msec/plugins/msec.py | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/msec/plugins/msec.py b/src/msec/plugins/msec.py index d31debe..05ab4db 100755 --- a/src/msec/plugins/msec.py +++ b/src/msec/plugins/msec.py @@ -54,6 +54,7 @@ OPASSWD = '/etc/security/opasswd' PASSWD = '/etc/pam.d/passwd' POWEROFF = '/usr/bin/poweroff' REBOOT = '/usr/bin/reboot' +SDDMCONF = '/etc/sddm.conf' SERVER = '/etc/security/msec/server' SHADOW = '/etc/shadow' SHUTDOWN = '/usr/bin/shutdown' @@ -384,34 +385,44 @@ class msec: kdmrc = self.configfiles.get_config_file(KDMRC) gdmconf = self.configfiles.get_config_file(GDMCONF) gdm230 = self.configfiles.get_config_file(GDM230) + sddmconf = self.configfiles.get_config_file(SDDMCONF) oldval_gdmconf = gdmconf.get_shell_variable('Browser') oldval_kdmrc = kdmrc.get_shell_variable('ShowUsers', 'X-\*-Greeter', '^\s*$') - + oldval_sddmconf = sddmconf.get_shell_variable('RememberLastUser','X11', '^\s*$') + if arg == "yes": if kdmrc.exists(): if oldval_kdmrc != 'NotHidden': - self.log.info(_("Allowing list of users in KDM")) + self.log.info(_("Allowing list of users in {}").format('KDM')) kdmrc.set_shell_variable('ShowUsers', 'NotHidden', 'X-\*-Greeter', '^\s*$') if gdmconf.exists(): if gdm230.exists(): pass else: if oldval_gdmconf != 'true': - self.log.info(_("Allowing list of users in GDM")) + self.log.info(_("Allowing list of users in {}").format('GDM')) gdmconf.set_shell_variable('Browser', 'true') + if sddmconf.exists(): + if oldval_sddmconf != 'true': + self.log.info(_("Allowing list of users in {}").format('SDDM')) + sddmconf.set_shell_variable('RememberLastUser', 'true','X11', '^\s*$') else: if kdmrc.exists(): if oldval_kdmrc != 'Selected': - self.log.info(_("Forbidding list of users in KDM")) + self.log.info(_("Forbidding list of users in {}").format('KDM')) kdmrc.set_shell_variable('ShowUsers', 'Selected', 'X-\*-Greeter', '^\s*$') if gdmconf.exists(): if gdm230.exists(): pass else: if oldval_gdmconf != 'false': - self.log.info(_("Forbidding list of users in GDM")) + self.log.info(_("Forbidding list of users in {}").format('GDM')) gdmconf.set_shell_variable('Browser', 'false') + if sddmconf.exists(): + if oldval_sddmconf != 'false': + self.log.info(_("Forbidding showing last user in {}").format('SDDM')) + sddmconf.set_shell_variable('RememberLastUser', 'false','X11', '^\s*$') def allow_autologin(self, arg): ''' Allow autologin.''' |