Commit fa2ba745 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Use user's name and site name in forgot password email

parent ece1c643
......@@ -128,10 +128,12 @@ function forgotpass_submit($values) {
$pwrequest->usr = $user->id;
$pwrequest->expiry = db_format_timestamp(time() + 86400);
$pwrequest->key = get_random_key();
$sitename = get_config('sitename');
$fullname = display_name($user);
email_user($user, null,
get_string('forgotpassemailsubject', 'mahara', get_config('sitename')),
get_string('forgotpassemailmessagetext', 'mahara', $pwrequest->key, $pwrequest->key),
get_string('forgotpassemailmessagehtml', 'mahara', $pwrequest->key, $pwrequest->key, $pwrequest->key, $pwrequest->key));
get_string('forgotpassemailsubject', 'mahara', $sitename),
get_string('forgotpassemailmessagetext', 'mahara', $fullname, $sitename, $pwrequest->key, $sitename, $pwrequest->key),
get_string('forgotpassemailmessagehtml', 'mahara', $fullname, $sitename, $pwrequest->key, $pwrequest->key, $sitename, $pwrequest->key, $pwrequest->key));
insert_record('usr_password_request', $pwrequest);
}
catch (SQLException $e) {
......
......@@ -75,9 +75,9 @@ $string['registrationnosuchkey'] = 'Sorry, there does not seem to be a registrat
// Forgot password
$string['pwchangerequestsent'] = 'You should receive an e-mail shortly with a link you can use to change the password for your account';
$string['forgotpassemailsubject'] = 'Change password request for %s';
$string['forgotpassemailmessagetext'] = 'Dear $fullname,
$string['forgotpassemailmessagetext'] = 'Dear %s,
A request to reset your password has been received for your $sitename account.
A request to reset your password has been received for your %s account.
Please follow the link below to continue the reset process.
......@@ -90,12 +90,12 @@ us.
' . get_config('wwwroot') . 'contact.php
Regards, $sitename Site Administrator
Regards, %s Site Administrator
' . get_config('wwwroot') . 'forgotpass.php?key=%s';
$string['forgotpassemailmessagehtml'] = '<p>Dear $fullname,</p>
$string['forgotpassemailmessagehtml'] = '<p>Dear %s,</p>
<p>A request to reset your password has been received for your $sitename account.</p>
<p>A request to reset your password has been received for your %s account.</p>
<p>Please follow the link below to continue the reset process.</p>
......@@ -105,7 +105,7 @@ $string['forgotpassemailmessagehtml'] = '<p>Dear $fullname,</p>
<p>If you have any questsions regarding the above, please feel free to <a href="' . get_config('wwwroot') . 'contact.php">contact us</a>.</p>
<p>Regards, $sitename Site Administrator</p>
<p>Regards, %s Site Administrator</p>
<p><a href="' . get_config('wwwroot') . 'forgotpass.php?key=%s">' . get_config('wwwroot') . 'forgotpass.php?key=%s</a></p>';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment