From 1ec8b31e46e7ef1d1036f08b4814170ed501618c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 May 2020 15:15:12 +0200 Subject: [PATCH] Fix remove action param in url to allow a second try without the error message --- htdocs/core/tpl/passwordforgotten.tpl.php | 1 + htdocs/user/class/user.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php index ab12b48aa08..63ff6a8a0a7 100644 --- a/htdocs/core/tpl/passwordforgotten.tpl.php +++ b/htdocs/core/tpl/passwordforgotten.tpl.php @@ -40,6 +40,7 @@ if (!empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax = 1; $php_self = $_SERVER['PHP_SELF']; $php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : ''; +$php_self = str_replace('action=validatenewpassword', '', $php_self); $titleofpage = $langs->trans('SendNewPassword'); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e20c1ca527b..11d0cec3654 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1838,7 +1838,7 @@ class User extends CommonObject /** * Change password of a user * - * @param User $user Object user of user making change + * @param User $user Object user of user requesting the change (not the user for who we change the password). May be unknown. * @param string $password New password in clear text (to generate if not provided) * @param int $changelater 1=Change password only after clicking on confirm email * @param int $notrigger 1=Does not launch triggers @@ -2029,7 +2029,7 @@ class User extends CommonObject $mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n"; $mesg .= "--\n"; - $mesg .= $user->getFullName($outputlangs); // Username that send email + $mesg .= $user->getFullName($outputlangs); // Username that send the email (not the user for who we want to reset password) dol_syslog(get_class($this)."::send_password changelater is off, url=".$url); }