Ejemplo n.º 1
0
 def get_user_pass(self, dbname):
     '''
     return a tuple of (result, user, password)
     '''
     LOGGER.debug("%s.get_user_pass %s" % (__file__, dbname))
     dl = UserPasswordDialog(self)
     return dl.exec_(), dl.name, dl.password
Ejemplo n.º 2
0
 def get_user_pass(self, dbname):
     """
     return a tuple of (result, user, password)
     """
     LOGGER.debug("%s.get_user_pass %s" % (__file__, dbname))
     dl = UserPasswordDialog(self)
     return dl.exec_(), dl.name, dl.password
Ejemplo n.º 3
0
    def switch_to_admin_user(self):
        '''
        try and elevate to admin user of the proxy-server
        '''
        LOGGER.debug("switch_to_admin_user called")
        QtGui.QMessageBox.information(
            self, _("info"),
            _("only the admin user can perform this function"))
        dl = UserPasswordDialog(self)
        dl.set_label_text(
            _("Please enter the password for the admin user of this OpenMolar Server"
              ))
        dl.set_name("admin")

        result = False

        while not result:
            if not dl.exec_():
                break

            user = ProxyUser(dl.name, dl.password)
            self.proxy_client.set_user(user)
            try:
                if self.proxy_client.server is not None:
                    result = True
                    break
            except ProxyClient.ConnectionError:
                pass

            self.proxy_client.use_default_user()
            QtGui.QMessageBox.warning(
                self, _("error"), u"%s '%s'" %
                (_("no connection established for user"), dl.name))

        return result
Ejemplo n.º 4
0
    def switch_to_admin_user(self):
        '''
        try and elevate to admin user of the proxy-server
        '''
        LOGGER.debug("switch_to_admin_user called")
        QtGui.QMessageBox.information(self, _("info"),
            _("only the admin user can perform this function")
            )
        dl = UserPasswordDialog(self)
        dl.set_label_text(
    _("Please enter the password for the admin user of this OpenMolar Server"))
        dl.set_name("admin")

        result = False

        while not result:
            if not dl.exec_():
                break

            user = ProxyUser(dl.name, dl.password)
            self.proxy_client.set_user(user)
            try:
                if self.proxy_client.server is not None:
                    result = True
                    break
            except ProxyClient.ConnectionError:
                pass

            self.proxy_client.use_default_user()
            QtGui.QMessageBox.warning(self, _("error"),
               u"%s '%s'"% (_("no connection established for user"), dl.name))

        return result