]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20209 fixed regression - the email has to be synced with ext auth when change...
authorskodak <skodak>
Sun, 27 Sep 2009 09:23:28 +0000 (09:23 +0000)
committerskodak <skodak>
Sun, 27 Sep 2009 09:23:28 +0000 (09:23 +0000)
user/emailupdate.php

index 6cb2d9cd699e78519b7ad470708c17b4b94af0e9..b7b658b6bda93d7d79c702040bdf1a1b97bf5ff0 100755 (executable)
@@ -55,6 +55,7 @@ if (empty($preferences['newemailattemptsleft'])) {
     echo $OUTPUT->box($stroutofattempts, 'center');
 
 } elseif ($key == $preferences['newemailkey']) {
+    $olduser = clone($user);
     cancel_email_update($user->id);
     $user->email = $preferences['newemail'];
 
@@ -66,6 +67,8 @@ if (empty($preferences['newemailattemptsleft'])) {
     } else {
         // update user email
         $DB->set_field('user', 'email', $user->email, array('id' => $user->id));
+        $authplugin = get_auth_plugin($user->auth);
+        $authplugin->user_update($olduser, $user);
         events_trigger('user_updated', $user);
         $a->email = $user->email;
         $stremailupdatesuccess = get_string('auth_emailupdatesuccess', 'auth_email', $a);