Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…ctions.
  • Loading branch information...
commit 74f501e7b5e14377df5a0f6a6116336b27055661 1 parent 85cb1bc
@number33 number33 authored ankitagarwal committed
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);
Please sign in to comment.
Something went wrong with that request. Please try again.