Skip to content
Snippets Groups Projects
Commit 4eb37abe authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Translate the email to change password.

parent 4ec85e67
Branches
Tags
No related merge requests found
...@@ -55,6 +55,7 @@ For users: ...@@ -55,6 +55,7 @@ For users:
For translators: For translators:
- Qual: Normalized sort order of all languages files with english reference files. - Qual: Normalized sort order of all languages files with english reference files.
- New: Add language code files for South Africa. - New: Add language code files for South Africa.
- New: Translate the email to change password.
For developers: For developers:
- New: DolGraph can build graph with three lines. - New: DolGraph can build graph with three lines.
......
...@@ -174,6 +174,12 @@ StartUpload=Start upload ...@@ -174,6 +174,12 @@ StartUpload=Start upload
CancelUpload=Cancel upload CancelUpload=Cancel upload
FileIsTooBig=Files is too big FileIsTooBig=Files is too big
PleaseBePatient=Please be patient... PleaseBePatient=Please be patient...
RequestToResetPasswordReceived=A request to change your Dolibarr password has been received
NewKeyIs=This is your new keys to login
NewKeyWillBe=Your new key to login to software will be
ClickHereToGoTo=Click here to go to %s
YouMustClickToChange=You must however first click on the following link to validate this password change
ForgetIfNothing=If you didn't request this change, just forget this email. Your credentials are kept safe.
##### Calendar common ##### ##### Calendar common #####
AddCalendarEntry=Add entry in calendar %s AddCalendarEntry=Add entry in calendar %s
......
...@@ -117,3 +117,4 @@ DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin ...@@ -117,3 +117,4 @@ DontDowngradeSuperAdmin=Only a superadmin can downgrade a superadmin
HierarchicalResponsible=Hierarchical responsible HierarchicalResponsible=Hierarchical responsible
HierarchicView=Hierarchical view HierarchicView=Hierarchical view
UseTypeFieldToChange=Use field Type to change UseTypeFieldToChange=Use field Type to change
...@@ -174,6 +174,12 @@ StartUpload=Transférer ...@@ -174,6 +174,12 @@ StartUpload=Transférer
CancelUpload=Annuler le transfert CancelUpload=Annuler le transfert
FileIsTooBig=Le fichier est trop volumineux FileIsTooBig=Le fichier est trop volumineux
PleaseBePatient=Merci de patienter quelques instants… PleaseBePatient=Merci de patienter quelques instants…
RequestToResetPasswordReceived=Une demande de modification de mot de passe a été reçue
NewKeyIs=Voici vos nouveaux identifiants pour vous connecter
NewKeyWillBe=Vos nouveaux identifiants pour vous connecter à l'application seront
ClickHereToGoTo=Cliquez ici pour aller sur %s
YouMustClickToChange=Vous devez toutefois auparavant cliquer sur le lien suivant, afin de valider ce changement de mot de passe
ForgetIfNothing=Si vous n'êtes pas à l'origine de la demande, ignorez simplement ce mail. Votre accès reste sécurisé.
##### Calendar common ##### ##### Calendar common #####
AddCalendarEntry=Ajouter entrée dans le calendrier %s AddCalendarEntry=Ajouter entrée dans le calendrier %s
......
...@@ -1457,7 +1457,6 @@ class User extends CommonObject ...@@ -1457,7 +1457,6 @@ class User extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$subject = $langs->trans("SubjectNewPassword");
$msgishtml=0; $msgishtml=0;
// Define $msg // Define $msg
...@@ -1474,35 +1473,41 @@ class User extends CommonObject ...@@ -1474,35 +1473,41 @@ class User extends CommonObject
$outputlangs=$langs; $outputlangs=$langs;
} }
$outputlangs->load("main");
$outputlangs->load("errors");
$outputlangs->load("users");
$outputlangs->load("other");
$subject = $outputlangs->trans("SubjectNewPassword");
// Define $urlwithroot // Define $urlwithroot
//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); //$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=$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 $urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// TODO Use outputlangs to translate messages
if (! $changelater) if (! $changelater)
{ {
$mesg.= "A request to change your Dolibarr password has been received.\n"; $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived").".\n";
$mesg.= "This is your new keys to login:\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyIs")." :\n\n";
$mesg.= $langs->trans("Login")." : $this->login\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n";
$mesg.= $langs->trans("Password")." : $password\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n";
$mesg.= "\n"; $mesg.= "\n";
$url = $urlwithroot; $url = $urlwithroot;
$mesg.= 'Click here to go to Dolibarr: '.$url."\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("ClickHereToGoTo", $conf->global->MAIN_APPLICATION_TITLE).': '.$url."\n\n";
$mesg.= "--\n"; $mesg.= "--\n";
$mesg.= $user->getFullName($langs); // Username that make then sending $mesg.= $user->getFullName($outputlangs); // Username that make then sending
} }
else else
{ {
$mesg.= "A request to change your Dolibarr password has been received.\n"; $mesg.= $outputlangs->transnoentitiesnoconv("RequestToResetPasswordReceived")."\n";
$mesg.= "Your new key to login will be:\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("NewKeyWillBe")." :\n\n";
$mesg.= $langs->trans("Login")." : $this->login\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Login")." = ".$this->login."\n";
$mesg.= $langs->trans("Password")." : $password\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("Password")." = ".$password."\n\n";
$mesg.= "\n"; $mesg.= "\n";
$mesg.= "You must click on the folowing link to validate its change.\n"; $mesg.= $outputlangs->transnoentitiesnoconv("YouMustClickToChange")." :\n";
$url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordmd5=".dol_hash($password); $url = $urlwithroot.'/user/passwordforgotten.php?action=validatenewpassword&username='.$this->login."&passwordmd5=".dol_hash($password);
$mesg.= $url."\n\n"; $mesg.= $url."\n\n";
$mesg.= "If you didn't ask anything, just forget this email\n\n"; $mesg.= $outputlangs->transnoentitiesnoconv("ForgetIfNothing")."\n\n";
dol_syslog(get_class($this)."::send_password url=".$url); dol_syslog(get_class($this)."::send_password url=".$url);
} }
$mailfile = new CMailFile( $mailfile = new CMailFile(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment