Now we are reading user_profile_fields and user_tags + some small fixes on roles. MDL-6856 ; merged from 19_STABLE

This commit is contained in:
stronk7 2008-02-02 23:59:48 +00:00
parent 1921b95df5
commit e464445596

View file

@ -5638,6 +5638,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
break; break;
} }
} }
if ($this->level == 5) { if ($this->level == 5) {
switch ($tagName) { switch ($tagName) {
case "ID": case "ID":
@ -5780,6 +5781,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
break; break;
} }
} }
if ($this->level == 6 && $this->tree[5]!="ROLES_ASSIGNMENTS" && $this->tree[5]!="ROLES_OVERRIDES") { if ($this->level == 6 && $this->tree[5]!="ROLES_ASSIGNMENTS" && $this->tree[5]!="ROLES_OVERRIDES") {
switch ($tagName) { switch ($tagName) {
case "ROLE": case "ROLE":
@ -5792,56 +5794,103 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
$this->info->tempuser->user_preferences[$this->info->tempuserpreference->name] = $this->info->tempuserpreference; $this->info->tempuser->user_preferences[$this->info->tempuserpreference->name] = $this->info->tempuserpreference;
unset($this->info->tempuserpreference); unset($this->info->tempuserpreference);
break; break;
} case "USER_CUSTOM_PROFILE_FIELD":
} //We've finalized a user_custom_profile_field, get it
$this->info->tempuser->user_custom_profile_fields[] = $this->info->tempusercustomprofilefield;
if ($this->level == 7) { unset($this->info->tempusercustomprofilefield);
switch ($tagName) {
case "TYPE":
$this->info->temprole->type = $this->getContents();
break; break;
case "AUTHORITY": case "USER_TAG":
$this->info->temprole->authority = $this->getContents(); //We've finalized a user_tag, get it
break; $this->info->tempuser->user_tags[] = $this->info->tempusertag;
case "TEA_ROLE": unset($this->info->tempusertag);
$this->info->temprole->tea_role = $this->getContents();
break;
case "EDITALL":
$this->info->temprole->editall = $this->getContents();
break;
case "TIMESTART":
$this->info->temprole->timestart = $this->getContents();
break;
case "TIMEEND":
$this->info->temprole->timeend = $this->getContents();
break;
case "TIMEMODIFIED":
$this->info->temprole->timemodified = $this->getContents();
break;
case "TIMESTART":
$this->info->temprole->timestart = $this->getContents();
break;
case "TIMEEND":
$this->info->temprole->timeend = $this->getContents();
break;
case "TIME":
$this->info->temprole->time = $this->getContents();
break;
case "TIMEACCESS":
$this->info->temprole->timeaccess = $this->getContents();
break;
case "ENROL":
$this->info->temprole->enrol = $this->getContents();
break;
case "NAME":
$this->info->tempuserpreference->name = $this->getContents();
break;
case "VALUE":
$this->info->tempuserpreference->value = $this->getContents();
break; break;
default: default:
break; break;
}
}
if ($this->level == 7 && $this->tree[5]!="ROLES_ASSIGNMENTS" && $this->tree[5]!="ROLES_OVERRIDES") {
/// If we are reading roles
if($this->tree[6] == 'ROLE') {
switch ($tagName) {
case "TYPE":
$this->info->temprole->type = $this->getContents();
break;
case "AUTHORITY":
$this->info->temprole->authority = $this->getContents();
break;
case "TEA_ROLE":
$this->info->temprole->tea_role = $this->getContents();
break;
case "EDITALL":
$this->info->temprole->editall = $this->getContents();
break;
case "TIMESTART":
$this->info->temprole->timestart = $this->getContents();
break;
case "TIMEEND":
$this->info->temprole->timeend = $this->getContents();
break;
case "TIMEMODIFIED":
$this->info->temprole->timemodified = $this->getContents();
break;
case "TIMESTART":
$this->info->temprole->timestart = $this->getContents();
break;
case "TIMEEND":
$this->info->temprole->timeend = $this->getContents();
break;
case "TIME":
$this->info->temprole->time = $this->getContents();
break;
case "TIMEACCESS":
$this->info->temprole->timeaccess = $this->getContents();
break;
case "ENROL":
$this->info->temprole->enrol = $this->getContents();
break;
default:
break;
}
/// If we are reading user_preferences
} else if ($this->tree[6] == 'USER_PREFERENCE') {
switch ($tagName) {
case "NAME":
$this->info->tempuserpreference->name = $this->getContents();
break;
case "VALUE":
$this->info->tempuserpreference->value = $this->getContents();
break;
default:
break;
}
/// If we are reading user_custom_profile_fields
} else if ($this->tree[6] == 'USER_CUSTOM_PROFILE_FIELD') {
switch ($tagName) {
case "FIELD_NAME":
$this->info->tempusercustomprofilefield->field_name = $this->getContents();
break;
case "FIELD_TYPE":
$this->info->tempusercustomprofilefield->field_type = $this->getContents();
break;
case "FIELD_DATA":
$this->info->tempusercustomprofilefield->field_data = $this->getContents();
break;
default:
break;
}
/// If we are reading user_tags
} else if ($this->tree[6] == 'USER_TAG') {
switch ($tagName) {
case "NAME":
$this->info->tempusertag->name = $this->getContents();
break;
case "RAWNAME":
$this->info->tempusertag->rawname = $this->getContents();
break;
default:
break;
}
} }
} }