24 define (
"IL_EXTRACT_ROLES", 1);
25 define (
"IL_USER_IMPORT", 2);
26 define (
"IL_VERIFY", 3);
28 define (
"IL_FAIL_ON_CONFLICT", 1);
29 define (
"IL_UPDATE_ON_CONFLICT", 2);
30 define (
"IL_IGNORE_ON_CONFLICT", 3);
32 define (
"IL_IMPORT_SUCCESS", 1);
33 define (
"IL_IMPORT_WARNING", 2);
34 define (
"IL_IMPORT_FAILURE", 3);
36 define (
"IL_USER_MAPPING_LOGIN", 1);
37 define (
"IL_USER_MAPPING_ID", 2);
39 require_once(
"./Services/Xml/classes/class.ilSaxParser.php");
40 require_once (
'Services/User/classes/class.ilUserXMLWriter.php');
290 $this->roles = array();
291 $this->mode = $a_mode;
292 $this->conflict_rule = $a_conflict_rule;
294 $this->protocol = array();
295 $this->logins = array();
296 $this->userCount = 0;
297 $this->localRoleCache = array();
298 $this->parentRolesCache = array();
299 $this->ilincdata = array();
300 $this->send_mail =
false;
304 $this->userStyles = array();
305 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
306 include_once
'./Services/Style/classes/class.ilStyleDefinition.php';
309 if (is_array($templates))
312 foreach($templates as $template)
316 $styleDef->startParsing();
317 $styles = $styleDef->getStyles();
319 foreach($styles as $style)
325 $this->userStyles [] = $template[
"id"].
":".$style[
"id"];
330 $settings = $ilias->getAllSettings();
331 if ($settings[
"usr_settings_hide_skin_style"] == 1)
333 $this->hideSkin = TRUE;
337 $this->hideSkin = FALSE;
339 if ($settings[
"usr_settings_disable_skin_style"] == 1)
341 $this->disableSkin = TRUE;
345 $this->disableSkin = FALSE;
348 include_once(
"Services/Mail/classes/class.ilAccountMail.php");
350 $this->acc_mail->useLangVariablesAsFallback(
true);
352 parent::ilSaxParser($a_xml_file);
362 $this->folder_id = $a_folder_id;
377 xml_set_object($a_xml_parser,$this);
378 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
379 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
387 parent::startParsing();
397 $this->role_assign = $a_assign;
418 while (list($k,$v) = each($attr))
419 $tag.=
" ".$k.
"=\"$v\"";
457 $this->current_role_id = $a_attribs[
"Id"];
460 $this->current_role_id = $internal_id;
462 $this->current_role_type = $a_attribs[
"Type"];
477 $this->current_role_id = $a_attribs[
"Id"];
480 $this->current_role_id = $internal_id;
482 $this->current_role_type = $a_attribs[
"Type"];
483 $this->current_role_action = (is_null($a_attribs[
"Action"])) ?
"Assign" : $a_attribs[
"Action"];
486 case "PersonalPicture":
487 $this->personalPicture = array(
488 "encoding" => $a_attribs[
"encoding"],
489 "imagetype" => $a_attribs[
"imagetype"],
495 $this->skin = $a_attribs[
"Skin"];
496 $this->style = $a_attribs[
"Style"];
500 $this->acc_mail->reset();
501 $this->prefs = array();
502 $this->currentPrefKey = null;
503 $this->auth_mode_set =
false;
504 $this->approve_date_set =
false;
505 $this->time_limit_set =
false;
506 $this->time_limit_owner_set =
false;
507 $this->updateLookAndSkin =
false;
510 $this->personalPicture = null;
515 $this->udf_data = array();
521 if (is_numeric($a_attribs[
"Id"]))
523 $this->user_id = $a_attribs[
"Id"];
527 $this->user_id = $id;
531 $this->userObj->setPref(
"skin",
532 $ilias->ini->readVariable(
"layout",
"skin"));
533 $this->userObj->setPref(
"style",
534 $ilias->ini->readVariable(
"layout",
"style"));
536 $this->userObj->setLanguage($a_attribs[
"Language"]);
537 $this->userObj->setImportId($a_attribs[
"Id"]);
538 $this->action = (is_null($a_attribs[
"Action"])) ?
"Insert" : $a_attribs[
"Action"];
539 $this->currPassword = null;
540 $this->currPasswordType = null;
541 $this->currActive = null;
545 $this->currPasswordType = $a_attribs[
"Type"];
548 if (array_key_exists(
"type", $a_attribs))
550 switch ($a_attribs[
"type"])
563 $this->auth_mode_set =
true;
564 $this->userObj->setAuthMode($a_attribs[
"type"]);
577 sprintf($lng->txt(
"usrimport_xml_element_inapplicable"),
"AuthMode",$a_attribs[
"type"]));
581 case 'UserDefinedField':
582 $this->tmp_udf_id = $a_attribs[
'Id'];
583 $this->tmp_udf_name = $a_attribs[
'Name'];
587 $this->current_messenger_type = strtolower($a_attribs[
"Type"]);
590 $this->userObj->setLatitude($a_attribs[
"latitude"]);
591 $this->userObj->setLongitude($a_attribs[
"longitude"]);
592 $this->userObj->setLocationZoom($a_attribs[
"zoom"]);
595 $this->currentPrefKey = $a_attribs[
"key"];
610 if (is_null($a_attribs[
'Id'])
611 || $a_attribs[
'Id'] ==
"")
613 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_attribute_missing"),
"Role",
"Id"));
615 $this->current_role_id = $a_attribs[
"Id"];
616 $this->current_role_type = $a_attribs[
"Type"];
617 if ($this->current_role_type !=
'Global' 618 && $this->current_role_type !=
'Local')
620 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_attribute_missing"),
"Role",
"Type"));
622 $this->current_role_action = (is_null($a_attribs[
"Action"])) ?
"Assign" : $a_attribs[
"Action"];
623 if ($this->current_role_action !=
"Assign" 624 && $this->current_role_action !=
"AssignWithParents" 625 && $this->current_role_action !=
"Detach")
627 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_attribute_value_illegal"),
"Role",
"Action",$a_attribs[
"Action"]));
629 if ($this->action ==
"Insert" 630 && $this->current_role_action ==
"Detach")
632 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_attribute_value_inapplicable"),
"Role",
"Action",$this->current_role_action,
$this->action));
634 if ($this->action ==
"Delete")
636 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_inapplicable"),
"Role",
"Delete"));
643 $this->userObj->setLanguage($a_attribs[
"Language"]);
644 $this->userObj->setImportId($a_attribs[
"Id"]);
645 $this->currentPrefKey = null;
651 if (is_numeric($a_attribs[
"Id"]))
653 $this->user_id = $a_attribs[
"Id"];
657 $this->user_id = $id;
661 $this->action = (is_null($a_attribs[
"Action"])) ?
"Insert" : $a_attribs[
"Action"];
662 if ($this->action !=
"Insert" 663 && $this->action !=
"Update" 664 && $this->action !=
"Delete")
666 $this->
logFailure($this->userObj->getImportId(), sprintf($lng->txt(
"usrimport_xml_attribute_value_illegal"),
"User",
"Action",$a_attribs[
"Action"]));
668 $this->currPassword = null;
669 $this->currPasswordType = null;
673 $this->currPasswordType = $a_attribs[
"Type"];
676 if (array_key_exists(
"type", $a_attribs))
678 switch ($a_attribs[
"type"])
691 $this->userObj->setAuthMode($a_attribs[
"type"]);
703 $this->
logFailure($this->userObj->getImportId(), sprintf($lng->txt(
"usrimport_xml_attribute_value_illegal"),
"AuthMode",
"type",
""));
707 $this->currentPrefKey = $a_attribs[
"key"];
740 $this->roles[$this->current_role_id][
"name"] = $this->cdata;
741 $this->roles[$this->current_role_id][
"type"] =
742 $this->current_role_type;
752 if (array_key_exists($a_role_id, $this->localRoleCache))
754 return $this->localRoleCache[$a_role_id];
758 $role_obj =
new ilObjRole($a_role_id,
false);
760 $this->localRoleCache[$a_role_id] = $role_obj;
770 global $rbacreview, $rbacadmin, $tree;
772 if (array_key_exists($a_role_id.
'_courseMembersObject', $this->localRoleCache))
774 return $this->localRoleCache[$a_role_id.
'_courseMembersObject'];
778 require_once(
"Modules/Course/classes/class.ilObjCourse.php");
779 require_once(
"Modules/Course/classes/class.ilCourseParticipants.php");
780 $rolf_refs = $rbacreview->getFoldersAssignedToRole($a_role_id,
true);
781 $course_ref = $tree->getParentId($rolf_refs[0]);
784 $this->localRoleCache[$a_role_id.
'_courseMembersObject'] = $crsmembers_obj;
785 return $crsmembers_obj;
795 require_once
"./Services/AccessControl/classes/class.ilObjRole.php";
796 include_once(
'./Services/Object/classes/class.ilObject.php');
797 #require_once "Modules/Course/classes/class.ilObjCourse.php"; 798 #require_once "Modules/Course/classes/class.ilCourseParticipants.php"; 800 global $rbacreview, $rbacadmin, $tree;
806 if ($rbacreview->isAssigned($a_user_obj->getId(), $a_role_id))
814 $rbacadmin->assignUser($a_role_id, $a_user_obj->getId(),
true);
815 $obj_id = $rbacreview->getObjectOfRole($a_role_id);
821 $ref_id = current((array) $ref_ids);
839 if (! array_key_exists($a_role_id, $this->parentRolesCache))
841 $parent_role_ids = array();
844 $short_role_title = substr($role_obj->getTitle(),0,12);
845 $folders = $rbacreview->getFoldersAssignedToRole($a_role_id,
true);
846 if (count($folders) > 0)
848 $all_parent_role_ids = $rbacreview->getParentRoleIds($folders[0]);
849 foreach ($all_parent_role_ids as $parent_role_id => $parent_role_data)
851 if ($parent_role_id != $a_role_id)
853 switch (substr($parent_role_data[
'title'],0,12))
855 case 'il_crs_admin' :
856 case 'il_grp_admin' :
857 if ($short_role_title ==
'il_crs_admin' || $short_role_title ==
'il_grp_admin')
859 $parent_role_ids[] = $parent_role_id;
862 case 'il_crs_tutor' :
863 case 'il_grp_tutor' :
864 if ($short_role_title ==
'il_crs_tutor' || $short_role_title ==
'il_grp_tutor')
866 $parent_role_ids[] = $parent_role_id;
869 case 'il_crs_membe' :
870 case 'il_grp_membe' :
871 if ($short_role_title ==
'il_crs_membe' || $short_role_title ==
'il_grp_membe')
873 $parent_role_ids[] = $parent_role_id;
882 $this->parentRolesCache[$a_role_id] = $parent_role_ids;
884 return $this->parentRolesCache[$a_role_id];
894 foreach ($parent_role_ids as $parent_role_id)
904 global $rbacreview, $rbacadmin, $tree;
906 $rbacadmin->deassignUser($a_role_id, $a_user_obj->getId());
911 $obj = $rbacreview->getObjectOfRole($a_role_id);
928 $this->roles[$this->current_role_id][
"name"] = $this->cdata;
929 $this->roles[$this->current_role_id][
"type"] = $this->current_role_type;
930 $this->roles[$this->current_role_id][
"action"] = $this->current_role_action;
933 case "PersonalPicture":
934 switch ($this->personalPicture[
"encoding"])
937 $this->personalPicture[
"content"] = base64_decode($this->cdata);
941 if (version_compare(PHP_VERSION,
'5',
'>='))
943 $this->personalPicture[
"content"] = convert_uudecode($this->cdata);
950 $this->userObj->setFullname();
953 if ($this->user_id == -1 || $this->action==
"Insert")
961 switch ($this->conflict_rule)
967 switch ($this->action)
972 $this->
logWarning($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_action_replaced"),
"Insert",
"Update"));
973 $this->action =
"Update";
979 $this->
logWarning($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_action_replaced"),
"Update",
"Insert"));
980 $this->action =
"Insert";
986 $this->
logWarning($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_action_ignored"),
"Delete"));
987 $this->action =
"Ignore";
993 switch ($this->action)
998 $this->
logWarning($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_action_ignored"),
"Insert"));
999 $this->action =
"Ignore";
1005 $this->
logWarning($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_action_ignored"),
"Update"));
1006 $this->action =
"Ignore";
1012 $this->
logWarning($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_action_ignored"),
"Delete"));
1013 $this->action =
"Ignore";
1024 $am = ($this->userObj->getAuthMode() ==
"default" || $this->userObj->getAuthMode() ==
"")
1026 : $this->userObj->getAuthMode();
1027 $loginForExternalAccount = ($this->userObj->getExternalAccount() ==
"")
1030 switch ($this->action)
1033 if ($loginForExternalAccount !=
"")
1035 $this->
logWarning($this->userObj->getLogin(), $lng->txt(
"usrimport_no_insert_ext_account_exists").
" (".$this->userObj->getExternalAccount().
")");
1036 $this->action =
"Ignore";
1045 if ($loginForExternalAccount !=
"")
1050 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->userObj->getLogin()))
1052 $this->
logWarning($this->userObj->getLogin(), $lng->txt(
"usrimport_no_update_ext_account_exists").
" (".$this->userObj->getExternalAccount().
")");
1053 $this->action =
"Ignore";
1060 switch ($this->action)
1065 $this->
logFailure($this->userObj->getLogin(),$lng->txt(
"usrimport_cant_insert"));
1070 if (!strlen($this->currPassword)==0)
1071 switch ($this->currPasswordType)
1078 $this->userObj->setPasswd($this->currPassword,
IL_PASSWD_MD5);
1083 $this->acc_mail->setUserPassword($this->currPassword);
1097 $this->userObj->setTitle($this->userObj->getFullname());
1098 $this->userObj->setDescription($this->userObj->getEmail());
1100 if(!$this->time_limit_owner_set)
1102 $this->userObj->setTimeLimitOwner($this->
getFolderId());
1106 if(!$this->time_limit_set)
1108 $this->userObj->setTimeLimitUnlimited(1);
1109 $this->userObj->setTimeLimitMessage(0);
1111 if (! $this->approve_date_set)
1113 $this->userObj->setApproveDate(date(
"Y-m-d H:i:s"));
1118 $this->userObj->setActive($this->currActive ==
'true' || is_null($this->currActive));
1124 if(count($this->udf_data))
1126 $this->userObj->setUserDefinedData($this->udf_data);
1130 $this->userObj->create();
1133 $this->userObj->saveAsNew(
false);
1136 $this->userObj->setPref(
'hits_per_page',$ilSetting->get(
'hits_per_page',30));
1137 $this->userObj->setPref(
'show_users_online',$ilSetting->get(
'show_users_online',
'y'));
1139 if (count ($this->prefs))
1141 foreach ($this->prefs as $key => $value)
1143 if ($key !=
"mail_incoming_type" &&
1144 $key !=
"mail_signature" &&
1145 $key !=
"mail_linebreak" 1148 $this->userObj->setPref($key, $value);
1153 $this->userObj->writePrefs();
1158 if (is_array($this->personalPicture))
1160 if (strlen($this->personalPicture[
"content"]))
1163 if (preg_match(
"/.*(png|jpg|gif|jpeg)$/", $this->personalPicture[
"imagetype"], $matches))
1165 $extension = $matches[1];
1167 $tmp_name = $this->
saveTempImage($this->personalPicture[
"content"],
".$extension");
1168 if (strlen($tmp_name))
1176 if ($this->ilincdata[
"id"]) {
1177 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1179 $ilinc_user->setVar(
"id", $this->ilincdata[
"id"]);
1180 $ilinc_user->setVar(
"login", $this->ilincdata[
"login"]);
1181 $ilinc_user->setVar(
"passwd", $this->ilincdata[
"password"]);
1182 $ilinc_user->update();
1186 foreach($this->roles as $role_id => $role)
1188 if ($this->role_assign[$role_id])
1190 $this->
assignToRole($this->userObj, $this->role_assign[$role_id]);
1194 if(count($this->udf_data))
1196 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
1198 foreach($this->udf_data as $field => $value)
1200 $udd->
set(
"f_".$field,$value);
1206 $this->
logSuccess($this->userObj->getLogin(),$this->userObj->getId(),
"Insert");
1208 $this->acc_mail->reset();
1215 $this->
logFailure($this->userObj->getLogin(),$lng->txt(
"usrimport_cant_update"));
1220 $updateUser->read();
1221 $updateUser->readPrefs();
1222 if ($this->currPassword != null)
1224 switch ($this->currPasswordType)
1236 $this->acc_mail->setUserPassword($this->currPassword);
1240 if (! is_null($this->userObj->getFirstname())) $updateUser->setFirstname($this->userObj->getFirstname());
1241 if (! is_null($this->userObj->getLastname())) $updateUser->setLastname($this->userObj->getLastname());
1242 if (! is_null($this->userObj->getUTitle())) $updateUser->setUTitle($this->userObj->getUTitle());
1243 if (! is_null($this->userObj->getGender())) $updateUser->setGender($this->userObj->getGender());
1244 if (! is_null($this->userObj->getEmail())) $updateUser->setEmail($this->userObj->getEmail());
1245 if (! is_null($this->userObj->getBirthday())) $updateUser->setBirthday($this->userObj->getBirthday());
1246 if (! is_null($this->userObj->getInstitution())) $updateUser->setInstitution($this->userObj->getInstitution());
1247 if (! is_null($this->userObj->getStreet())) $updateUser->setStreet($this->userObj->getStreet());
1248 if (! is_null($this->userObj->getCity())) $updateUser->setCity($this->userObj->getCity());
1249 if (! is_null($this->userObj->getZipCode())) $updateUser->setZipCode($this->userObj->getZipCode());
1250 if (! is_null($this->userObj->getCountry())) $updateUser->setCountry($this->userObj->getCountry());
1251 if (! is_null($this->userObj->getPhoneOffice())) $updateUser->setPhoneOffice($this->userObj->getPhoneOffice());
1252 if (! is_null($this->userObj->getPhoneHome())) $updateUser->setPhoneHome($this->userObj->getPhoneHome());
1253 if (! is_null($this->userObj->getPhoneMobile())) $updateUser->setPhoneMobile($this->userObj->getPhoneMobile());
1254 if (! is_null($this->userObj->getFax())) $updateUser->setFax($this->userObj->getFax());
1255 if (! is_null($this->userObj->getHobby())) $updateUser->setHobby($this->userObj->getHobby());
1256 if (! is_null($this->userObj->getComment())) $updateUser->setComment($this->userObj->getComment());
1257 if (! is_null($this->userObj->getDepartment())) $updateUser->setDepartment($this->userObj->getDepartment());
1258 if (! is_null($this->userObj->getMatriculation())) $updateUser->setMatriculation($this->userObj->getMatriculation());
1259 if (! is_null($this->currActive)) $updateUser->setActive($this->currActive ==
"true", is_object($ilUser) ? $ilUser->getId() : 0);
1260 if (! is_null($this->userObj->getClientIP())) $updateUser->setClientIP($this->userObj->getClientIP());
1261 if (! is_null($this->userObj->getTimeLimitUnlimited())) $updateUser->setTimeLimitUnlimited($this->userObj->getTimeLimitUnlimited());
1262 if (! is_null($this->userObj->getTimeLimitFrom())) $updateUser->setTimeLimitFrom($this->userObj->getTimeLimitFrom());
1263 if (! is_null($this->userObj->getTimeLimitUntil())) $updateUser->setTimeLimitUntil($this->userObj->getTimeLimitUntil());
1264 if (! is_null($this->userObj->getTimeLimitMessage())) $updateUser->setTimeLimitMessage($this->userObj->getTimeLimitMessage());
1265 if (! is_null($this->userObj->getApproveDate())) $updateUser->setApproveDate($this->userObj->getApproveDate());
1266 if (! is_null($this->userObj->getAgreeDate())) $updateUser->setAgreeDate($this->userObj->getAgreeDate());
1267 if (! is_null($this->userObj->getLanguage())) $updateUser->setLanguage($this->userObj->getLanguage());
1268 if (! is_null($this->userObj->getExternalAccount())) $updateUser->setExternalAccount($this->userObj->getExternalAccount());
1271 #if (! is_null($this->userObj->getAuthMode())) $updateUser->setAuthMode($this->userObj->getAuthMode()); 1272 if($this->auth_mode_set)
1273 $updateUser->setAuthMode($this->userObj->getAuthMode());
1275 if (! is_null($this->userObj->getInstantMessengerId(
"aim"))) $updateUser->setInstantMessengerId(
"aim", $this->userObj->getInstantMessengerId(
"aim"));
1276 if (! is_null($this->userObj->getInstantMessengerId(
"msn"))) $updateUser->setInstantMessengerId(
"msn", $this->userObj->getInstantMessengerId(
"msn"));
1277 if (! is_null($this->userObj->getInstantMessengerId(
"icq"))) $updateUser->setInstantMessengerId(
"icq", $this->userObj->getInstantMessengerId(
"icq"));
1278 if (! is_null($this->userObj->getInstantMessengerId(
"yahoo"))) $updateUser->setInstantMessengerId(
"yahoo", $this->userObj->getInstantMessengerId(
"yahoo"));
1279 if (! is_null($this->userObj->getInstantMessengerId(
"skype"))) $updateUser->setInstantMessengerId(
"skype", $this->userObj->getInstantMessengerId(
"skype"));
1280 if (! is_null($this->userObj->getInstantMessengerId(
"jabber"))) $updateUser->setInstantMessengerId(
"jabber", $this->userObj->getInstantMessengerId(
"jabber"));
1281 if (! is_null($this->userObj->getInstantMessengerId(
"voip"))) $updateUser->setInstantMessengerId(
"voip", $this->userObj->getInstantMessengerId(
"voip"));
1284 if($this->time_limit_owner_set)
1286 $updateUser->setTimeLimitOwner($this->userObj->getTimeLimitOwner());
1290 if (count ($this->prefs))
1292 foreach ($this->prefs as $key => $value)
1294 if ($key !=
"mail_incoming_type" &&
1295 $key !=
"mail_signature" &&
1296 $key !=
"mail_linebreak" 1298 $updateUser->setPref($key, $value);
1304 if ($this->updateLookAndSkin)
1306 $updateUser->setPref(
"skin", $this->userObj->getPref(
"skin"));
1307 $updateUser->setPref(
"style", $this->userObj->getPref(
"style"));
1311 $updateUser->writePrefs();
1317 if(count($this->udf_data))
1319 $updateUser->setUserDefinedData($this->udf_data);
1324 $updateUser->setTitle($updateUser->getFullname());
1325 $updateUser->setDescription($updateUser->getEmail());
1326 $updateUser->update();
1328 if ($this->ilincdata[
"id"]) {
1329 include_once
'Modules/ILinc/classes/class.ilObjiLincUser.php';
1331 $ilinc_user->setVar(
"id", $this->ilincdata[
"id"]);
1332 $ilinc_user->setVar(
"login", $this->ilincdata[
"login"]);
1333 $ilinc_user->setVar(
"passwd", $this->ilincdata[
"password"]);
1334 $ilinc_user->update();
1337 if(count($this->udf_data))
1339 include_once
'./Services/User/classes/class.ilUserDefinedData.php';
1341 foreach($this->udf_data as $field => $value)
1343 $udd->
set(
"f_".$field,$value);
1349 if (!is_null($this->userObj->getLogin()) && $this->user_id != -1)
1353 $updateUser->updateLogin($this->userObj->getLogin());
1363 if (is_array($this->personalPicture))
1365 if (strlen($this->personalPicture[
"content"]))
1368 if (preg_match(
"/.*(png|jpg|gif|jpeg)$/", $this->personalPicture[
"imagetype"], $matches))
1370 $extension = $matches[1];
1372 $tmp_name = $this->
saveTempImage($this->personalPicture[
"content"],
".$extension");
1373 if (strlen($tmp_name))
1384 foreach ($this->roles as $role_id => $role)
1386 if ($this->role_assign[$role_id])
1388 switch ($role[
"action"])
1391 $this->
assignToRole($updateUser, $this->role_assign[$role_id]);
1393 case "AssignWithParents" :
1397 $this->
detachFromRole($updateUser, $this->role_assign[$role_id]);
1408 $this->
logFailure($this->userObj->getLogin(),$lng->txt(
"usrimport_cant_delete"));
1413 $deleteUser->delete();
1421 $this->roles = array();
1425 $this->userObj->setLogin($this->cdata);
1429 $this->currPassword = $this->cdata;
1433 $this->userObj->setFirstname($this->cdata);
1437 $this->userObj->setLastname($this->cdata);
1441 $this->userObj->setUTitle($this->cdata);
1445 $this->userObj->setGender($this->cdata);
1449 $this->userObj->setEmail($this->cdata);
1456 $this->userObj->setBirthday($this->cdata);
1460 $this->userObj->setInstitution($this->cdata);
1464 $this->userObj->setStreet($this->cdata);
1468 $this->userObj->setCity($this->cdata);
1472 $this->userObj->setZipCode($this->cdata);
1476 $this->userObj->setCountry($this->cdata);
1480 $this->userObj->setPhoneOffice($this->cdata);
1484 $this->userObj->setPhoneHome($this->cdata);
1488 $this->userObj->setPhoneMobile($this->cdata);
1492 $this->userObj->setFax($this->cdata);
1496 $this->userObj->setHobby($this->cdata);
1500 $this->userObj->setComment($this->cdata);
1504 $this->userObj->setDepartment($this->cdata);
1507 case "Matriculation":
1508 $this->userObj->setMatriculation($this->cdata);
1512 $this->currActive = $this->cdata;
1516 $this->userObj->setClientIP($this->cdata);
1519 case "TimeLimitOwner":
1520 $this->time_limit_owner_set =
true;
1521 $this->userObj->setTimeLimitOwner($this->cdata);
1524 case "TimeLimitUnlimited":
1525 $this->time_limit_set =
true;
1526 $this->userObj->setTimeLimitUnlimited($this->cdata);
1529 case "TimeLimitFrom":
1530 if (is_numeric($this->cdata))
1533 $this->userObj->setTimeLimitFrom($this->cdata);
1539 if (
$timestamp !==
false && trim($this->cdata) !=
"0000-00-00 00:00:00")
1541 $this->userObj->setTimeLimitFrom(
$timestamp);
1543 elseif ($this->cdata ==
"0000-00-00 00:00:00")
1545 $this->userObj->setTimeLimitFrom(null);
1551 case "TimeLimitUntil":
1552 if (is_numeric($this->cdata))
1555 $this->userObj->setTimeLimitUntil($this->cdata);
1561 if (
$timestamp !==
false && trim($this->cdata) !=
"0000-00-00 00:00:00")
1563 $this->userObj->setTimeLimitUntil(
$timestamp);
1565 elseif ($this->cdata ==
"0000-00-00 00:00:00")
1567 $this->userObj->setTimeLimitUntil(null);
1572 case "TimeLimitMessage":
1573 $this->userObj->setTimeLimitMessage($this->cdata);
1577 $this->approve_date_set =
true;
1578 if (is_numeric($this->cdata))
1588 if (
$timestamp !==
false && trim($this->cdata) !=
"0000-00-00 00:00:00")
1593 elseif ($this->cdata ==
"0000-00-00 00:00:00")
1595 $this->userObj->setApproveDate(null);
1601 if (is_numeric($this->cdata))
1611 if (
$timestamp !==
false && trim($this->cdata) !=
"0000-00-00 00:00:00")
1616 elseif ($this->cdata ==
"0000-00-00 00:00:00")
1618 $this->userObj->setAgreeDate(null);
1624 $this->ilincdata[
"id"] = $this->cdata;
1628 $this->ilincdata[
"login"] = $this->cdata;
1632 $this->ilincdata[
"password"] = $this->cdata;
1636 case "ExternalAccount":
1637 $this->userObj->setExternalAccount($this->cdata);
1641 $this->updateLookAndSkin =
false;
1642 if (!$this->hideSkin)
1645 if ((strlen($this->skin) > 0) && (strlen($this->style) > 0))
1647 if (is_array($this->userStyles))
1649 if (in_array($this->skin .
":" . $this->style, $this->userStyles))
1651 $this->userObj->setPref(
"skin", $this->skin);
1652 $this->userObj->setPref(
"style", $this->style);
1653 $this->updateLookAndSkin =
true;
1660 case 'UserDefinedField':
1661 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1663 if($field_id = $udf->fetchFieldIdFromImportId($this->tmp_udf_id))
1665 $this->udf_data[$field_id] = $this->cdata;
1667 elseif($field_id = $udf->fetchFieldIdFromName($this->tmp_udf_name))
1669 $this->udf_data[$field_id] = $this->cdata;
1673 if ($this->current_messenger_type ==
"delicious")
1675 $this->userObj->setDelicious($this->cdata);
1677 elseif ($this->current_messenger_type ==
"external")
1679 $this->userObj->setExternalAccount($this->cdata);
1683 $this->userObj->setInstantMessengerId($this->current_messenger_type, $this->cdata);
1687 if ($this->currentPrefKey != null && strlen(trim($this->cdata)) > 0
1689 $this->prefs[$this->currentPrefKey] = trim($this->cdata);
1690 $this->currentPrefKey = null;
1702 $fh = fopen($tempname,
"wb");
1707 $imagefile = fwrite($fh, $image_data);
1722 $this->roles[$this->current_role_id][
"name"] = $this->cdata;
1723 $this->roles[$this->current_role_id][
"type"] = $this->current_role_type;
1724 $this->roles[$this->current_role_id][
"action"] = $this->current_role_action;
1728 $this->userObj->setFullname();
1729 if ($this->user_id != -1 && ($this->action ==
"Update" || $this->action ==
"Delete"))
1734 if (is_null($this->userObj->getLogin()))
1736 $this->
logFailure(
"---",sprintf($lng->txt(
"usrimport_xml_element_for_action_required"),
"Login",
"Insert"));
1739 switch ($this->action)
1744 $this->
logWarning($this->userObj->getLogin(),$lng->txt(
"usrimport_cant_insert"));
1746 if (is_null($this->userObj->getGender()) && $this->
isFieldRequired(
"gender"))
1748 $this->
logFailure($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_xml_element_for_action_required"),
"Gender",
"Insert"));
1750 if (is_null($this->userObj->getFirstname()))
1752 $this->
logFailure($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_xml_element_for_action_required"),
"Firstname",
"Insert"));
1754 if (is_null($this->userObj->getLastname()))
1756 $this->
logFailure($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_xml_element_for_action_required"),
"Lastname",
"Insert"));
1758 if (count($this->roles) == 0)
1760 $this->
logFailure($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_xml_element_for_action_required"),
"Role",
"Insert"));
1764 $has_global_role =
false;
1765 foreach ($this->roles as $role)
1767 if ($role[
'type'] ==
'Global')
1769 $has_global_role =
true;
1773 if (! $has_global_role)
1775 $this->
logFailure($this->userObj->getLogin(),sprintf($lng->txt(
"usrimport_global_role_for_action_required"),
"Insert"));
1782 $this->
logWarning($this->userObj->getLogin(),$lng->txt(
"usrimport_cant_update"));
1784 elseif($this->user_id != -1 && !is_null($this->userObj->getLogin()))
1790 $this->
logFailure($this->userObj->getLogin(), $lng->txt(
"usrimport_login_is_not_unique"));
1797 $this->
logWarning($this->userObj->getLogin(),$lng->txt(
"usrimport_cant_delete"));
1803 $this->roles = array();
1807 if (array_key_exists($this->cdata, $this->logins))
1809 $this->
logWarning($this->cdata, $lng->txt(
"usrimport_login_is_not_unique"));
1813 $this->logins[$this->cdata] = $this->cdata;
1815 $this->userObj->setLogin($this->cdata);
1819 switch ($this->currPasswordType)
1831 $this->acc_mail->setUserPassword($this->cdata);
1841 $this->userObj->setFirstname($this->cdata);
1845 $this->userObj->setLastname($this->cdata);
1849 $this->userObj->setUTitle($this->cdata);
1853 if ($this->cdata !=
"m" 1854 && $this->cdata !=
"f")
1857 $this->userObj->getLogin(),
1858 sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"Gender",$this->cdata)
1861 $this->userObj->setGender($this->cdata);
1865 $this->userObj->setEmail($this->cdata);
1869 $this->userObj->setInstitution($this->cdata);
1873 $this->userObj->setStreet($this->cdata);
1877 $this->userObj->setCity($this->cdata);
1881 $this->userObj->setZipCode($this->cdata);
1885 $this->userObj->setCountry($this->cdata);
1889 $this->userObj->setPhoneOffice($this->cdata);
1893 $this->userObj->setPhoneHome($this->cdata);
1897 $this->userObj->setPhoneMobile($this->cdata);
1901 $this->userObj->setFax($this->cdata);
1905 $this->userObj->setHobby($this->cdata);
1909 $this->userObj->setComment($this->cdata);
1913 $this->userObj->setDepartment($this->cdata);
1916 case "Matriculation":
1917 $this->userObj->setMatriculation($this->cdata);
1920 case "ExternalAccount":
1922 $am = ($this->userObj->getAuthMode() ==
"default" || $this->userObj->getAuthMode() ==
"")
1924 : $this->userObj->getAuthMode();
1925 $loginForExternalAccount = (trim($this->cdata) ==
"")
1928 switch ($this->action)
1931 if ($loginForExternalAccount !=
"")
1933 $this->
logWarning($this->userObj->getLogin(), $lng->txt(
"usrimport_no_insert_ext_account_exists").
" (".$this->cdata.
")");
1938 if ($loginForExternalAccount !=
"")
1941 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->userObj->getLogin()))
1943 $this->
logWarning($this->userObj->getLogin(),
1944 $lng->txt(
"usrimport_no_update_ext_account_exists").
" (".$this->cdata.
" for ".$loginForExternalAccount.
")");
1950 if ($externalAccountHasChanged)
1951 $this->userObj->setExternalAccount(trim($this->cdata));
1955 if ($this->cdata !=
"true" 1956 && $this->cdata !=
"false")
1958 $this->
logFailure($this->userObj->getLogin(),
1959 sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"Active",$this->cdata));
1961 $this->currActive = $this->cdata;
1963 case "TimeLimitOwner":
1964 if (!preg_match(
"/\d+/", $this->cdata))
1966 $this->
logFailure($this->userObj->getLogin(),
1967 sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"TimeLimitOwner",$this->cdata));
1969 elseif(!$ilAccess->checkAccess(
'cat_administrate_users',
'',$this->cdata))
1971 $this->
logFailure($this->userObj->getLogin(),
1972 sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"TimeLimitOwner",$this->cdata));
1974 elseif($ilObjDataCache->lookupType($ilObjDataCache->lookupObjId($this->cdata)) !=
'cat' && !(
int) $this->cdata ==
USER_FOLDER_ID)
1976 $this->
logFailure($this->userObj->getLogin(),
1977 sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"TimeLimitOwner",$this->cdata));
1980 $this->userObj->setTimeLimitOwner($this->cdata);
1982 case "TimeLimitUnlimited":
1983 switch (strtolower($this->cdata))
1987 $this->userObj->setTimeLimitUnlimited(1);
1991 $this->userObj->setTimeLimitUnlimited(0);
1994 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"TimeLimitUnlimited",$this->cdata));
1998 case "TimeLimitFrom":
2000 if (strtotime($this->cdata) ===
false && ! is_numeric($this->cdata))
2002 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"TimeLimitFrom",$this->cdata));
2004 $this->userObj->setTimeLimitFrom($this->cdata);
2006 case "TimeLimitUntil":
2008 if (strtotime($this->cdata) ===
false && ! is_numeric($this->cdata))
2010 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"TimeLimitUntil",$this->cdata));
2012 $this->userObj->setTimeLimitUntil($this->cdata);
2014 case "TimeLimitMessage":
2015 switch (strtolower($this->cdata))
2018 $this->userObj->setTimeLimitMessage(1);
2021 $this->userObj->setTimeLimitMessage(0);
2024 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"TimeLimitMessage",$this->cdata));
2030 if (strtotime($this->cdata) ===
false && ! is_numeric($this->cdata) && !$this->cdata ==
"0000-00-00 00:00:00")
2032 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"ApproveDate",$this->cdata));
2037 if (strtotime($this->cdata) ===
false && ! is_numeric($this->cdata) && !$this->cdata ==
"0000-00-00 00:00:00")
2039 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"AgreeDate",$this->cdata));
2043 if (!preg_match(
"/\d+/", $this->cdata))
2045 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"iLincID",$this->cdata));
2049 if (!preg_match(
"/\w+/", $this->cdata))
2051 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"iLincUser",$this->cdata));
2055 if (!preg_match(
"/\w+/", $this->cdata))
2057 $this->
logFailure($this->userObj->getLogin(), sprintf($lng->txt(
"usrimport_xml_element_content_illegal"),
"iLincPasswd",$this->cdata));
2061 if ($this->currentPrefKey != null)
2062 $this->
verifyPref($this->currentPrefKey, $this->cdata);
2063 $this->currentPrefKey == null;
2075 if($a_data !=
"\n") $a_data = preg_replace(
"/\t+/",
" ",$a_data);
2077 if(strlen($a_data) > 0)
2079 $this->cdata .= $a_data;
2106 if (! array_key_exists($aLogin, $this->protocol))
2108 $this->protocol[$aLogin] = array();
2112 $this->protocol[$aLogin][] = $aMessage;
2127 if (! array_key_exists($aLogin, $this->protocol))
2129 $this->protocol[$aLogin] = array();
2133 $this->protocol[$aLogin][] = $aMessage;
2147 $this->user_mapping[$userid] = array(
"login" => $aLogin,
"action" => $action,
"message" =>
"successful");
2170 $block =
new ilTemplate(
"tpl.usr_import_log_block.html",
true,
true,
"Services/User");
2171 $block->setVariable(
"TXT_LOG_TITLE", $a_log_title);
2172 $block->setVariable(
"TXT_MESSAGE_ID", $lng->txt(
"login"));
2173 $block->setVariable(
"TXT_MESSAGE_TEXT", $lng->txt(
"message"));
2176 $block->setCurrentBlock(
"log_row");
2186 $reason = $reason.
"<br>".$message;
2189 $block->setVariable(
"MESSAGE_ID", $login);
2190 $block->setVariable(
"MESSAGE_TEXT", $reason);
2191 $block->parseCurrentBlock();
2193 return $block->get();
2227 if(
$_POST[
"send_mail"] !=
"" ||
2228 ($this->
isSendMail() && $this->userObj->getEmail() !=
""))
2230 $this->acc_mail->setUser($this->userObj);
2233 if($amail[
"att_file"])
2235 include_once
"Services/User/classes/class.ilFSStorageUserFolder.php";
2238 $path = $fs->getAbsolutePath() .
"/";
2240 $this->acc_mail->addAttachment(
$path .
"/" . $amail[
"lang"], $amail[
"att_file"]);
2242 $this->acc_mail->send();
2248 if(!isset(self::$account_mail_cache[$lang_key]))
2250 $default_lang_key =
$GLOBALS[
"lng"]->getDefaultLanguage();
2253 include_once
'./Services/User/classes/class.ilObjUserFolder.php';
2257 if (trim($amail[
"body"]) !=
"" && trim($amail[
"subject"]) !=
"")
2259 self::$account_mail_cache[$lang_key] = $amail;
2263 $lang_key = $default_lang_key;
2266 if(!isset(self::$account_mail_cache[$default_lang_key]))
2269 self::$account_mail_cache[$default_lang_key] = $amail;
2272 return self::$account_mail_cache[$lang_key];
2281 $this->send_mail = $value ?
true:
false;
2301 $this->mapping_mode = $value;
2302 else die (
"wrong argument using methode setUserMappingMethod in ".__FILE__);
2325 if(is_array($this->required_fields))
2327 return $this->required_fields;
2329 foreach($ilSetting->getAll() as $field => $value)
2331 if(substr($field,0,8) ==
'require_' and $value == 1)
2333 $value = substr($field,8);
2334 $this->required_fields[$value] = $value;
2337 return $this->required_fields ? $this->required_fields : array();
2350 include_once
"Services/User/classes/class.ilUserProfile.php";
2363 $fieldname = strtolower(trim($fieldname));
2364 return array_key_exists($fieldname, $requiredFields);
2369 case 'mail_linebreak':
2370 case 'hits_per_page':
2371 if (!is_numeric($value) || $value < 0)
2372 $this->
logFailure(
"---",
"Wrong value '$value': Positiv numeric value expected for preference $key.");
2377 case 'ilPageEditor_HTMLMode':
2378 case 'ilPageEditor_JavaScript':
2379 case 'ilPageEditor_MediaMode':
2380 case 'tst_javascript':
2381 case 'tst_lastquestiontype':
2382 case 'tst_multiline_answers':
2383 case 'tst_use_previous_answers':
2384 case 'graphicalAnswerSetting':
2385 case 'priv_feed_pass':
2386 $this->
logFailure(
"---",
"Preference $key is not supported.");
2389 case 'public_country':
2390 case 'public_department':
2391 case 'public_email':
2393 case 'public_hobby':
2394 case 'public_institution':
2395 case 'public_matriculation':
2396 case 'public_phone':
2397 case 'public_phone_home':
2398 case 'public_phone_mobile':
2399 case 'public_phone_office':
2400 case 'public_street':
2401 case 'public_upload':
2403 case 'send_info_mails':
2404 case 'hide_own_online_status':
2405 if (!in_array($value, array(
'y',
'n')))
2406 $this->
logFailure(
"---",
"Wrong value '$value': Value 'y' or 'n' expected for preference $key.");
2408 case 'public_profile':
2409 if (!in_array($value, array(
'y',
'n',
'g')))
2410 $this->
logFailure(
"---",
"Wrong value '$value': Value 'y', 'g' or 'n' expected for preference $key.");
2412 case 'show_users_online':
2413 if (!in_array($value, array(
'y',
'n',
'associated')))
2414 $this->
logFailure(
"---",
"Wrong value '$value': Value 'y' or 'n' or 'associated' expected for preference $key.");
2416 case 'mail_incoming_type':
2417 if (!in_array((
int) $value, array(
"0",
"1",
"2")))
2418 $this->
logFailure(
"---",
"Wrong value '$value': Value \"0\" (LOCAL),\"1\" (EMAIL) or \"2\" (BOTH) expected for preference $key.");
2421 if (!in_array($value, array (
"0",
"1")))
2422 $this->
logFailure(
"---",
"Wrong value '$value': Value \"0\" (Sunday) or \"1\" (Monday) expected for preference $key.");
2425 case 'mail_signature':
2428 include_once(
'Services/Calendar/classes/class.ilTimeZone.php');
2433 $this->
logFailure(
"---",
"Wrong value '$value': Invalid timezone $value detected for preference $key.");
2438 $this->
logFailure(
"---",
"Preference $key is not supported.");
2444 if (array_key_exists(
"mail_incoming_type", $this->prefs) ||
2445 array_key_exists(
"mail_signature", $this->prefs) ||
2446 array_key_exists(
"mail_linebreak", $this->prefs)
2449 include_once(
"Services/Mail/classes/class.ilMailOptions.php");
2451 $mailOptions->updateOptions(
2452 array_key_exists(
"mail_signature", $this->prefs) ? $this->prefs[
"mail_signature"] : $mailOptions->getSignature(),
2453 array_key_exists(
"mail_linebreak", $this->prefs) ? $this->prefs[
"mail_linebreak"] : $mailOptions->getLinebreak(),
2454 array_key_exists(
"mail_incoming_type", $this->prefs) ? $this->prefs[
"mail_incoming_type"] : $mailOptions->getIncomingType(),
2455 $mailOptions->getCronjobNotification()
$hideSkin
Indicates if the skins are hidden.
static isProfileIncomplete($a_user, $a_include_udf=true, $a_personal_data_only=true)
Check if all required personal data fields are set.
Class for user related exception handling in ILIAS.
Class UserMail this class handles user mails.
setRoleAssignment($a_assign)
set import to local role assignemt
sendAccountMail()
send account mail
$ilincdata
Cached iLinc data.
$parentRolesCache
Cached parent roles.
verifyBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
const IL_USER_MAPPING_LOGIN
getCollectedRoles()
get collected roles
static _getInstance()
Get instance.
getParentRoleIds($a_role_id)
Get array of parent role ids from cache.
$currPassword
The password of the current user.
_lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
$updateLookAndSkin
boolean to determine if look and skin should be updated
getUserMappingMode()
read access to user mapping mode
_lookupExternalAccount($a_user_id)
lookup external account for login and authmethod
extractRolesEndTag($a_xml_parser, $a_name)
handler for end of element when in extract roles mode.
ilUserImportParser($a_xml_file='', $a_mode=IL_USER_IMPORT, $a_conflict_rule=IL_FAIL_ON_CONFLICT)
Constructor.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupId($a_user_str)
lookup id by login
verifyEndTag($a_xml_parser, $a_name)
handler for end of element when in verify mode.
isFieldRequired($fieldname)
determine if a field $fieldname is to a required field (global setting)
static _lookupTitle($a_id)
lookup object title
const IL_FAIL_ON_CONFLICT
buildTag($type, $name, $attr="")
generate a tag with given name and attributes
isSuccess()
Returns true, if the import was successful.
$error_level
This variable is used to report the error level of the validation process or the importing process...
readRequiredFields()
read required fields
assignToRole($a_user_obj, $a_role_id)
Assigns a user to a role.
checkProfileIncomplete($user_obj)
Check if profile is incomplete Will set the usr_data field profile_incomplete if any required field i...
$currActive
The active state of the current user.
$currPasswordType
The password type of the current user.
static isPrefExportable($key)
returns wether a key from db is exportable or not
$personalPicture
Cached personal picture of the actual user This is used because the ilObjUser object has no field for...
static _getAllTemplates()
setSendMail($value)
write access to property send mail
static _getAuthModeName($a_auth_key)
logWarning($aLogin, $aMessage)
Writes a warning log message to the protocol.
importBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element in user import mode
static _getAllReferences($a_id)
get all reference ids of object
handlerEndTag($a_xml_parser, $a_name)
handler for end of element
assignToRoleWithParents($a_user_obj, $a_role_id)
Assigns a user to a role and to all parent roles.
$userStyles
User assigned styles.
_uploadPersonalPicture($tmp_file, $obj_id)
Create a personal picture image file from a temporary image file.
startParsing()
start the parser
_lookupNewAccountMail($a_lang)
getUserIdByLogin($a_login)
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...
isSendMail()
read access to property send mail
$action
The Action attribute determines what to do for the current User element.
extractRolesBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element in extract roles mode
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class private
getProtocol()
Returns the protocol.
getRoleObject($a_role_id)
Returns the parent object of the role folder object which contains the specified role.
special template class to simplify handling of ITX/PEAR
readAccountMailFromCache($lang_key)
Class for TimeZone exceptions.
static _dropDesktopItem($a_usr_id, $a_item_id, $a_type)
drop an item from user's personal desktop
_lookupLogin($a_user_id)
lookup login
$logins
This variable is used to collect each login that we encounter in the import data. ...
getUserCount()
get count of User elements
Class ilObjiLincUser iLinc related user settings.
$localRoleCache
Cached local roles.
getUserMapping()
returns a map user_id <=> login
logFailure($aLogin, $aMessage)
Writes a failure log message to the protocol.
static _lookupType($a_id, $a_reference=false)
lookup object type
handlerCharacterData($a_xml_parser, $a_data)
handler for character data
getCourseMembersObjectForRole($a_role_id)
Returns the parent object of the role folder object which contains the specified role.
foreach($mandatory_scripts as $file) $timestamp
logSuccess($aLogin, $userid, $action)
Writes a success log message to the protocol.
getErrorLevel()
Returns the error level.
$protocol
The variable holds the protocol of the import.
saveTempImage($image_data, $filename)
Saves binary image data to a temporary image file and returns the name of the image file on success...
static _addDesktopItem($a_usr_id, $a_item_id, $a_type, $a_par="")
add an item to user's personal desktop
static _getInstance($a_tz='')
get instance by timezone
static ilTempnam()
Create a temporary file in an ILIAS writable directory.
setUserMappingMode($value)
write access to user mapping mode
detachFromRole($a_user_obj, $a_role_id)
Detachs a user from a role.
setFolderId($a_folder_id)
assign users to this folder (normally the usr_folder) But if called from local admin => the ref_id of...
$conflict_rule
Conflict handling rule.
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
importEndTag($a_xml_parser, $a_name)
handler for end of element when in import user mode.
$disableSkin
Indicates if the skins are enabled.
parses the template.xml that defines all styles of the current template
const USER_FOLDER_ID
Class ilObjUserFolder.
static $account_mail_cache
static __extractId($ilias_id, $inst_id)
extract ref id from role title, e.g.
$userCount
The count of user elements in the XML file.
const IL_UPDATE_ON_CONFLICT
updateMailPreferences($usr_id)
getProtocolAsHTML($a_log_title)
Returns the protocol as a HTML table.
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
handler for begin of element
const IL_IGNORE_ON_CONFLICT