From 46a9bcbc1242aacad1947087c2d30c7952872d7b Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 14 Nov 2013 14:28:52 -0300 Subject: Set token to none in logout. --- src/leap/bitmask/crypto/srpauth.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/leap') diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py index ab98850d..85b9b003 100644 --- a/src/leap/bitmask/crypto/srpauth.py +++ b/src/leap/bitmask/crypto/srpauth.py @@ -581,6 +581,7 @@ class SRPAuth(QtCore.QObject): else: self.set_session_id(None) self.set_uid(None) + self.set_token(None) # Also reset the session self._session = self._fetcher.session() logger.debug("Successfully logged out.") -- cgit v1.2.3 From b0b820d4dc579e3bf5bbfbe68c7911d573aea205 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 14 Nov 2013 14:30:57 -0300 Subject: Use services' module names for the service. --- src/leap/bitmask/gui/preferenceswindow.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py index acb39b07..3843ccde 100644 --- a/src/leap/bitmask/gui/preferenceswindow.py +++ b/src/leap/bitmask/gui/preferenceswindow.py @@ -22,7 +22,9 @@ import os import logging from functools import partial + from PySide import QtCore, QtGui +from zope.proxy import sameProxiedObjects from leap.bitmask.config.leapsettings import LeapSettings from leap.bitmask.gui.ui_preferences import Ui_Preferences @@ -31,7 +33,7 @@ from leap.bitmask.crypto.srpauth import SRPAuthBadUserOrPassword from leap.bitmask.util.password import basic_password_checks from leap.bitmask.services import get_supported from leap.bitmask.config.providerconfig import ProviderConfig -from leap.bitmask.services import get_service_display_name +from leap.bitmask.services import get_service_display_name, MX_SERVICE logger = logging.getLogger(__name__) @@ -81,12 +83,13 @@ class PreferencesWindow(QtGui.QDialog): # check if provider has 'mx' ... domain = provider_config.get_domain() self._select_provider_by_name(domain) + if provider_config.provides_mx(): enabled_services = self._settings.get_enabled_services(domain) - mx_name = get_service_display_name('mx') + mx_name = get_service_display_name(MX_SERVICE) # ... and if the user have it enabled - if 'mx' not in enabled_services: + if MX_SERVICE not in enabled_services: msg = self.tr("You need to enable {0} in order to change " "the password.".format(mx_name)) self._set_password_change_status(msg, error=True) -- cgit v1.2.3 From 20d89634f7b891fb4f399da51b3800d42159b9eb Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 14 Nov 2013 14:34:46 -0300 Subject: Enable password change in proper conditions. - Send soledad to the constructor and check with sameProxiedObjects - Check if soledad instance is defined, otherwise wait until soledad_ready [Closes #4449] --- src/leap/bitmask/gui/mainwindow.py | 7 +++---- src/leap/bitmask/gui/preferenceswindow.py | 26 ++++++++++++++------------ 2 files changed, 17 insertions(+), 16 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index f3043809..c24735d8 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -446,11 +446,10 @@ class MainWindow(QtGui.QMainWindow): Displays the preferences window. """ preferences_window = PreferencesWindow(self, self._srp_auth, - self._provider_config) - - self.soledad_ready.connect( - lambda: preferences_window.set_soledad_ready(self._soledad)) + self._provider_config, + self._soledad) + self.soledad_ready.connect(preferences_window.set_soledad_ready) preferences_window.show() def _show_eip_preferences(self): diff --git a/src/leap/bitmask/gui/preferenceswindow.py b/src/leap/bitmask/gui/preferenceswindow.py index 3843ccde..8e9ef95a 100644 --- a/src/leap/bitmask/gui/preferenceswindow.py +++ b/src/leap/bitmask/gui/preferenceswindow.py @@ -42,7 +42,7 @@ class PreferencesWindow(QtGui.QDialog): """ Window that displays the preferences. """ - def __init__(self, parent, srp_auth, provider_config): + def __init__(self, parent, srp_auth, provider_config, soledad): """ :param parent: parent object of the PreferencesWindow. :parent type: QWidget @@ -50,13 +50,15 @@ class PreferencesWindow(QtGui.QDialog): :type srp_auth: SRPAuth :param provider_config: ProviderConfig object. :type provider_config: ProviderConfig + :param soledad: Soledad instance + :type soledad: Soledad """ QtGui.QDialog.__init__(self, parent) self.AUTOMATIC_GATEWAY_LABEL = self.tr("Automatic") self._srp_auth = srp_auth self._settings = LeapSettings() - self._soledad = None + self._soledad = soledad # Load UI self.ui = Ui_Preferences() @@ -94,10 +96,14 @@ class PreferencesWindow(QtGui.QDialog): "the password.".format(mx_name)) self._set_password_change_status(msg, error=True) else: - msg = self.tr( - "You need to wait until {0} is ready in " - "order to change the password.".format(mx_name)) - self._set_password_change_status(msg) + if sameProxiedObjects(self._soledad, None): + msg = self.tr( + "You need to wait until {0} is ready in " + "order to change the password.".format(mx_name)) + self._set_password_change_status(msg) + else: + # Soledad is bootstrapped + pw_enabled = True else: pw_enabled = True else: @@ -107,18 +113,14 @@ class PreferencesWindow(QtGui.QDialog): self.ui.gbPasswordChange.setEnabled(pw_enabled) - def set_soledad_ready(self, soledad): + def set_soledad_ready(self): """ SLOT TRIGGERS: parent.soledad_ready - It sets the soledad object as ready to use. - - :param soledad: Soledad object configured in the main app. - :type soledad: Soledad + It notifies when the soledad object as ready to use. """ - self._soledad = soledad self.ui.lblPasswordChangeStatus.setVisible(False) self.ui.gbPasswordChange.setEnabled(True) -- cgit v1.2.3