Permalink
Browse files

MDL-32572 fix notice when changing internal auth_db passwords

  • Loading branch information...
1 parent 8f93c40 commit 9559ed75c3d23472201596541f2b0bfda7d15e3b @skodak skodak committed with stronk7 Sep 18, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 auth/db/auth.php
View
@@ -191,8 +191,16 @@ function get_userinfo($username) {
* @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;

0 comments on commit 9559ed7

Please sign in to comment.