Skip to content
Browse files

MDL-41170: Added user updated event triggers to password updating fun…

…ctions.
  • Loading branch information...
1 parent 85cb1bc commit 74f501e7b5e14377df5a0f6a6116336b27055661 @number33 number33 committed with ankitagarwal Aug 20, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/moodlelib.php
View
8 lib/moodlelib.php
@@ -4538,6 +4538,9 @@ function update_internal_user_password($user, $password) {
if ($passwordchanged || $algorithmchanged) {
$DB->set_field('user', 'password', $hashedpassword, array('id'=>$user->id));
$user->password = $hashedpassword;
+
+ // Trigger user updated event
+ events_trigger('user_updated', $user);
}
return true;
@@ -5760,6 +5763,11 @@ function setnew_password_and_mail($user, $fasthash = false) {
$hashedpassword = hash_internal_user_password($newpassword, $fasthash);
$DB->set_field('user', 'password', $hashedpassword, array('id'=>$user->id));
+ $user->password = $hashedpassword;
+
+ // Trigger user updated event
+ events_trigger('user_updated', $user);
+
$a = new stdClass();
$a->firstname = fullname($user, true);
$a->sitename = format_string($site->fullname);

0 comments on commit 74f501e

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