def reset(self, login, code, password): auth = getUtility(IAuthentication) pf = auth[u'principalfolder'] if login in pf: principal_id = pf.prefix + login data = self.requests.get(code) if data and data['id'] == principal_id: ip = internal_principal(principal_id) ip.setPassword(password, "SSHA") notify(PasswordResetEvent(principal_id, password))
def update(self): old = self.request.get('old') new = self.request.get('new') if old and new: ip = internal_principal(self.request.principal.id) if ip.checkPassword(old): ip.setPassword(new, "SSHA") self.status = u"Password successfully updated" else: self.status = u"Wrong old password"
def name(self, v): self.annotations['name'] = v # for principalfolder search ip = internal_principal(self.principal.id) ip.title = v