MDL-21509 - include timecreate field (user table) to backup and restore.
This commit is contained in:
@@ -1367,6 +1367,7 @@
|
||||
if ($user->mnethostid != $CFG->mnet_localhost_id && !empty($user->wwwroot)) {
|
||||
fwrite ($bf,full_tag("MNETHOSTURL",4,false,$user->wwwroot));
|
||||
}
|
||||
fwrite ($bf,full_tag("TIMECREATED",4,false,$user->timecreated));
|
||||
fwrite ($bf,full_tag("TIMEMODIFIED",4,false,$user->timemodified));
|
||||
|
||||
/// write assign/override code for context_userid
|
||||
|
||||
@@ -3037,6 +3037,11 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
||||
$user->theme = '';
|
||||
}
|
||||
|
||||
//set time created
|
||||
if (empty($user->timecreated)) {
|
||||
$user->timecreated = time();
|
||||
}
|
||||
|
||||
//We are going to create the user
|
||||
//The structure is exactly as we need
|
||||
|
||||
@@ -7159,6 +7164,9 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
||||
case "MNETHOSTURL":
|
||||
$this->info->tempuser->mnethosturl = $this->getContents();
|
||||
break;
|
||||
case "TIMECREATED":
|
||||
$this->info->tempuser->timecreated = $this->getContents();
|
||||
break;
|
||||
case "TIMEMODIFIED":
|
||||
$this->info->tempuser->timemodified = $this->getContents();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user