Commit 7e16aab4 authored by Nigel McNie's avatar Nigel McNie

Ensure that the user's e-mail address is set correctly if it needs to be set...

Ensure that the user's e-mail address is set correctly if it needs to be set when changing password.
parent 6c3317dd
......@@ -666,6 +666,8 @@ function change_password_submit(Pieform $form, $values) {
if ($password = $authobj->change_password($USER, $values['password1'])) {
$SESSION->add_ok_msg(get_string('passwordsaved'));
if (!empty($values['email'])) {
$USER->email = $values['email'];
$USER->commit();
set_profile_field($USER->id, 'email', $values['email']);
}
redirect();
......
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