Fix: le lien de confirmation ne s'affichait pas correctement et le FROM n'était pas défini

This commit is contained in:
Regis Houssin 2007-06-02 08:43:14 +00:00
parent 984e9d3641
commit c2b5478cea
2 changed files with 21 additions and 21 deletions

View File

@ -1087,7 +1087,7 @@ class User
*/ */
function send_password($user, $password='', $changelater=0) function send_password($user, $password='', $changelater=0)
{ {
global $langs; global $conf,$langs;
require_once DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"; require_once DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php";
@ -1099,29 +1099,29 @@ class User
if (! $changelater) if (! $changelater)
{ {
$mesg.= "A request to change your Dolibarr password has been received.\n"; $mesg.= "A request to change your Dolibarr password has been received.\n";
$mesg.= "This is your new keys to login:\n\n"; $mesg.= "This is your new keys to login:\n\n";
$mesg.= $langs->trans("Login")." : $this->login\n"; $mesg.= $langs->trans("Login")." : $this->login\n";
$mesg.= $langs->trans("Password")." : $password\n\n"; $mesg.= $langs->trans("Password")." : $password\n\n";
$mesg.= "\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.= '<a href="'.$url.'">Go to Dolibarr</a>'."\n\n";
$mesg.= "--\n"; $mesg.= "--\n";
$mesg.= $user->fullname; // Username that make then sending $mesg.= $user->fullname; // Username that make then sending
} }
else else
{ {
$mesg.= "A request to change your Dolibarr password has been received.\n"; $mesg.= "A request to change your Dolibarr password has been received.\n";
$mesg.= "Your new key to login will be:\n\n"; $mesg.= "Your new key to login will be:\n\n";
$mesg.= $langs->trans("Login")." : $this->login\n"; $mesg.= $langs->trans("Login")." : $this->login\n";
$mesg.= $langs->trans("Password")." : $password\n\n"; $mesg.= $langs->trans("Password")." : $password\n\n";
$mesg.= "\n"; $mesg.= "\n";
$mesg.= "You must click on the folowing link to validate its change.\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); $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"; $mesg.= $url."\n\n";
$mesg.= "If you didn't ask anything, just forget this email\n\n"; $mesg.= "If you didn't ask anything, just forget this email\n\n";
dolibarr_syslog("User::send_password url=".$url); 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(), array(),array(),array(),
'', '', 0, $msgishtml); '', '', 0, $msgishtml);

View File

@ -100,15 +100,15 @@ if ($_POST["action"] == 'buildnewpassword' && $_POST["username"])
{ {
// Succes // Succes
if ($edituser->send_password($user,$newpassword,1) > 0) if ($edituser->send_password($user,$newpassword,1) > 0)
{ {
$message = '<div class="ok">'.$langs->trans("PasswordChangedAndSentTo",$edituser->email).'</div>'; $message = '<div class="ok">'.$langs->trans("PasswordChangedAndSentTo",$edituser->email).'</div>';
//$message.=$newpassword; //$message.=$newpassword;
} }
else else
{ {
//$message = '<div class="ok">'.$langs->trans("PasswordChangedTo",$newpassword).'</div>'; //$message = '<div class="ok">'.$langs->trans("PasswordChangedTo",$newpassword).'</div>';
$message.= '<div class="error">'.$edituser->error.'</div>'; $message.= '<div class="error">'.$edituser->error.'</div>';
} }
} }
} }
} }