diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index f8c035779d2..7f8ad45a06d 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -77,7 +77,10 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) { if (dol_verifyHash($edituser->pass_temp, $passwordhash)) { - setEventMessages('NewPasswordValidated', null, 'mesgs'); + // Clear session + $_SESSION['dol_login'] = ''; + $_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page + $newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0); dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database"); header("Location: ".DOL_URL_ROOT.'/');