Commit ee9e4ba2 authored by Aurel's avatar Aurel

user_login is no longer mandatory, it now depends on site configuration

parent 1a19ea70
......@@ -255,8 +255,8 @@ class PasswordTool(BaseTool):
def changeUserPassword(self, user_login, password, password_confirmation,
password_key, REQUEST=None):
def changeUserPassword(self, password, password_confirmation,
password_key, user_login=None, REQUEST=None):
Reset the password for a given login
......@@ -275,7 +275,7 @@ class PasswordTool(BaseTool):
site_url = self.getWebSiteValue().absolute_url()
if register_user_login is None:
msg = "Key not known. Please ask reset password."
elif register_user_login != user_login:
elif user_login is not None and register_user_login != user_login:
msg = translateString("Bad login provided.")
elif current_date > expiration_date:
msg = translateString("Date has expire.")
......@@ -293,7 +293,7 @@ class PasswordTool(BaseTool):
# all is OK, change password and remove it from request dict
persons = self.getPortalObject().acl_users.erp5_users.getUserByLogin(user_login)
persons = self.getPortalObject().acl_users.erp5_users.getUserByLogin(register_user_login)
person = persons[0]
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment