MDL-19925 adding events to upload users scripts
authorPetr Skoda <skodak@moodle.org>
Sat, 9 Oct 2010 22:53:50 +0000 (22:53 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 9 Oct 2010 22:53:50 +0000 (22:53 +0000)
admin/uploaduser.php

index 84ce3ab..0c7bdf2 100755 (executable)
@@ -499,6 +499,8 @@ if ($formdata = $mform->is_cancelled()) {
                 $usersupdated++;
                 // save custom profile fields data from csv file
                 profile_save_data($existinguser);
+
+                events_trigger('user_updated', $existinguser);
             }
 
             if ($bulk == 2 or $bulk == 3) {
@@ -564,6 +566,8 @@ if ($formdata = $mform->is_cancelled()) {
             // make sure user context exists
             get_context_instance(CONTEXT_USER, $user->id);
 
+            events_trigger('user_created', $user);
+
             if ($bulk == 1 or $bulk == 3) {
                 if (!in_array($user->id, $SESSION->bulk_users)) {
                     $SESSION->bulk_users[] = $user->id;