From 61c17f8d0fc32b0d12a020bedbe4cb49c60aaa78 Mon Sep 17 00:00:00 2001 From: Nicolas ZABOURI Date: Sun, 19 May 2019 02:06:37 +0200 Subject: [PATCH 1/2] FIX #11135 --- htdocs/user/class/user.class.php | 8 ++++++-- htdocs/user/passwordforgotten.php | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 13ae44463d6..923542a08f6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1961,17 +1961,21 @@ class User extends CommonObject $mesg = ''; $outputlangs=new Translate("", $conf); + if (isset($this->conf->MAIN_LANG_DEFAULT) && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); } + if($user->conf->MAIN_LANG_DEFAULT){ + $outputlangs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT); + } else { // If user has not defined its own language, we used current language $outputlangs=$langs; } - // Load translation files required by the page + // Load translation files required by the page $outputlangs->loadLangs(array("main", "errors", "users", "other")); $appli=constant('DOL_APPLICATION_TITLE'); @@ -1986,7 +1990,6 @@ class User extends CommonObject if (! $changelater) { $url = $urlwithroot.'/'; - $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n"; @@ -2015,6 +2018,7 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } + $mesg.="
".print_r($user,1)."
"; $mailfile = new CMailFile( $subject, $this->email, diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index e16c4856eba..2bd69799487 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -125,8 +125,9 @@ if ($action == 'buildnewpassword' && $username) } else { + // Success - if ($edituser->send_password($user, $newpassword, 1) > 0) + if ($edituser->send_password($edituser, $newpassword, 1) > 0) { $message = '
'.$langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email)).'
'; From 4b3d0ed50cf671835e0d0fafc9efa95f8feb9c3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 19 May 2019 02:21:42 +0200 Subject: [PATCH 2/2] Update user.class.php --- htdocs/user/class/user.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 923542a08f6..34651304b95 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2018,7 +2018,6 @@ class User extends CommonObject dol_syslog(get_class($this)."::send_password changelater is on, url=".$url); } - $mesg.="
".print_r($user,1)."
"; $mailfile = new CMailFile( $subject, $this->email,