From 466ccbafb38cf8fd767ed2b88d93c547a4eca9a2 Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 3 Apr 2013 03:22:08 +0900 Subject: Do not populate user/pass when deselecting "remember" Closes: #2059 --- src/leap/config/leapsettings.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/leap/config') diff --git a/src/leap/config/leapsettings.py b/src/leap/config/leapsettings.py index 35c9fef6..19ec4a9a 100644 --- a/src/leap/config/leapsettings.py +++ b/src/leap/config/leapsettings.py @@ -64,6 +64,7 @@ class LeapSettings(object): USER_KEY = "User" AUTOLOGIN_KEY = "AutoLogin" PROPERPROVIDER_KEY = "ProperProvider" + REMEMBER_KEY = "RememberUserAndPass" def __init__(self, standalone=False): """ @@ -169,6 +170,25 @@ class LeapSettings(object): leap_assert(len(user) > 0, "We cannot save an empty user") self._settings.setValue(self.USER_KEY, user) + def get_remember(self): + """ + Returns the value of the remember selection. + + @rtype: bool + """ + return to_bool(self._settings.value(self.REMEMBER_KEY, False)) + + def set_remember(self, remember): + """ + Sets wheter the app should remember username and password + + @param remember: True if the app should remember username and + password, False otherwise + @rtype: bool + """ + leap_assert_type(remember, bool) + self._settings.setValue(self.REMEMBER_KEY, remember) + def get_autologin(self): """ Returns True if the app should automatically login, False otherwise -- cgit v1.2.3