Esempio n. 1
0
    def sipc_auth_t_finished(self):
        kill_qthread(self.sipc_auth_t_killer)

        res_obj = self.sipc_auth_t.get_return()
        code = res_obj.code

        if code == SIPResponse.OK:
            self._retry_times = 0
            i_update_user_after_sipc_auth_success(self.user, res_obj)
            self.show_contact_list_win()
            return

        elif code == SIPResponse.EXTENSION_REQUIRED: # login location changed
            self.verification = i_generate_verification_pic(self.user, res_obj)
            body = "%s<br />%s" % (self.verification.text, self.verification.tips)
            (btn_val, chars) = GetVerificationDialog.get_input(body = body,
                        path = self.verification.picture_path)
            
            if btn_val:
                logger.info("(SIPC auth) Input recognise chars: %s" % chars)
                self.verification.chars = chars
                self.sipc_auth_t_run()
            else:
                self.verification = None
                self.user = None
                self.show_or_hide_login_widgets(show = True)

            return

        self.show_or_hide_login_widgets(show = True)
        popup_error(self, "SIPC authentication response code: %d" % code)
Esempio n. 2
0
    def sipc_auth_t_finished(self):
        kill_qthread(self.sipc_auth_t_killer)

        res_obj = self.sipc_auth_t.get_return()
        code = res_obj.code

        if code == SIPResponse.OK:
            self._retry_times = 0
            i_update_user_after_sipc_auth_success(self.user, res_obj)
            self.show_contact_list_win()
            return

        elif code == SIPResponse.EXTENSION_REQUIRED:  # login location changed
            self.verification = i_generate_verification_pic(self.user, res_obj)
            body = "%s<br />%s" % (self.verification.text,
                                   self.verification.tips)
            (btn_val, chars) = GetVerificationDialog.get_input(
                body=body, path=self.verification.picture_path)

            if btn_val:
                logger.info("(SIPC auth) Input recognise chars: %s" % chars)
                self.verification.chars = chars
                self.sipc_auth_t_run()
            else:
                self.verification = None
                self.user = None
                self.show_or_hide_login_widgets(show=True)

            return

        self.show_or_hide_login_widgets(show=True)
        popup_error(self, "SIPC authentication response code: %d" % code)
Esempio n. 3
0
    def ssi_auth_t_finished(self):
        # why not necessary to call disconnect(SIGNAL) here
        # http://doc.qt.nokia.com/4.7/qobject.html#disconnect-3
        kill_qthread(self.ssi_auth_t_killer)

        res_obj = self.ssi_auth_t.get_return()
        code = res_obj.code

        if code == httplib.OK:
            i_update_user_after_ssi_auth_success(self.user, res_obj,
                                                 self.get_if_remember_passwd())

            self._retry_times = 0

            self.download_sys_config_t_run()

        elif code == HTTPResponse.PASSWD_ERROR:
            self.user = None
            self.show_or_hide_login_widgets(show=True)
            popup_error(self, u"密码错误")

        elif code in (HTTPResponse.CCPS_CHECK_ERROR, HTTPResponse.NEED_VERIFY):
            self.verification = i_generate_verification_pic(self.user, res_obj)
            body = "%s<br />%s" % (self.verification.text,
                                   self.verification.tips)
            (btn_val, chars) = GetVerificationDialog.get_input(
                body=body, path=self.verification.picture_path)

            if btn_val:
                logger.info("(SSI auth)Input recognise chars: %s" % chars)
                self.verification.chars = chars
                self.ssi_auth_t_run()
            else:
                self.verification = None
                self.user = None
                self.show_or_hide_login_widgets(show=True)
        else:
            raise Exception("SSI authentication response code: %d" % code)
Esempio n. 4
0
    def ssi_auth_t_finished(self):
        # why not necessary to call disconnect(SIGNAL) here
        # http://doc.qt.nokia.com/4.7/qobject.html#disconnect-3
        kill_qthread(self.ssi_auth_t_killer)

        res_obj = self.ssi_auth_t.get_return()
        code = res_obj.code

        if code == httplib.OK:
            i_update_user_after_ssi_auth_success(self.user, res_obj, self.get_if_remember_passwd())

            self._retry_times = 0
            
            self.download_sys_config_t_run()

        elif code == HTTPResponse.PASSWD_ERROR:
            self.user = None
            self.show_or_hide_login_widgets(show = True)
            popup_error(self, u"密码错误")
            
        elif code in (HTTPResponse.CCPS_CHECK_ERROR, HTTPResponse.NEED_VERIFY):
            self.verification = i_generate_verification_pic(self.user, res_obj)
            body = "%s<br />%s" % (self.verification.text, self.verification.tips)
            (btn_val, chars) = GetVerificationDialog.get_input(body = body,
                        path = self.verification.picture_path)

            if btn_val:
                logger.info("(SSI auth)Input recognise chars: %s" % chars)
                self.verification.chars = chars
                self.ssi_auth_t_run()
            else:
                self.verification = None
                self.user = None
                self.show_or_hide_login_widgets(show = True)
        else:
            raise Exception("SSI authentication response code: %d" % code)