5 include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
6 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
48 parent::__construct();
51 $this->user_id = $ilUser->getId();
52 $this->attachRoles =
false;
64 $this->attachRoles = $value == 1? true :
false;
75 if (!is_array($this->users))
81 include_once (
"./Services/User/classes/class.ilUserDefinedFields.php");
83 $udf_data->addToXML($this);
85 foreach ($this->users as $user)
105 $this->
xmlSetDtdDef(
"<!DOCTYPE Users PUBLIC \"-//ILIAS//DTD UserImport//EN\" \"".ILIAS_HTTP_PATH.
"/xml/ilias_user_5_1.dtd\">");
123 include_once (
'./Services/User/classes/class.ilObjUserFolder.php');
129 if (strlen(
$row[
"language"]) == 0)
131 $row[
"language"] = $lng->getDefaultLanguage();
136 'Id' =>
"il_".IL_INST_ID.
"_usr_".
$row[
"usr_id"],
137 'Language' =>
$row[
"language"],
145 if ($this->attachRoles == TRUE)
147 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
149 $query = sprintf(
"SELECT object_data.title, object_data.description, rbac_fa.* ".
150 "FROM object_data, rbac_ua, rbac_fa WHERE rbac_ua.usr_id = %s ".
151 "AND rbac_ua.rol_id = rbac_fa.rol_id AND object_data.obj_id = rbac_fa.rol_id",
152 $ilDB->quote(
$row[
"usr_id"],
'integer')
154 $rbacresult = $ilDB->query(
$query);
158 if ($rbacrow[
"assign"] !=
"y")
163 if ($rbacrow[
"parent"] == ROLE_FOLDER_ID)
175 "il_".IL_INST_ID.
"_role_".$rbacrow[
"rol_id"],
"Type" => $type),
186 if ($this->
canExport(
"PersonalPicture",
"upload"))
191 $value = array_shift($imageData);
192 $this->
__addElement (
"PersonalPicture", $value, $imageData,
"upload");
205 $this->
__addElement (
"SelCountry",
$row[
"sel_country"], null,
"sel_country");
206 $this->
__addElement (
"PhoneOffice",
$row[
"phone_office"], null,
"phone_office");
208 $this->
__addElement (
"PhoneMobile",
$row[
"phone_mobile"], null,
"phone_mobile");
213 $this->
__addElementMulti (
"OfferingHelp",
$row[
"interests_help_offered"], null,
"interests_help_offered");
214 $this->
__addElementMulti (
"LookingForHelp",
$row[
"interests_help_looking"], null,
"interests_help_looking");
217 $this->
__addElement (
"Comment",
$row[
"referral_comment"], null,
"referral_comment");
221 $this->
__addElement (
"TimeLimitOwner",
$row[
"time_limit_owner"], null,
"time_limit_owner");
222 $this->
__addElement (
"TimeLimitUnlimited",
$row[
"time_limit_unlimited"], null,
"time_limit_unlimited");
223 $this->
__addElement (
"TimeLimitFrom",
$row[
"time_limit_from"], null,
"time_limit_from");
224 $this->
__addElement (
"TimeLimitUntil",
$row[
"time_limit_until"], null,
"time_limit_until");
225 $this->
__addElement (
"TimeLimitMessage",
$row[
"time_limit_message"], null,
"time_limit_message");
226 $this->
__addElement (
"ApproveDate",
$row[
"approve_date"], null,
"approve_date");
229 if (strlen(
$row[
"auth_mode"])>0)
234 if (strlen(
$row[
"ext_account"])>0)
236 $this->
__addElement (
"ExternalAccount",
$row[
"ext_account"], null,
"ext_account",
true);
239 if ($this->
canExport(
"Look",
"skin_style"))
242 "Skin" => $prefs[
"skin"],
"Style" => $prefs[
"style"]
243 ),
"skin_style",
true);
248 $this->
__addElement (
"LastUpdate",
$row[
"last_update"], null,
"last_update");
251 include_once (
"./Services/User/classes/class.ilUserDefinedData.php");
253 $udf_data->addToXML($this, $this->
settings);
258 "longitude" =>
$row[
"longitude"],
259 "latitude" =>
$row[
"latitude"],
260 "zoom" =>
$row[
"loc_zoom"]));
264 if ($this->attachPreferences || $this->
canExport(
"prefs",
"preferences"))
274 include_once (
"Services/Mail/classes/class.ilMailOptions.php");
276 $prefs[
"mail_incoming_type"] = $mailOptions->getIncomingType();
277 $prefs[
"mail_signature"] = $mailOptions->getSignature();
278 $prefs[
"mail_linebreak"] = $mailOptions->getLinebreak();
282 foreach ($prefs as $key => $value)
291 function __addElementMulti ($tagname, $value, $attrs = null, $settingsname = null, $requiredTag =
false)
293 if(is_array($value) &&
sizeof($value))
295 foreach($value as $idx => $item)
297 $this->
__addElement ($tagname, $item, $attrs, $settingsname, $requiredTag);
302 function __addElement ($tagname, $value, $attrs = null, $settingsname = null, $requiredTag =
false)
304 if ($this->
canExport($tagname, $settingsname))
306 if (strlen($value) > 0 || $requiredTag || (is_array($attrs) && count($attrs) > 0))
313 private function canExport ($tagname, $settingsname = null)
315 return !is_array($this->
settings) ||
316 in_array(strtolower($tagname), $this->
settings) !== FALSE ||
317 in_array($settingsname, $this->
settings) !== FALSE;
337 $q = sprintf(
"SELECT value FROM usr_pref WHERE usr_id = %s AND keyword = %s",
338 $ilDB->quote($usr_id,
"integer"), $ilDB->quote(
'profile_image',
"text"));
339 $r = $ilDB->query($q);
340 if ($ilDB->numRows($r) == 1)
343 $personal_picture = $personal_picture_data[
"value"];
345 $image_file = $webspace_dir.
"/usr_images/".$personal_picture;
346 if (@is_file($image_file))
348 $fh = fopen($image_file,
"rb");
351 $image_data = fread(
$fh, filesize($image_file));
353 $base64 = base64_encode($image_data);
354 $imagetype =
"image/jpeg";
355 if (preg_match(
"/.*\.(png|gif)$/", $personal_picture, $matches))
357 $imagetype =
"image/".$matches[1];
361 "encoding" =>
"Base64",
362 "imagetype" => $imagetype
379 $this->attachPreferences = $attachPrefs;
396 'public_institution',
397 'public_matriculation',
400 'public_phone_mobile',
401 'public_phone_office',
408 'hide_own_online_status',
409 'bs_allow_to_contact_me',
410 'chat_osc_accept_msg',
413 'mail_incoming_type',
416 'public_interests_general',
417 'public_interests_help_offered',
418 'public_interests_help_looking' getPictureValue($usr_id)
return array with baseencoded picture data as key value, encoding type as encoding, and image type as key type.
Class UserMail this class handles user mails.
xmlSetGenCmt($genCmt)
Sets generated comment.
static _getInstance()
Get instance.
__handlePreferences($prefs, $row)
__addElement($tagname, $value, $attrs=null, $settingsname=null, $requiredTag=false)
xmlSetDtdDef($dtdDef)
Sets dtd definition.
xmlStartTag($tag, $attrs=NULL, $empty=FALSE, $encode=TRUE, $escape=TRUE)
Writes a starttag.
setSettings($settings)
write access to settings
xmlElement($tag, $attrs=NULL, $data=Null, $encode=TRUE, $escape=TRUE)
Writes a basic element (no children, just textual content)
static isPrefExportable($key)
returns wether a key from db is exportable or not
canExport($tagname, $settingsname=null)
xmlEndTag($tag)
Writes an endtag.
static getExportSettings()
getExport Settings
setAttachPreferences($attachPrefs)
if set to true, all preferences of a user will be set
redirection script todo: (a better solution should control the processing via a xml file) ...
xmlHeader()
Writes xml header public.
Create styles array
The data for the language used.
__addElementMulti($tagname, $value, $attrs=null, $settingsname=null, $requiredTag=false)
static getExportablePreferences()
return exportable preference keys as found in db
static _getPreferences($user_id)
get preferences for user
static getWebspaceDir($mode="filesystem")
get webspace directory
xmlDumpMem($format=TRUE)
Returns xml document from memory.