{
$this->writer->xmlStartTag('Users');
$this->writer->xmlStartTag('User',array('Action' => 'Insert'));
$this->writer->xmlElement('Role',array('Id' => $this->settings->getDefaultRole(),
'Type' => 'Global',
'Action' => 'Assign'),'');
if(isset($a_userdata['email']))
{
$this->writer->xmlElement('Email',array(),$a_userdata['email']);
}
if(isset($a_userdata['postcode']))
{
$this->writer->xmlElement('PostalCode',array(),$a_userdata['postcode']);
}
if(isset($a_userdata['dob']) and $a_userdata['dob'])
{
$this->writer->xmlElement('Birthday',array(),$a_userdata['dob']);
}
if(isset($a_userdata['gender']))
{
$this->writer->xmlElement('Gender',array(),strtolower($a_userdata['gender']));
}
if(isset($a_userdata['title']))
{
$this->writer->xmlElement('Title',array(),$a_userdata['title']);
}
if(isset($a_userdata['firstname']))
{
$this->writer->xmlElement('Firstname',array(),$a_userdata['firstname']);
}
if(isset($a_userdata['lastname']))
{
$this->writer->xmlElement('Lastname',array(),$a_userdata['lastname']);
}
$this->writer->xmlElement('Active',array(),"true");
$this->writer->xmlElement('TimeLimitOwner',array(),7);
$this->writer->xmlElement('TimeLimitUnlimited',array(),1);
$this->writer->xmlElement('TimeLimitFrom',array(),time());
$this->writer->xmlElement('TimeLimitUntil',array(),time());
$this->writer->xmlElement('AuthMode',array('type' => 'openid'),'openid');
$this->writer->xmlElement('ExternalAccount',array(),$a_username);
$this->writer->xmlEndTag('User');
$this->writer->xmlEndTag('Users');
$this->log->write('OpenId: Started creation of user: '.$new_name);
include_once './Services/User/classes/class.ilUserImportParser.php';
$importParser->setXMLContent($this->writer->xmlDumpMem(false));
$importParser->setRoleAssignment(array($this->settings->getDefaultRole() => $this->settings->getDefaultRole()));
$importParser->setFolderId(7);
$importParser->startParsing();
if(isset($a_userdata['timezone']))
{
include_once './Services/Calendar/classes/class.ilCalendarUtil.php';
if(isset($tzs[$a_userdata['timezone']]))
{
ilObjUser::_writePref(
$usr_id,
'user_tz', $a_userdata[
'timezone']);
}
}
return $new_name;
}