Fix use correct trackid
This commit is contained in:
parent
db40dd8e49
commit
abdb0cc8c0
@ -1972,12 +1972,12 @@ class User extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Send new password by email
|
* Send new password by email
|
||||||
*
|
*
|
||||||
* @param User $fuser Object user that send email
|
* @param User $user Object user that send the email (not the user we send too)
|
||||||
* @param string $password New password
|
* @param string $password New password
|
||||||
* @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @todo Add method 2 = Send link to reset password
|
* @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @todo Add method 2 = Send link to reset password
|
||||||
* @return int < 0 si erreur, > 0 si ok
|
* @return int < 0 si erreur, > 0 si ok
|
||||||
*/
|
*/
|
||||||
public function send_password($fuser, $password = '', $changelater = 0)
|
public function send_password($user, $password = '', $changelater = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
@ -1997,8 +1997,9 @@ class User extends CommonObject
|
|||||||
{ // If user has defined its own language (rare because in most cases, auto is used)
|
{ // If user has defined its own language (rare because in most cases, auto is used)
|
||||||
$outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT);
|
$outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT);
|
||||||
}
|
}
|
||||||
if ($fuser->conf->MAIN_LANG_DEFAULT) {
|
|
||||||
$outputlangs->setDefaultLang($fuser->conf->MAIN_LANG_DEFAULT);
|
if ($this->conf->MAIN_LANG_DEFAULT) {
|
||||||
|
$outputlangs->setDefaultLang($this->conf->MAIN_LANG_DEFAULT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // If user has not defined its own language, we used current language
|
{ // If user has not defined its own language, we used current language
|
||||||
@ -2028,7 +2029,7 @@ class User extends CommonObject
|
|||||||
|
|
||||||
$mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n";
|
$mesg .= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $appli).': '.$url."\n\n";
|
||||||
$mesg .= "--\n";
|
$mesg .= "--\n";
|
||||||
$mesg .= $fuser->getFullName($outputlangs); // Username that make then sending
|
$mesg .= $user->getFullName($outputlangs); // Username that send email
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::send_password changelater is off, url=".$url);
|
dol_syslog(get_class($this)."::send_password changelater is off, url=".$url);
|
||||||
}
|
}
|
||||||
@ -2048,7 +2049,7 @@ class User extends CommonObject
|
|||||||
dol_syslog(get_class($this)."::send_password changelater is on, url=".$url);
|
dol_syslog(get_class($this)."::send_password changelater is on, url=".$url);
|
||||||
}
|
}
|
||||||
|
|
||||||
$trackid = 'use'.$fuser->id;
|
$trackid = 'use'.$this->id;
|
||||||
|
|
||||||
$mailfile = new CMailFile(
|
$mailfile = new CMailFile(
|
||||||
$subject,
|
$subject,
|
||||||
|
|||||||
@ -131,7 +131,7 @@ if ($action == 'buildnewpassword' && $username)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Success
|
// Success
|
||||||
if ($edituser->send_password($edituser, $newpassword, 1) > 0)
|
if ($edituser->send_password($user, $newpassword, 1) > 0)
|
||||||
{
|
{
|
||||||
$message = '<div class="ok'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">'.$langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email)).'</div>';
|
$message = '<div class="ok'.(empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent').'">'.$langs->trans("PasswordChangeRequestSent", $edituser->login, dolObfuscateEmail($edituser->email)).'</div>';
|
||||||
$username = '';
|
$username = '';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user