38 include_once
"./classes/class.ilXmlWriter.php";
39 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
72 $this->user_id = $ilUser->getId();
73 $this->attachRoles =
false;
85 $this->attachRoles = $value == 1?
true :
false;
96 if (!is_array($this->users))
102 include_once (
"./Services/User/classes/class.ilUserDefinedFields.php");
104 $udf_data->addToXML($this);
106 foreach ($this->users as
$user)
126 $this->
xmlSetDtdDef(
"<!DOCTYPE Users PUBLIC \"-//ILIAS//DTD UserImport//EN\" \"".ILIAS_HTTP_PATH.
"/xml/ilias_user_4_0.dtd\">");
143 if (!is_array ($this->settings)) {
144 include_once (
'./Services/User/classes/class.ilObjUserFolder.php');
150 if (strlen(
$row[
"language"]) == 0)
152 $row[
"language"] = $lng->getDefaultLanguage();
157 'Id' =>
"il_".IL_INST_ID.
"_usr_".
$row[
"usr_id"],
158 'Language' =>
$row[
"language"],
166 if ($this->attachRoles == TRUE)
168 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
170 $query = sprintf(
"SELECT object_data.title, object_data.description, rbac_fa.* ".
171 "FROM object_data, rbac_ua, rbac_fa WHERE rbac_ua.usr_id = %s ".
172 "AND rbac_ua.rol_id = rbac_fa.rol_id AND object_data.obj_id = rbac_fa.rol_id",
173 $ilDB->quote(
$row[
"usr_id"],
'integer')
175 $rbacresult = $ilDB->query(
$query);
179 if ($rbacrow[
"assign"] !=
"y")
184 if ($rbacrow[
"parent"] == ROLE_FOLDER_ID)
196 "il_".IL_INST_ID.
"_role_".$rbacrow[
"rol_id"],
"Type" =>
$type),
207 if ($this->
canExport(
"i2passwd",
"i2passwd") && strlen(
$row[
"i2passwd"]) > 0)
210 $this->
__addElement(
"Password",
$row[
"i2passwd"], array(
"Type" =>
"ILIAS2"),
"i2passwd");
212 if (!$i2passwd && strlen(
$row[
"passwd"]) > 0)
214 $this->
__addElement(
"Password",
$row[
"passwd"], array(
"Type" =>
"ILIAS3"),
"passwd");
222 if ($this->
canExport(
"PersonalPicture",
"upload"))
227 $value = array_shift($imageData);
228 $this->
__addElement (
"PersonalPicture", $value, $imageData,
"upload");
241 $this->
__addElement (
"PhoneOffice",
$row[
"phone_office"], null,
"phone_office");
243 $this->
__addElement (
"PhoneMobile",
$row[
"phone_mobile"], null,
"phone_mobile");
247 $this->
__addElement (
"Comment",
$row[
"referral_comment"], null,
"referral_comment");
251 $this->
__addElement (
"TimeLimitOwner",
$row[
"time_limit_owner"], null,
"time_limit_owner");
252 $this->
__addElement (
"TimeLimitUnlimited",
$row[
"time_limit_unlimited"], null,
"time_limit_unlimited");
253 $this->
__addElement (
"TimeLimitFrom",
$row[
"time_limit_from"], null,
"time_limit_from");
254 $this->
__addElement (
"TimeLimitUntil",
$row[
"time_limit_until"], null,
"time_limit_until");
255 $this->
__addElement (
"TimeLimitMessage",
$row[
"time_limit_message"], null,
"time_limit_message");
256 $this->
__addElement (
"ApproveDate",
$row[
"approve_date"], null,
"approve_date");
259 if ((
int)
$row[
"ilinc_id"] !=0) {
265 if (strlen(
$row[
"auth_mode"])>0)
267 $this->
__addElement (
"AuthMode", null, array (
"type" =>
$row[
"auth_mode"]),
"auth_mode",
true);
270 if (strlen(
$row[
"ext_account"])>0)
272 $this->
__addElement (
"ExternalAccount",
$row[
"ext_account"], null,
"ext_account",
true);
275 if ($this->
canExport(
"Look",
"skin_style"))
278 "Skin" => $prefs[
"skin"],
"Style" => $prefs[
"style"]
279 ),
"skin_style",
true);
284 $this->
__addElement (
"LastUpdate",
$row[
"last_update"], null,
"last_update");
287 include_once (
"./Services/User/classes/class.ilUserDefinedData.php");
289 $udf_data->addToXML($this, $this->settings);
291 $msgrs = array (
"skype" =>
"im_skype",
"yahoo" =>
"im_yahoo",
"msn"=>
"im_msn",
"aim"=>
"im_aim",
"icq"=>
"im_icq",
"delicious" =>
"delicious",
"external" =>
"ext_account",
"jabber" =>
"im_jabber",
"voip" =>
"im_voip");
292 foreach ($msgrs as
$type => $fieldname) {
297 "longitude" =>
$row[
"longitude"],
298 "latitude" =>
$row[
"latitude"],
299 "zoom" =>
$row[
"loc_zoom"]));
303 if ($this->attachPreferences || $this->
canExport(
"prefs",
"preferences"))
313 include_once (
"Services/Mail/classes/class.ilMailOptions.php");
315 $prefs[
"mail_incoming_type"] = $mailOptions->getIncomingType();
316 $prefs[
"mail_signature"] = $mailOptions->getSignature();
317 $prefs[
"mail_linebreak"] = $mailOptions->getLinebreak();
321 foreach ($prefs as
$key => $value)
331 function __addElement ($tagname, $value, $attrs = null, $settingsname = null, $requiredTag =
false)
333 if ($this->
canExport($tagname, $settingsname))
334 if (strlen($value) > 0 || $requiredTag || (is_array($attrs) && count($attrs) > 0))
339 private function canExport ($tagname, $settingsname = null)
341 return !is_array($this->settings) ||
342 in_array(strtolower($tagname), $this->settings) !== FALSE ||
343 in_array($settingsname, $this->settings) !== FALSE;
363 $q = sprintf(
"SELECT value FROM usr_pref WHERE usr_id = %s AND keyword = %s",
364 $ilDB->quote(
$usr_id,
"integer"), $ilDB->quote(
'profile_image',
"text"));
365 $r = $ilDB->query(
$q);
366 if ($ilDB->numRows($r) == 1)
369 $personal_picture = $personal_picture_data[
"value"];
371 $image_file = $webspace_dir.
"/usr_images/".$personal_picture;
372 if (@is_file($image_file))
374 $fh = fopen($image_file,
"rb");
377 $image_data = fread($fh, filesize($image_file));
379 $base64 = base64_encode($image_data);
380 $imagetype =
"image/jpeg";
381 if (preg_match(
"/.*\.(png|gif)$/", $personal_picture, $matches))
383 $imagetype =
"image/".$matches[1];
387 "encoding" =>
"Base64",
388 "imagetype" => $imagetype
405 $this->attachPreferences = $attachPrefs;
422 'public_institution',
423 'public_matriculation',
426 'public_phone_mobile',
427 'public_phone_office',
434 'hide_own_online_status',
437 'mail_incoming_type',