diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 047430b48c0..3ecb5fa9037 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -3298,7 +3298,8 @@ function create_user_record($username, $password, $auth = 'manual') { } $newuser->confirmed = 1; $newuser->lastip = getremoteaddr(); - $newuser->timemodified = time(); + $newuser->timecreated = time(); + $newuser->timemodified = $newuser->timecreated; $newuser->mnethostid = $CFG->mnet_localhost_id; $newuser->id = $DB->insert_record('user', $newuser); @@ -3361,6 +3362,7 @@ function update_user_record($username) { } if ($newuser) { $newuser['id'] = $oldinfo->id; + $newuser['timemodified'] = time(); $DB->update_record('user', $newuser); // fetch full user record for the event, the complete user data contains too much info // and we want to be consistent with other places that trigger this event