From d796f403a9d79b79c7b70e2274326e27749a8622 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Jan 2018 15:43:55 +0100 Subject: [PATCH] Fix sender email when sending a password remind --- htdocs/core/class/CMailFile.class.php | 2 +- htdocs/langs/en_US/users.lang | 1 + htdocs/user/class/user.class.php | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 86a6cb008d3..d9469c11559 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -108,7 +108,7 @@ class CMailFile * @param string $css Css option * @param string $trackid Tracking string (contains type and id of related element) * @param string $moreinheader More in header. $moreinheader must contains the "\r\n" (TODO not supported for other MAIL_SEND_MODE different than 'phpmail' and 'smtps' for the moment) - * @param string $sendcontext 'standard', 'emailing', ... + * @param string $sendcontext 'standard', 'emailing', ... (used to define with sending mode and parameters to use) */ function __construct($subject,$to,$from,$msg,$filename_list=array(),$mimetype_list=array(),$mimefilename_list=array(),$addr_cc="",$addr_bcc="",$deliveryreceipt=0,$msgishtml=0,$errors_to='',$css='',$trackid='',$moreinheader='',$sendcontext='standard') { diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 3ae08747510..3c1a8644bf0 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -6,6 +6,7 @@ Permission=Permission Permissions=Permissions EditPassword=Edit password SendNewPassword=Regenerate and send password +SendNewPasswordLink=Send link to reset password ReinitPassword=Regenerate password PasswordChangedTo=Password changed to: %s SubjectNewPassword=Your new password for %s diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index f8b263b49a4..6a2a1b774e7 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1784,7 +1784,7 @@ class User extends CommonObject * * @param User $user Object user that send email * @param string $password New password - * @param int $changelater 1=Change password only after clicking on confirm email + * @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 */ function send_password($user, $password='', $changelater=0) @@ -1859,7 +1859,7 @@ class User extends CommonObject $mailfile = new CMailFile( $subject, $this->email, - $conf->notification->email_from, + $conf->global->MAIN_MAIL_EMAIL_FROM, $mesg, array(), array(),