From 88fbc9a7ef5d6d99cdab6913868ccfda80ded6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Tue, 18 Sep 2012 13:17:35 +0200 Subject: [PATCH] MDL-32572 fix notice when changing internal auth_db passwords --- auth/db/auth.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/auth/db/auth.php b/auth/db/auth.php index 6e291470dec..5882bcf6c63 100644 --- a/auth/db/auth.php +++ b/auth/db/auth.php @@ -191,8 +191,16 @@ class auth_plugin_db extends auth_plugin_base { * @return bool True on success */ function user_update_password($user, $newpassword) { + global $DB; + 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;