MDL-32572 fix notice when changing internal auth_db passwords
authorPetr Škoda <commits@skodak.org>
Tue, 18 Sep 2012 11:17:35 +0000 (13:17 +0200)
committerPetr Škoda <commits@skodak.org>
Tue, 18 Sep 2012 11:18:18 +0000 (13:18 +0200)
auth/db/auth.php

index 6e29147..5882bcf 100644 (file)
@@ -191,8 +191,16 @@ class auth_plugin_db extends auth_plugin_base {
      * @return bool                  True on success
      */
     function user_update_password($user, $newpassword) {
      * @return bool                  True on success
      */
     function user_update_password($user, $newpassword) {
+        global $DB;
+
         if ($this->is_internal()) {
         if ($this->is_internal()) {
-            return update_internal_user_password($user, $newpassword);
+            $puser = $DB->get_record('user', array('id'=>$user->id), '*', MUST_EXIST);
+            if (update_internal_user_password($puser, $newpassword)) {
+                $user->password = $puser->password;
+                return true;
+            } else {
+                return false;
+            }
         } else {
             // we should have never been called!
             return false;
         } else {
             // we should have never been called!
             return false;