4 include_once
'./Services/OpenId/classes/class.ilOpenIdSettings.php';
29 include_once(
'./Services/Xml/classes/class.ilXmlWriter.php');
41 public function create($a_username,$a_userdata = array())
45 $this->writer->xmlStartTag(
'Users');
50 $this->writer->xmlStartTag(
'User',array(
'Action' =>
'Insert'));
54 $this->writer->xmlElement(
'Role',array(
'Id' => $this->settings->getDefaultRole(),
56 'Action' =>
'Assign'),
'');
58 if(isset($a_userdata[
'email']))
60 $this->writer->xmlElement(
'Email',array(),$a_userdata[
'email']);
62 if(isset($a_userdata[
'postcode']))
64 $this->writer->xmlElement(
'PostalCode',array(),$a_userdata[
'postcode']);
66 if(isset($a_userdata[
'dob']) and $a_userdata[
'dob'])
68 $this->writer->xmlElement(
'Birthday',array(),$a_userdata[
'dob']);
70 if(isset($a_userdata[
'gender']))
72 $this->writer->xmlElement(
'Gender',array(),strtolower($a_userdata[
'gender']));
74 if(isset($a_userdata[
'title']))
76 $this->writer->xmlElement(
'Title',array(),$a_userdata[
'title']);
78 if(isset($a_userdata[
'firstname']))
80 $this->writer->xmlElement(
'Firstname',array(),$a_userdata[
'firstname']);
82 if(isset($a_userdata[
'lastname']))
84 $this->writer->xmlElement(
'Lastname',array(),$a_userdata[
'lastname']);
87 $this->writer->xmlElement(
'Active',array(),
"true");
88 $this->writer->xmlElement(
'TimeLimitOwner',array(),7);
89 $this->writer->xmlElement(
'TimeLimitUnlimited',array(),1);
90 $this->writer->xmlElement(
'TimeLimitFrom',array(),time());
91 $this->writer->xmlElement(
'TimeLimitUntil',array(),time());
92 $this->writer->xmlElement(
'AuthMode',array(
'type' =>
'openid'),
'openid');
93 $this->writer->xmlElement(
'ExternalAccount',array(),$a_username);
95 $this->writer->xmlEndTag(
'User');
96 $this->writer->xmlEndTag(
'Users');
97 $this->log->write(
'OpenId: Started creation of user: '.$new_name);
99 include_once
'./Services/User/classes/class.ilUserImportParser.php';
101 $importParser->setXMLContent($this->writer->xmlDumpMem(
false));
102 $importParser->setRoleAssignment(array($this->settings->getDefaultRole() => $this->settings->getDefaultRole()));
103 $importParser->setFolderId(7);
104 $importParser->startParsing();
107 if(isset($a_userdata[
'timezone']))
109 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
112 if(isset($tzs[$a_userdata[
'timezone']]))
115 ilObjUser::_writePref(
$usr_id,
'user_tz', $a_userdata[
'timezone']);
124 include_once
'./Services/User/classes/class.ilFullnameParser.php';
128 if($parser->getNotParseable())
133 $a_userdata[
'firstname'] = $parser->getFirstName();
134 $a_userdata[
'lastname'] = $parser->getLastName();
135 $a_userdata[
'title'] = $parser->getTitle();