Commit 9c206da5 authored by Hugh Davenport's avatar Hugh Davenport Committed by Gerrit Code Review
Browse files

Merge "Email user with username when leaving external auth"

parents a5bbf177 a5c90219
......@@ -445,6 +445,41 @@ $string['noinstitutionsetpassemailmessagehtml'] = '<p>Dear %s,</p>
<p>Regards, %s Site Administrator</p>
<p><a href="%sforgotpass.php?key=%s">%sforgotpass.php?key=%s</a></p>';
// Send information about username and how to reset password
// when moving from external to internal auth with a password already set
$string['noinstitutionoldpassemailsubject'] = '%s: Membership of %s';
$string['noinstitutionoldpassemailmessagetext'] = 'Dear %s,
You are no longer a member of %s.
You may continue to use %s with your current username %s, and the password that you have already set for your account.
If you have forgotten your password, you can reset it by going to the following page and entering in your username.
%sforgotpass.php
If you have any questions regarding the above, please feel free to contact
us.
%scontact.php
Regards, %s Site Administrator
%sforgotpass.php';
$string['noinstitutionoldpassemailmessagehtml'] = '<p>Dear %s,</p>
<p>You are no longer a member of %s.</p>
<p>You may continue to use %s with your current username %s, and the password that you have already set for your account.</p>
<p>If you have forgotten your password, you can reset it by going to the following page and entering in your username.</p>
<p><a href="%sforgotpass.php">%sforgotpass.php</a></p>
<p>If you have any questions regarding the above, please feel free to <a href="%scontact.php">contact us</a>.</p>
<p>Regards, %s Site Administrator</p>
<p><a href="%sforgotpass.php">%sforgotpass.php</a></p>';
$string['debugemail'] = 'NOTICE: This e-mail was intended for %s <%s> but has been sent to you as per the "sendallemailto" configuration setting.';
$string['divertingemailto'] = 'Diverting email to %s';
......@@ -948,4 +983,4 @@ $string['howtodisable'] = 'You have hidden the information box. You can control
$string['setblocktitle'] = 'Set a block title';
// Download
$string['filenotfound'] = 'File not found';
\ No newline at end of file
$string['filenotfound'] = 'File not found';
......@@ -443,6 +443,14 @@ class Institution {
log_debug('resetting pw for '.$user->id);
$this->removeMemberSetPassword($user);
}
else if ($authinstances[$oldauth]->authname != 'internal') {
$sitename = get_config('sitename');
$fullname = display_name($user, null, true);
email_user($user, null,
get_string('noinstitutionoldpassemailsubject', 'mahara', $sitename, $this->displayname),
get_string('noinstitutionoldpassemailmessagetext', 'mahara', $fullname, $this->displayname, $sitename, $user->username, get_config('wwwroot'), get_config('wwwroot'), $sitename, get_config('wwwroot')),
get_string('noinstitutionoldpassemailmessagehtml', 'mahara', hsc($fullname), hsc($this->displayname), hsc($sitename), hsc($user->username), get_config('wwwroot'), get_config('wwwroot'), get_config('wwwroot'), hsc($sitename), get_config('wwwroot'), get_config('wwwroot')));
}
update_record('usr', $user);
}
......
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