MDL-21509 - include timecreate field (user table) to backup and restore.

This commit is contained in:
Rossiani Wijaya
2010-02-05 08:08:57 +00:00
parent aa7fbebd59
commit b6570b2fec
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -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
+8
View File
@@ -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;