MDL-45641 event: Manually trigger event where needed.

Some places, user_created_user and user_updated_user
events should be triggred after profile data is saved.
This commit is contained in:
Rajesh Taneja
2014-06-27 15:44:56 +08:00
parent a7466eb448
commit 9363073b22
5 changed files with 30 additions and 9 deletions
+4 -1
View File
@@ -220,7 +220,7 @@ if ($usernew = $userform->get_data()) {
}
// Update user with new profile data.
user_update_user($usernew, false);
user_update_user($usernew, false, false);
// Update preferences.
useredit_update_user_preference($usernew);
@@ -244,6 +244,9 @@ if ($usernew = $userform->get_data()) {
// Save custom profile fields data.
profile_save_data($usernew);
// Trigger event.
\core\event\user_updated::create_from_userid($user->id)->trigger();
// If email was changed and confirmation is required, send confirmation email now to the new address.
if ($emailchanged && $CFG->emailchangeconfirmation) {
$tempuser = $DB->get_record('user', array('id' => $user->id), '*', MUST_EXIST);