diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 13ae44463d6..34651304b95 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"; 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 = '