Fix: le lien de confirmation ne s'affichait pas correctement et le FROM n'tait pas dfini
This commit is contained in:
parent
984e9d3641
commit
c2b5478cea
@ -1087,7 +1087,7 @@ class User
|
||||
*/
|
||||
function send_password($user, $password='', $changelater=0)
|
||||
{
|
||||
global $langs;
|
||||
global $conf,$langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php";
|
||||
|
||||
@ -1099,29 +1099,29 @@ class User
|
||||
if (! $changelater)
|
||||
{
|
||||
$mesg.= "A request to change your Dolibarr password has been received.\n";
|
||||
$mesg.= "This is your new keys to login:\n\n";
|
||||
$mesg.= $langs->trans("Login")." : $this->login\n";
|
||||
$mesg.= $langs->trans("Password")." : $password\n\n";
|
||||
$mesg.= "This is your new keys to login:\n\n";
|
||||
$mesg.= $langs->trans("Login")." : $this->login\n";
|
||||
$mesg.= $langs->trans("Password")." : $password\n\n";
|
||||
$mesg.= "\n";
|
||||
$url = "http://".$_SERVER["HTTP_HOST"].DOL_URL_ROOT;
|
||||
$url = "http://".$_SERVER["HTTP_HOST"].DOL_URL_ROOT;
|
||||
$mesg.= '<a href="'.$url.'">Go to Dolibarr</a>'."\n\n";
|
||||
$mesg.= "--\n";
|
||||
$mesg.= $user->fullname; // Username that make then sending
|
||||
$mesg.= "--\n";
|
||||
$mesg.= $user->fullname; // Username that make then sending
|
||||
}
|
||||
else
|
||||
{
|
||||
$mesg.= "A request to change your Dolibarr password has been received.\n";
|
||||
$mesg.= "Your new key to login will be:\n\n";
|
||||
$mesg.= $langs->trans("Login")." : $this->login\n";
|
||||
$mesg.= "Your new key to login will be:\n\n";
|
||||
$mesg.= $langs->trans("Login")." : $this->login\n";
|
||||
$mesg.= $langs->trans("Password")." : $password\n\n";
|
||||
$mesg.= "\n";
|
||||
$mesg.= "You must click on the folowing link to validate its change.\n";
|
||||
$url = "http://".$_SERVER["HTTP_HOST"].DOL_URL_ROOT.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordmd5=".md5($password);
|
||||
$mesg.= '<a href="'.$url.'">Validate my new password</a>'."\n\n";
|
||||
$url = "http://".$_SERVER["HTTP_HOST"].DOL_URL_ROOT.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordmd5=".md5($password);
|
||||
$mesg.= $url."\n\n";
|
||||
$mesg.= "If you didn't ask anything, just forget this email\n\n";
|
||||
dolibarr_syslog("User::send_password url=".$url);
|
||||
}
|
||||
$mailfile = new CMailFile($subject,$this->email,$conf->email_from,$mesg,
|
||||
$mailfile = new CMailFile($subject,$this->email,$conf->notification->email_from,$mesg,
|
||||
array(),array(),array(),
|
||||
'', '', 0, $msgishtml);
|
||||
|
||||
|
||||
@ -100,15 +100,15 @@ if ($_POST["action"] == 'buildnewpassword' && $_POST["username"])
|
||||
{
|
||||
// Succes
|
||||
if ($edituser->send_password($user,$newpassword,1) > 0)
|
||||
{
|
||||
$message = '<div class="ok">'.$langs->trans("PasswordChangedAndSentTo",$edituser->email).'</div>';
|
||||
//$message.=$newpassword;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$message = '<div class="ok">'.$langs->trans("PasswordChangedTo",$newpassword).'</div>';
|
||||
$message.= '<div class="error">'.$edituser->error.'</div>';
|
||||
}
|
||||
{
|
||||
$message = '<div class="ok">'.$langs->trans("PasswordChangedAndSentTo",$edituser->email).'</div>';
|
||||
//$message.=$newpassword;
|
||||
}
|
||||
else
|
||||
{
|
||||
//$message = '<div class="ok">'.$langs->trans("PasswordChangedTo",$newpassword).'</div>';
|
||||
$message.= '<div class="error">'.$edituser->error.'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user