use already existing variable

This commit is contained in:
De Coninck Laurent 2017-02-13 16:49:10 +01:00
parent b356c34dc4
commit 294517a8e0

View File

@ -1652,13 +1652,12 @@ class User extends CommonObject
$subject = $outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli);
// Define $urlwithroot
//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
if (! $changelater)
{
$url = $dolibarr_main_url_root.'/';
$url = $urlwithroot.'/';
$mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n";
$mesg.= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n";
@ -1674,7 +1673,7 @@ class User extends CommonObject
}
else
{
$url = $dolibarr_main_url_root.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password);
$url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordhash=".dol_hash($password);
$mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n";
$mesg.= $outputlangs->transnoentitiesnoconv("NewKeyWillBe")." :\n\n";