예제 #1
0
파일: users.py 프로젝트: arturodr/indico
    def _process(self):
        if self._params.get("OK", None) is not None:
            if self._params.get("password", "") == "" or self._params.get(
                    "passwordBis", "") == "":
                self._params["msg"] = _(
                    "Both password and password confirmation fields must be filled up"
                )
                del self._params["OK"]
                p = adminPages.WPIdentityChangePassword(
                    self, self._avatar, self._params)
                return p.display()
            if self._params.get("password", "") != self._params.get(
                    "passwordBis", ""):
                self._params["msg"] = _(
                    "Password and password confirmation are not equal")
                del self._params["OK"]
                p = adminPages.WPIdentityChangePassword(
                    self, self._avatar, self._params)
                return p.display()
            identity = self._avatar.getIdentityById(self._params["login"],
                                                    "Local")
            identity.setPassword(self._params["password"])
            p = adminPages.WPUserDetails(self, self._avatar)
            return p.display()
        elif self._params.get("Cancel", None) is not None:
            p = adminPages.WPUserDetails(self, self._avatar)
            return p.display()

        self._params["msg"] = ""
        p = adminPages.WPIdentityChangePassword(self, self._avatar,
                                                self._params)
        return p.display()
예제 #2
0
파일: users.py 프로젝트: arturodr/indico
    def _process(self):

        if self._params.get("Cancel", None) is not None:
            p = adminPages.WPUserDetails(self, self._avatar)
            return p.display()

        msg = ""
        ok = False
        if self._ok:
            ok = True
            ih = AuthenticatorMgr()
            #first, check if login is free
            if not ih.isLoginFree(self._login):
                msg += "Sorry, the login you requested is already in use. Please choose another one.<br>"
                ok = False
            if not self._pwd:
                msg += "you must enter a password<br>"
                ok = False
            #then, check if password is OK
            if self._pwd != self._pwdBis:
                msg += "You must enter the same password twice<br>"
                ok = False
            if ok:
                #create the indentity
                li = user.LoginInfo(self._login, self._pwd)
                id = ih.createIdentity(li, self._avatar, self._system)
                ih.add(id)
                self._redirect(urlHandlers.UHUserDetails.getURL(self._avatar))
                return

        self._params["msg"] = msg
        p = adminPages.WPIdentityCreation(self, self._avatar, self._params)
        return p.display()
예제 #3
0
파일: users.py 프로젝트: arturodr/indico
 def _process(self):
     p = adminPages.WPUserDetails(self, self._avatar)
     return p.display()