4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
25 return array(
"4.3.0");
36 return "http://www.ilias.de/xml/Services/User/".$a_entity;
45 protected function getTypes($a_entity, $a_version)
48 if ($a_entity ==
"usr_profile")
56 "Firstname" =>
"text",
61 "Institution" =>
"text",
62 "Department" =>
"text",
67 "SelCountry" =>
"text",
68 "PhoneOffice" =>
"text",
69 "PhoneHome" =>
"text",
70 "PhoneMobile" =>
"text",
74 "ReferralComment" =>
"text",
75 "Matriculation" =>
"text",
76 "Delicious" =>
"text",
78 "Longitude" =>
"text",
79 "Picture" =>
"directory" 84 if ($a_entity ==
"usr_setting")
90 "UserId" =>
"integer",
97 if ($a_entity ==
"personal_data")
121 if ($a_entity ==
"usr_profile")
125 include_once(
"./Services/User/classes/class.ilObjUser.php");
128 $this->temp_picture_dirs[$a_set[
"Id"]] = $tmp_dir;
130 $a_set[
"Picture"] = $tmp_dir;
144 if ($a_entity ==
"usr_profile")
147 $tmp_dir = $this->temp_picture_dirs[$a_set[
"Id"]];
148 if ($tmp_dir !=
"" && is_dir($tmp_dir))
161 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
165 if (!is_array($a_ids))
167 $a_ids = array($a_ids);
170 if ($a_entity ==
"personal_data")
175 $this->data = array();
176 foreach ($a_ids as $id)
178 $this->data[] = array(
"Id" => $id);
184 if ($a_entity ==
"usr_profile")
190 " title, birthday, gender, institution, department, street, city, zipcode, country, sel_country, ".
191 " phone_office, phone_home, phone_mobile, fax, email, hobby, referral_comment, matriculation, ".
192 " delicious, latitude, longitude".
195 $ilDB->in(
"u.usr_id", $a_ids,
false,
"integer"));
200 if ($a_entity ==
"usr_setting")
206 $prefs = array(
"date_format",
"day_end",
"day_start",
"hide_own_online_status",
"hits_per_page",
"language",
207 "public_birthday",
"puplic_city",
"public_country",
"public_delicious",
"public_department",
"public_email",
208 "public_fax",
"public_gender",
"public_hobby",
"public_im_aim",
"public_im_icq",
"public_im_jabber",
209 "public_im_msn",
"public_im_skype",
"public_im_voip",
"public_im_yahoo",
"public_institution",
"public_location",
210 "public_matriculation",
"public_phone_home",
"public_phone_mobile",
"public_phone_office",
"public_profile",
211 "public_sel_country",
"public_street",
"public_title",
"public_upload",
"public_zipcode",
212 "screen_reader_optimization",
"show_users_online",
213 "store_last_visited",
"time_format",
"user_tz",
"weekstart");
214 $this->data = array();
215 $set = $ilDB->query(
"SELECT * FROM usr_pref ".
216 " WHERE ".$ilDB->in(
"keyword", $prefs,
false,
"text").
217 " AND ".$ilDB->in(
"usr_id", $a_ids,
false,
"integer"));
218 while ($rec = $ilDB->fetchAssoc($set))
220 $this->data[] = array(
"UserId" => $rec[
"usr_id"],
"Keyword" => $rec[
"keyword"],
"Value" => $rec[
"value"]);
248 case "personal_data":
250 "usr_profile" => array(
"ids" => $a_rec[
"Id"]),
251 "usr_setting" => array(
"ids" => $a_rec[
"Id"])
264 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
272 case "personal_data":
275 $a_mapping->addMapping(
"Services/User",
"usr", $a_rec[
"Id"], $ilUser->getId());
279 $usr_id = $a_mapping->getMapping(
"Services/User",
"usr", $a_rec[
"Id"]);
282 if (!isset($this->users[
$usr_id]))
287 include_once(
"./Services/User/classes/class.ilUserProfile.php");
289 $prof->skipField(
"username");
290 $prof->skipField(
"password");
291 $prof->skipField(
"roles");
292 $prof->skipGroup(
"settings");
293 $fields = $prof->getStandardFields();
294 foreach ($fields as $k => $f)
299 !$ilSetting->get(
"usr_settings_disable_".$k) &&
300 $f[
"method"] !=
"" && isset($a_rec[$up_k]))
302 $set_method =
"set".substr($f[
"method"], 3);
311 if ($pic_dir !=
"" && is_dir($pic_dir))
313 $upload_file = $pic_dir.
"/upload_".$a_rec[
"Id"].
"pic";
314 if (is_file($upload_file))
323 $usr_id = $a_mapping->getMapping(
"Services/User",
"usr", $a_rec[
"UserId"]);
326 if (!isset($this->users[
$usr_id]))
static userSettingVisible($a_setting)
Checks whether user setting is visible.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getImportDirectory()
Get import directory.
convertToLeadingUpper($a_str)
Make xyz_abc a XyzAbc string.
_uploadPersonalPicture($tmp_file, $obj_id)
Create a personal picture image file from a temporary image file.
static copyProfilePicturesToDirectory($a_user_id, $a_dir)
Get profile picture direcotory.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static _lookupType($a_id, $a_reference=false)
lookup object type
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
static ilTempnam()
Create a temporary file in an ILIAS writable directory.
getSupportedVersions()
Get supported versions.
static secureString($a_str, $a_strip_html=true, $a_allow="")
Remove unsecure tags.
getXmlRecord($a_entity, $a_version, $a_set)
Get xml record.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getTypes($a_entity, $a_version)
Get field types for entity.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
afterXmlRecordWriting($a_entity, $a_version, $a_set)
After xml record writing hook record.