Skip to content
Browse files

Merge branch 'MDL-29942-MOODLE_21_STABLE' of git://github.com/mouneyr…

…ac/moodle into MOODLE_21_STABLE
  • Loading branch information...
2 parents 1ac4f0e + e32451b commit 16a6377ca8f9ea9c6bbbb9e279157178d24fc072 Sam Hemelryk committed Dec 12, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 user/lib.php
View
9 user/lib.php
@@ -47,6 +47,10 @@ function user_create_user($user) {
/// insert the user into the database
$newuserid = $DB->insert_record('user', $user);
+/// trigger user_created event on the full database user row
+ $newuser = $DB->get_record('user', array('id' => $newuserid));
+ events_trigger('user_created', $newuser);
+
/// create USER context for this user
get_context_instance(CONTEXT_USER, $newuserid);
@@ -71,6 +75,11 @@ function user_update_user($user) {
$user->timemodified = time();
$DB->update_record('user', $user);
+
+ /// trigger user_updated event on the full database user row
+ $updateduser = $DB->get_record('user', array('id' => $user->id));
+ events_trigger('user_updated', $updateduser);
+
}

0 comments on commit 16a6377

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