gdm2setup-0.5.3-fix-timedlogin.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. diff -up gdm2setup-0.5.3-lucid/gdm2/gdm2gconf.py.fix-timedlogin gdm2setup-0.5.3-lucid/gdm2/gdm2gconf.py
  2. --- gdm2setup-0.5.3-lucid/gdm2/gdm2gconf.py.fix-timedlogin 2011-07-05 09:08:36.818889819 +0900
  3. +++ gdm2setup-0.5.3-lucid/gdm2/gdm2gconf.py 2011-07-05 09:09:20.039889819 +0900
  4. @@ -63,7 +63,10 @@ class GDM2Theme(object):
  5. config = ConfigParser.RawConfigParser()
  6. config.optionxform = str
  7. config.read(self.GDMCONF_FILE)
  8. - return config.getboolean('daemon', 'AutomaticLoginEnable')
  9. + TimedLoginEnable = config.getboolean('daemon', 'TimedLoginEnable')
  10. + AutomaticLoginEnable = config.getboolean('daemon', 'AutomaticLoginEnable')
  11. + if TimedLoginEnable == True or AutomaticLoginEnable == True:
  12. + return True
  13. except:
  14. return False
  15. @@ -82,6 +85,10 @@ class GDM2Theme(object):
  16. config = ConfigParser.RawConfigParser()
  17. config.optionxform = str
  18. config.read(self.GDMCONF_FILE)
  19. + if AutomaticLoginEnable:
  20. + config.set('daemon','TimedLoginEnable','False')
  21. + else:
  22. + config.set('daemon','TimedLoginEnable','True')
  23. config.set('daemon','AutomaticLoginEnable',AutomaticLoginEnable)
  24. config.set('daemon','AutomaticLogin',User)
  25. with open(self.GDMCONF_FILE, 'wb') as configfile:
  26. @@ -143,6 +150,11 @@ class GDM2Theme(object):
  27. config = ConfigParser.RawConfigParser()
  28. config.optionxform = str
  29. config.read(self.GDMCONF_FILE)
  30. + AutomaticLogin = config.get('daemon', 'AutomaticLogin')
  31. + if TimedLoginEnable or AutomaticLogin == 'None':
  32. + config.set('daemon','AutomaticLoginEnable','False')
  33. + else:
  34. + config.set('daemon','AutomaticLoginEnable','True')
  35. config.set('daemon','TimedLoginEnable',TimedLoginEnable)
  36. config.set('daemon','TimedLogin',User)
  37. config.set('daemon','TimedLoginDelay',TimedLoginDelay)