Merge branch 'develop' of https://github.com/dolibarr/dolibarr into develop

This commit is contained in:
Laurent Destailleur 2019-05-19 13:52:28 +02:00
commit 2900f8828a
2 changed files with 7 additions and 3 deletions

View File

@ -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";

View File

@ -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 = '<div class="ok">'.$langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email)).'</div>';