Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated bugfix according to Jerome suggestions

password check is done at lib.php instead of externallib.php

Conflicts:

	user/lib.php
  • Loading branch information...
commit 9e63c0ff714eb56a40f0dbe094e352a48443f3ac 1 parent 5fc420e
Fábio Souto fabiomsouto authored mouneyrac committed

Showing 1 changed file with 13 additions and 3 deletions. Show diff stats Hide diff stats

  1. +13 3 user/lib.php
16 user/lib.php
@@ -69,15 +69,25 @@ function user_update_user($user) {
69 69 if (!is_object($user)) {
70 70 $user = (object)$user;
71 71 }
72   -
73   - /// hash the password
74   - $user->password = hash_internal_user_password($user->password);
  72 +
  73 + //MDL-30878
  74 + //unset password here, for updating later
  75 + if (isset($user->password)) {
  76 + $passwd = $user->password;
  77 + unset($user->password);
  78 + }
75 79
76 80 $user->timemodified = time();
77 81 $DB->update_record('user', $user);
78 82
79 83 /// trigger user_updated event on the full database user row
80 84 $updateduser = $DB->get_record('user', array('id' => $user->id));
  85 +
  86 + //MDL-30878
  87 + //if password was set, then update its hash
  88 + if (isset($passwd))
  89 + update_internal_user_password($updateduser, $passwd);
  90 +
81 91 events_trigger('user_updated', $updateduser);
82 92
83 93 }

0 comments on commit 9e63c0f

Please sign in to comment.
Something went wrong with that request. Please try again.