19 declare(strict_types=1);
219 string $a_xml_file =
'',
220 int $a_mode = self::IL_USER_IMPORT,
221 int $a_conflict_rule = self::IL_FAIL_ON_CONFLICT
225 $this->
ilias = $DIC[
'ilias'];
226 $this->
settings = $DIC[
'ilSetting'];
227 $this->object_data_cache = $DIC[
'ilObjDataCache'];
228 $this->rbac_review = $DIC[
'rbacreview'];
229 $this->rbac_admin = $DIC[
'rbacadmin'];
230 $this->
access = $DIC[
'ilAccess'];
231 $this->
user = $DIC[
'ilUser'];
234 $http = $DIC[
'http'];
239 $this->mode = $a_mode;
240 $this->conflict_rule = $a_conflict_rule;
241 $this->error_level = self::IL_IMPORT_SUCCESS;
242 $this->protocol = [];
244 $this->userCount = 0;
245 $this->localRoleCache = [];
246 $this->parentRolesCache = [];
247 $this->send_mail =
false;
248 $this->mapping_mode = self::IL_USER_MAPPING_LOGIN;
254 $this->userStyles = [];
255 $skins = ilStyleDefinition::getAllSkins();
257 if (is_array($skins)) {
258 foreach ($skins as $skin) {
259 foreach ($skin->getStyles() as
$style) {
263 $this->userStyles [] = $skin->getId() .
':' . $style->getId();
269 $this->acc_mail->setAttachConfiguredFiles(
true);
270 $this->acc_mail->useLangVariablesAsFallback(
true);
278 $this->req_send_mail = $request->getSendMail();
289 $this->folder_id = $a_folder_id;
306 xml_set_object($a_xml_parser, $this);
307 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
308 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
318 $this->role_assign = $a_assign;
324 public function buildTag(
string $type,
string $name, array $attr = null): string
328 if ($type ===
'end') {
334 if (is_array($attr)) {
335 foreach ($attr as $k => $v) {
336 $tag .=
" {$k}='{$v}'";
350 switch ($this->mode) {
351 case self::IL_EXTRACT_ROLES:
354 case self::IL_USER_IMPORT:
357 case self::IL_VERIFY:
376 $current_role_id = $a_attribs[
'Id'];
378 $current_role_id = $internal_id;
380 $this->current_role_id = $this->
refinery->kindlyTo()->string()->transform($current_role_id);
381 $this->current_role_type = $a_attribs[
'Type'];
396 $current_role_id = $a_attribs[
'Id'];
398 $current_role_id = $internal_id;
400 $this->current_role_id = (string) $current_role_id;
401 $this->current_role_type = $a_attribs[
'Type'];
402 $this->current_role_action = (!isset($a_attribs[
'Action'])) ?
'Assign' : $a_attribs[
'Action'];
405 case 'PersonalPicture':
406 $this->personalPicture = [
407 'encoding' => $a_attribs[
'encoding'],
408 'imagetype' => $a_attribs[
'imagetype'],
414 $this->skin = $a_attribs[
'Skin'];
415 $this->style = $a_attribs[
'Style'];
419 $this->containedTags = [];
421 $this->acc_mail->reset();
423 $this->currentPrefKey = null;
424 $this->auth_mode_set =
false;
425 $this->approve_date_set =
false;
426 $this->time_limit_set =
false;
427 $this->time_limit_owner_set =
false;
428 $this->updateLookAndSkin =
false;
431 $this->personalPicture = null;
436 $this->udf_data = [];
440 if (isset($a_attribs[
'Id']) && $this->
getUserMappingMode() === self::IL_USER_MAPPING_ID) {
441 if (is_numeric($a_attribs[
'Id'])) {
442 $this->user_id = (
int) $a_attribs[
'Id'];
444 $this->user_id =
$id;
448 $this->userObj->setPref(
450 $this->
ilias->ini->readVariable(
'layout',
'skin')
452 $this->userObj->setPref(
454 $this->
ilias->ini->readVariable(
'layout',
'style')
457 if (isset($a_attribs[
'Language'])) {
458 $this->containedTags[] =
'Language';
460 $this->userObj->setLanguage($a_attribs[
'Language'] ??
'');
461 $this->userObj->setImportId($a_attribs[
'Id'] ??
'');
462 $this->action = (is_null($a_attribs[
'Action'])) ?
'Insert' : $a_attribs[
'Action'];
463 $this->currPassword = null;
464 $this->currPasswordType = null;
465 $this->currActive = null;
466 $this->multi_values = [];
470 $this->currPasswordType = $a_attribs[
'Type'];
473 if (array_key_exists(
'type', $a_attribs)) {
474 switch ($a_attribs[
'type']) {
477 if (strcmp(
'saml', $a_attribs[
'type']) === 0) {
479 if (count($list) === 1) {
480 $this->auth_mode_set =
true;
481 $idp = current($list);
482 $this->userObj->setAuthMode(
'saml_' . $idp->getIdpId());
486 if (strcmp(
'ldap', $a_attribs[
'type']) === 0) {
489 if (count($list) == 1) {
490 $this->auth_mode_set =
true;
491 $ldap_id = current($list);
492 $this->userObj->setAuthMode(
'ldap_' . $ldap_id);
506 $this->auth_mode_set =
true;
507 $this->userObj->setAuthMode($a_attribs[
'type']);
512 $this->userObj->getLogin(),
513 sprintf($this->
lng->txt(
'usrimport_xml_element_inapplicable'),
'AuthMode', $this->
stripTags($a_attribs[
'type']))
518 case 'UserDefinedField':
519 $this->tmp_udf_id = $a_attribs[
'Id'];
520 $this->tmp_udf_name = $a_attribs[
'Name'];
524 $this->current_messenger_type = strtolower($a_attribs[
'Type']);
527 $this->userObj->setLatitude($a_attribs[
'latitude']);
528 $this->userObj->setLongitude($a_attribs[
'longitude']);
529 $this->userObj->setLocationZoom($a_attribs[
'zoom']);
532 $this->currentPrefKey = $a_attribs[
'key'];
547 if ($a_attribs[
'Id'] ==
'') {
548 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_missing'),
'Role',
'Id'));
550 $this->current_role_id = $a_attribs[
'Id'];
551 $this->current_role_type = $a_attribs[
'Type'];
552 if ($this->current_role_type !==
'Global' 553 && $this->current_role_type !==
'Local') {
554 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_missing'),
'Role',
'Type'));
556 $this->current_role_action = (!isset($a_attribs[
'Action'])) ?
'Assign' : $a_attribs[
'Action'];
557 if ($this->current_role_action !==
'Assign' 558 && $this->current_role_action !==
'AssignWithParents' 559 && $this->current_role_action !==
'Detach') {
560 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Role',
'Action', $this->
stripTags($a_attribs[
'Action'])));
562 if ($this->action ===
'Insert' 563 && $this->current_role_action ===
'Detach') {
564 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_inapplicable'),
'Role',
'Action', $this->
stripTags($this->current_role_action), $this->
stripTags($this->action)));
566 if ($this->action ===
'Delete') {
567 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_inapplicable'),
'Role',
'Delete'));
573 $this->containedTags = [];
575 $this->userObj->setLanguage($a_attribs[
'Language'] ??
'');
576 $this->userObj->setImportId($a_attribs[
'Id'] ??
'');
577 $this->currentPrefKey = null;
581 if (isset($a_attribs[
'Id']) && $this->
getUserMappingMode() === self::IL_USER_MAPPING_ID) {
582 if (is_numeric($a_attribs[
'Id'])) {
583 $this->user_id = (
int) $a_attribs[
'Id'];
585 $this->user_id =
$id;
589 $this->action = !isset($a_attribs[
'Action']) ?
'Insert' : $a_attribs[
'Action'];
590 if ($this->action !==
'Insert' 591 && $this->action !==
'Update' 592 && $this->action !==
'Delete') {
593 $this->
logFailure($this->userObj->getImportId(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'User',
'Action', $this->
stripTags($a_attribs[
'Action'])));
595 $this->currPassword = null;
596 $this->currPasswordType = null;
600 $this->currPasswordType = $a_attribs[
'Type'];
603 if (array_key_exists(
'type', $a_attribs)) {
604 switch ($a_attribs[
'type']) {
607 if (strcmp(
'saml', $a_attribs[
'type']) === 0) {
609 if (count($list) !== 1) {
611 $this->userObj->getImportId(),
612 sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type', $this->
stripTags($a_attribs[
'type']))
617 if (strcmp(
'ldap', $a_attribs[
'type']) === 0) {
620 if (count($list) != 1) {
622 $this->userObj->getImportId(),
623 sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type', $this->
stripTags($a_attribs[
'type']))
638 $this->userObj->setAuthMode($a_attribs[
'type']);
642 $this->
logFailure($this->userObj->getImportId(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type',
''));
646 $this->currentPrefKey = $a_attribs[
'key'];
655 switch ($this->mode) {
656 case self::IL_EXTRACT_ROLES:
659 case self::IL_USER_IMPORT:
662 case self::IL_VERIFY:
689 if (array_key_exists($a_role_id, $this->localRoleCache)) {
690 return $this->localRoleCache[$a_role_id];
692 $role_obj =
new ilObjRole($a_role_id,
false);
694 $this->localRoleCache[$a_role_id] = $role_obj;
704 if (array_key_exists($a_role_id .
'_courseMembersObject', $this->localRoleCache)) {
705 return $this->localRoleCache[$a_role_id .
'_courseMembersObject'];
707 $course_refs = $this->rbac_review->getFoldersAssignedToRole($a_role_id,
true);
708 $course_ref = $course_refs[0];
711 $this->localRoleCache[$a_role_id .
'_courseMembersObject'] = $crsmembers_obj;
712 return $crsmembers_obj;
725 if ($this->rbac_review->isAssigned($a_user_obj->
getId(), $a_role_id)) {
732 $this->rbac_admin->assignUser($a_role_id, $a_user_obj->
getId(),
true);
733 $obj_id = $this->rbac_review->getObjectOfRole($a_role_id);
738 $ref_id = current((array) $ref_ids);
757 if (!array_key_exists($a_role_id, $this->parentRolesCache)) {
758 $parent_role_ids = [];
761 $short_role_title = substr($role_obj->getTitle(), 0, 12);
762 $folders = $this->rbac_review->getFoldersAssignedToRole($a_role_id,
true);
763 if (count($folders) > 0) {
764 $all_parent_role_ids = $this->rbac_review->getParentRoleIds($folders[0]);
765 foreach ($all_parent_role_ids as $parent_role_id => $parent_role_data) {
766 if ($parent_role_id != $a_role_id) {
767 switch (substr($parent_role_data[
'title'], 0, 12)) {
770 if ($short_role_title ===
'il_crs_admin' || $short_role_title ===
'il_grp_admin') {
771 $parent_role_ids[] = $parent_role_id;
776 if ($short_role_title ===
'il_crs_tutor' || $short_role_title ===
'il_grp_tutor') {
777 $parent_role_ids[] = $parent_role_id;
782 if ($short_role_title ===
'il_crs_membe' || $short_role_title ===
'il_grp_membe') {
783 $parent_role_ids[] = $parent_role_id;
792 $this->parentRolesCache[$a_role_id] = $parent_role_ids;
794 return $this->parentRolesCache[$a_role_id];
807 foreach ($parent_role_ids as $parent_role_id) {
819 $this->rbac_admin->deassignUser($a_role_id, $a_user_obj->
getId());
827 $this->rbac_review->getObjectOfRole($a_role_id)
833 $this->recommended_content_manager->removeObjectRecommendation($a_user_obj->
getId(),
$ref_id);
838 return in_array($tagname, $this->containedTags,
true);
848 $this->containedTags[] = $a_name;
857 case 'PersonalPicture':
858 switch ($this->personalPicture[
'encoding']) {
860 $this->personalPicture[
'content'] = base64_decode($this->cdata);
863 $this->personalPicture[
'content'] = convert_uudecode($this->cdata);
869 $this->userObj->setFullname();
872 if ($this->user_id == -1 || $this->action ===
'Insert') {
883 switch ($this->conflict_rule) {
884 case self::IL_FAIL_ON_CONFLICT:
887 case self::IL_UPDATE_ON_CONFLICT:
888 switch ($this->action) {
891 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_replaced'),
'Insert',
'Update'));
892 $this->action =
'Update';
897 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_replaced'),
'Update',
'Insert'));
898 $this->action =
'Insert';
903 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Delete'));
904 $this->action =
'Ignore';
909 case self::IL_IGNORE_ON_CONFLICT:
910 switch ($this->action) {
913 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Insert'));
914 $this->action =
'Ignore';
919 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Update'));
920 $this->action =
'Ignore';
925 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Delete'));
926 $this->action =
'Ignore';
937 $am = ($this->userObj->getAuthMode() ===
'default' || $this->userObj->getAuthMode() ==
'')
939 : $this->userObj->getAuthMode();
940 $loginForExternalAccount = ($this->userObj->getExternalAccount() ==
'')
943 switch ($this->action) {
945 if ($loginForExternalAccount !=
'') {
947 $this->userObj->getLogin(),
948 $this->
lng->txt(
'usrimport_no_insert_ext_account_exists')
949 .
' (' . $this->
stripTags($this->userObj->getExternalAccount()) .
')' 951 $this->action =
'Ignore';
960 if ($loginForExternalAccount !=
'') {
964 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->userObj->getLogin())) {
966 $this->userObj->getLogin(),
967 $this->
lng->txt(
'usrimport_no_update_ext_account_exists')
968 .
' (' . $this->
stripTags($this->userObj->getExternalAccount()) .
')' 970 $this->action =
'Ignore';
976 if (count($this->multi_values)) {
977 if (isset($this->multi_values[
'GeneralInterest'])) {
978 $this->userObj->setGeneralInterests($this->multi_values[
'GeneralInterest']);
980 if (isset($this->multi_values[
'OfferingHelp'])) {
981 $this->userObj->setOfferingHelp($this->multi_values[
'OfferingHelp']);
983 if (isset($this->multi_values[
'LookingForHelp'])) {
984 $this->userObj->setLookingForHelp($this->multi_values[
'LookingForHelp']);
989 switch ($this->action) {
992 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_insert'));
994 if ($this->currPassword !== null) {
995 switch (strtoupper($this->currPasswordType)) {
998 $this->userObj->setPasswordEncodingType(
'bcryptphp');
999 $this->userObj->setPasswordSalt(null);
1004 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1008 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1019 $this->userObj->setTitle($this->userObj->getFullname());
1020 $this->userObj->setDescription($this->userObj->getEmail());
1022 if (!$this->time_limit_owner_set) {
1023 $this->userObj->setTimeLimitOwner($this->
getFolderId());
1027 if (!$this->time_limit_set) {
1028 $this->userObj->setTimeLimitUnlimited(
true);
1029 $this->userObj->setTimeLimitMessage(
'');
1031 if (!$this->approve_date_set) {
1032 $this->userObj->setApproveDate(date(
'Y-m-d H:i:s'));
1037 $this->userObj->setActive($this->currActive ===
'true' || is_null($this->currActive));
1043 if (count($this->udf_data)) {
1044 $this->userObj->setUserDefinedData($this->udf_data);
1047 if (!$this->userObj->getLanguage()) {
1048 $this->userObj->setLanguage($this->
lng->getDefaultLanguage());
1052 $this->userObj->create();
1055 $this->userObj->saveAsNew();
1058 $this->userObj->setPref(
'hits_per_page', $this->
settings->get(
'hits_per_page',
'30'));
1060 if (count($this->prefs)) {
1061 foreach ($this->prefs as
$key => $value) {
1062 if (
$key !==
'mail_incoming_type' &&
1063 $key !==
'mail_signature' &&
1064 $key !==
'mail_linebreak' 1066 $this->userObj->setPref(
$key, $value);
1071 if (!is_array($this->prefs) || !array_key_exists(
'chat_osc_accept_msg', $this->prefs)) {
1072 $this->userObj->setPref(
'chat_osc_accept_msg', $this->
settings->get(
'chat_osc_accept_msg',
'n'));
1074 if (!is_array($this->prefs) || !array_key_exists(
'chat_broadcast_typing', $this->prefs)) {
1075 $this->userObj->setPref(
'chat_broadcast_typing', $this->
settings->get(
'chat_broadcast_typing',
'n'));
1077 if (!is_array($this->prefs) || !array_key_exists(
'bs_allow_to_contact_me', $this->prefs)) {
1078 $this->userObj->setPref(
'bs_allow_to_contact_me', $this->
settings->get(
'bs_allow_to_contact_me',
'n'));
1081 $this->userObj->writePrefs();
1086 if (is_array($this->personalPicture)) {
1087 if (strlen($this->personalPicture[
'content'])) {
1089 if (preg_match(
'/.*(png|jpg|gif|jpeg)$/', $this->personalPicture[
'imagetype'], $matches)) {
1090 $extension = $matches[1];
1092 $tmp_name = $this->
saveTempImage($this->personalPicture[
'content'],
".{$extension}");
1093 if (strlen($tmp_name)) {
1101 foreach ($this->roles as $role_id => $role) {
1102 if (isset($this->role_assign[$role_id]) && $this->role_assign[$role_id]) {
1103 $this->
assignToRole($this->userObj, (
int) $this->role_assign[$role_id]);
1107 if (count($this->udf_data)) {
1109 foreach ($this->udf_data as $field => $value) {
1110 $udd->
set(
'f_' . $field, $value);
1116 $this->
logSuccess($this->userObj->getLogin(), $this->userObj->getId(),
'Insert');
1118 $this->acc_mail->reset();
1124 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_update'));
1127 $updateUser->read();
1128 $updateUser->readPrefs();
1129 if ($this->currPassword != null) {
1130 switch (strtoupper($this->currPasswordType)) {
1133 $updateUser->setPasswordEncodingType(
'bcryptphp');
1134 $updateUser->setPasswordSalt(null);
1139 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1143 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1148 $updateUser->setFirstname($this->userObj->getFirstname());
1151 $updateUser->setLastname($this->userObj->getLastname());
1154 $updateUser->setUTitle($this->userObj->getUTitle());
1157 $updateUser->setGender($this->userObj->getGender());
1160 $updateUser->setEmail($this->userObj->getEmail());
1163 $updateUser->setSecondEmail($this->userObj->getSecondEmail());
1166 $updateUser->setBirthday($this->userObj->getBirthday());
1169 $updateUser->setInstitution($this->userObj->getInstitution());
1172 $updateUser->setStreet($this->userObj->getStreet());
1175 $updateUser->setCity($this->userObj->getCity());
1178 $updateUser->setZipcode($this->userObj->getZipcode());
1181 $updateUser->setCountry($this->userObj->getCountry());
1184 $updateUser->setSelectedCountry($this->userObj->getSelectedCountry());
1187 $updateUser->setPhoneOffice($this->userObj->getPhoneOffice());
1190 $updateUser->setPhoneHome($this->userObj->getPhoneHome());
1193 $updateUser->setPhoneMobile($this->userObj->getPhoneMobile());
1196 $updateUser->setFax($this->userObj->getFax());
1199 $updateUser->setHobby($this->userObj->getHobby());
1202 $updateUser->setGeneralInterests($this->userObj->getGeneralInterests());
1205 $updateUser->setOfferingHelp($this->userObj->getOfferingHelp());
1208 $updateUser->setLookingForHelp($this->userObj->getLookingForHelp());
1211 $updateUser->setComment($this->userObj->getComment());
1214 $updateUser->setDepartment($this->userObj->getDepartment());
1217 $updateUser->setMatriculation($this->userObj->getMatriculation());
1219 if (!is_null($this->currActive)) {
1220 $updateUser->setActive($this->currActive ===
'true', is_object($this->
user) ? $this->
user->getId() : 0);
1223 $updateUser->setClientIP($this->userObj->getClientIP());
1225 if ($this->time_limit_set) {
1226 $updateUser->setTimeLimitUnlimited($this->userObj->getTimeLimitUnlimited());
1229 $updateUser->setTimeLimitFrom($this->userObj->getTimeLimitFrom());
1232 $updateUser->setTimeLimitUntil($this->userObj->getTimeLimitUntil());
1235 $updateUser->setTimeLimitMessage($this->userObj->getTimeLimitMessage());
1238 $updateUser->setApproveDate($this->userObj->getApproveDate());
1241 $updateUser->setAgreeDate($this->userObj->getAgreeDate());
1244 $updateUser->setLanguage($this->userObj->getLanguage());
1247 $updateUser->setExternalAccount($this->userObj->getExternalAccount());
1251 #if (! is_null($this->userObj->getAuthMode())) $updateUser->setAuthMode($this->userObj->getAuthMode()); 1252 if ($this->auth_mode_set) {
1253 $updateUser->setAuthMode($this->userObj->getAuthMode());
1257 if ($this->time_limit_owner_set) {
1258 $updateUser->setTimeLimitOwner($this->userObj->getTimeLimitOwner());
1261 if (count($this->prefs)) {
1262 foreach ($this->prefs as
$key => $value) {
1263 if (
$key !==
'mail_incoming_type' &&
1264 $key !==
'mail_signature' &&
1265 $key !==
'mail_linebreak' 1267 $updateUser->setPref(
$key, $value);
1273 if ($this->updateLookAndSkin) {
1274 $updateUser->setPref(
'skin', $this->userObj->getPref(
'skin'));
1275 $updateUser->setPref(
'style', $this->userObj->getPref(
'style'));
1279 $updateUser->writePrefs();
1285 if (count($this->udf_data)) {
1286 $updateUser->setUserDefinedData($this->udf_data);
1290 $updateUser->setFullname();
1291 $updateUser->setTitle($updateUser->getFullname());
1292 $updateUser->setDescription($updateUser->getEmail());
1293 $updateUser->update();
1295 if (count($this->udf_data)) {
1297 foreach ($this->udf_data as $field => $value) {
1298 $udd->
set(
'f_' . $field, $value);
1304 if ($this->
tagContained(
'Login') && $this->user_id != -1) {
1306 $updateUser->updateLogin($this->userObj->getLogin());
1314 if (is_array($this->personalPicture)) {
1315 if (strlen($this->personalPicture[
'content'])) {
1317 if (preg_match(
'/.*(png|jpg|gif|jpeg)$/', $this->personalPicture[
'imagetype'], $matches)) {
1318 $extension = $matches[1];
1320 $tmp_name = $this->
saveTempImage($this->personalPicture[
'content'],
".{$extension}");
1321 if (strlen($tmp_name)) {
1331 foreach ($this->roles as $role_id => $role) {
1332 if (array_key_exists($role_id, $this->role_assign)) {
1333 switch ($role[
'action']) {
1335 $this->
assignToRole($updateUser, (
int) $this->role_assign[$role_id]);
1337 case 'AssignWithParents':
1341 $this->
detachFromRole($updateUser, (
int) $this->role_assign[$role_id]);
1351 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_delete'));
1354 $deleteUser->delete();
1386 $this->userObj->setGender($this->cdata);
1397 if (strtotime($birthday) !==
false) {
1398 $this->userObj->setBirthday($birthday);
1445 case 'GeneralInterest':
1446 case 'OfferingHelp':
1447 case 'LookingForHelp':
1459 case 'Matriculation':
1471 case 'TimeLimitOwner':
1472 $this->time_limit_owner_set =
true;
1473 $this->userObj->setTimeLimitOwner((
int) $this->cdata);
1476 case 'TimeLimitUnlimited':
1477 $this->time_limit_set =
true;
1478 $this->userObj->setTimeLimitUnlimited((
bool) $this->cdata);
1481 case 'TimeLimitFrom':
1482 if (is_numeric($this->cdata)) {
1484 $this->userObj->setTimeLimitFrom((
int) $this->cdata);
1488 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1489 $this->userObj->setTimeLimitFrom(
$timestamp);
1490 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1491 $this->userObj->setTimeLimitFrom(null);
1496 case 'TimeLimitUntil':
1497 if (is_numeric($this->cdata)) {
1499 $this->userObj->setTimeLimitUntil((
int) $this->cdata);
1503 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1504 $this->userObj->setTimeLimitUntil(
$timestamp);
1505 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1506 $this->userObj->setTimeLimitUntil(null);
1511 case 'TimeLimitMessage':
1512 $this->userObj->setTimeLimitMessage($this->cdata);
1516 $this->approve_date_set =
true;
1517 if (is_numeric($this->cdata)) {
1524 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1527 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1528 $this->userObj->setApproveDate(null);
1534 if (is_numeric($this->cdata)) {
1541 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1544 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1545 $this->userObj->setAgreeDate(null);
1550 case 'ExternalAccount':
1555 $this->updateLookAndSkin =
false;
1556 if ($this->skin !==
'' && $this->style !==
'') {
1557 if (is_array($this->userStyles)) {
1558 if (in_array($this->skin .
':' . $this->style, $this->userStyles)) {
1559 $this->userObj->setPref(
'skin', $this->skin);
1560 $this->userObj->setPref(
'style', $this->style);
1561 $this->updateLookAndSkin =
true;
1567 case 'UserDefinedField':
1570 $field_id = $udf->fetchFieldIdFromImportId($this->tmp_udf_id);
1572 if ($field_id === 0) {
1573 $field_id = $udf->fetchFieldIdFromName($this->tmp_udf_name);
1576 if ($field_id === 0) {
1584 if ($this->current_messenger_type ===
'external') {
1585 $this->userObj->setExternalAccount($this->cdata);
1589 if ($this->currentPrefKey != null && strlen(trim($this->cdata)) > 0
1593 $this->currentPrefKey = null;
1607 $fh = fopen($tempname,
'wb');
1611 fwrite($fh, $image_data);
1623 $externalAccountHasChanged =
false;
1633 $this->userObj->setFullname();
1634 if ($this->user_id != -1 && ($this->action ===
'Update' || $this->action ===
'Delete')) {
1639 $user_exists = $user_id != 0;
1641 if (is_null($this->userObj->getLogin())) {
1642 $this->
logFailure(
'---', sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Login',
'Insert'));
1646 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_xml_anonymous_or_root_not_allowed'));
1650 switch ($this->action) {
1652 if ($user_exists and $this->conflict_rule === self::IL_FAIL_ON_CONFLICT) {
1653 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_insert'));
1655 if (is_null($this->userObj->getGender()) && $this->
isFieldRequired(
'gender')) {
1656 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Gender',
'Insert'));
1658 if (is_null($this->userObj->getFirstname())) {
1659 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Firstname',
'Insert'));
1661 if (is_null($this->userObj->getLastname())) {
1662 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Lastname',
'Insert'));
1664 if (count($this->roles) == 0) {
1665 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Role',
'Insert'));
1667 $has_global_role =
false;
1668 foreach ($this->roles as $role) {
1669 if ($role[
'type'] ===
'Global') {
1670 $has_global_role =
true;
1674 if (!$has_global_role) {
1675 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_global_role_for_action_required'),
'Insert'));
1680 if (!$user_exists) {
1681 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_update'));
1682 } elseif ($this->user_id != -1 && $this->
tagContained(
'Login')) {
1687 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_login_is_not_unique'));
1692 if (!$user_exists) {
1693 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_delete'));
1703 if (array_key_exists($this->cdata, $this->logins)) {
1704 $this->
logWarning($this->cdata, $this->
lng->txt(
'usrimport_login_is_not_unique'));
1708 $this->userObj->setLogin($this->
stripTags($this->cdata));
1712 switch ($this->currPasswordType) {
1715 $this->userObj->setPasswordEncodingType(
'bcryptphp');
1716 $this->userObj->setPasswordSalt(null);
1721 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1725 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1731 $this->userObj->setFirstname($this->cdata);
1735 $this->userObj->setLastname($this->cdata);
1739 $this->userObj->setUTitle($this->cdata);
1743 if (!in_array(strtolower($this->cdata), [
'n',
'm',
'f',
''])) {
1745 $this->userObj->getLogin(),
1746 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'Gender', $this->
stripTags($this->cdata))
1749 $this->userObj->setGender($this->cdata);
1753 $this->userObj->setEmail($this->cdata);
1756 $this->userObj->setSecondEmail($this->cdata);
1759 $this->userObj->setInstitution($this->cdata);
1763 $this->userObj->setStreet($this->cdata);
1767 $this->userObj->setCity($this->cdata);
1771 $this->userObj->setZipcode($this->cdata);
1775 $this->userObj->setCountry($this->cdata);
1779 if (mb_strlen($this->cdata) !== 2) {
1781 $this->userObj->getLogin(),
1782 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'SelCountry', $this->
stripTags($this->cdata))
1785 $this->userObj->setSelectedCountry($this->cdata);
1789 $this->userObj->setPhoneOffice($this->cdata);
1793 $this->userObj->setPhoneHome($this->cdata);
1797 $this->userObj->setPhoneMobile($this->cdata);
1801 $this->userObj->setFax($this->cdata);
1805 $this->userObj->setHobby($this->cdata);
1808 case 'GeneralInterest':
1809 case 'OfferingHelp':
1810 case 'LookingForHelp':
1815 $this->userObj->setComment($this->cdata);
1819 $this->userObj->setDepartment($this->cdata);
1822 case 'Matriculation':
1823 $this->userObj->setMatriculation($this->cdata);
1826 case 'ExternalAccount':
1827 $am = ($this->userObj->getAuthMode() ===
'default' || $this->userObj->getAuthMode() ==
'')
1829 : $this->userObj->getAuthMode();
1830 $loginForExternalAccount = (trim($this->cdata) ==
'')
1833 switch ($this->action) {
1835 if ($loginForExternalAccount !=
'') {
1836 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_no_insert_ext_account_exists') .
' (' . $this->
stripTags($this->cdata) .
')');
1841 if ($loginForExternalAccount !=
'') {
1843 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->userObj->getLogin())) {
1845 $this->userObj->getLogin(),
1846 $this->
lng->txt(
'usrimport_no_update_ext_account_exists') .
' (' . $this->
stripTags($this->cdata) .
' for ' . $this->
stripTags($loginForExternalAccount) .
')' 1852 if ($externalAccountHasChanged) {
1853 $this->userObj->setExternalAccount(trim($this->cdata));
1858 if ($this->cdata !==
'true' 1859 && $this->cdata !==
'false') {
1861 $this->userObj->getLogin(),
1862 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'Active', $this->
stripTags($this->cdata))
1867 case 'TimeLimitOwner':
1868 if (!preg_match(
'/\d+/', $this->cdata)) {
1870 $this->userObj->getLogin(),
1871 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1873 } elseif (!$this->
access->checkAccess(
'cat_administrate_users',
'', (
int) $this->cdata)) {
1875 $this->userObj->getLogin(),
1876 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1878 } elseif ($this->object_data_cache->lookupType($this->object_data_cache->lookupObjId((
int) $this->cdata)) !==
'cat' && !(
int) $this->cdata ==
USER_FOLDER_ID) {
1880 $this->userObj->getLogin(),
1881 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1884 $this->userObj->setTimeLimitOwner((
int) $this->cdata);
1886 case 'TimeLimitUnlimited':
1887 switch (strtolower($this->cdata)) {
1890 $this->userObj->setTimeLimitUnlimited(
true);
1894 $this->userObj->setTimeLimitUnlimited(
false);
1897 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitUnlimited', $this->
stripTags($this->cdata)));
1901 case 'TimeLimitFrom':
1903 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata)) {
1904 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitFrom', $this->
stripTags($this->cdata)));
1906 $this->userObj->setTimeLimitFrom((
int) $this->cdata);
1908 case 'TimeLimitUntil':
1910 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata)) {
1911 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitUntil', $this->
stripTags($this->cdata)));
1913 $this->userObj->setTimeLimitUntil((
int) $this->cdata);
1915 case 'TimeLimitMessage':
1916 switch (strtolower($this->cdata)) {
1918 $this->userObj->setTimeLimitMessage(
'1');
1921 $this->userObj->setTimeLimitMessage(
'0');
1924 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitMessage', $this->
stripTags($this->cdata)));
1930 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata) && !$this->cdata ===
'0000-00-00 00:00:00') {
1931 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'ApproveDate', $this->
stripTags($this->cdata)));
1936 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata) && !$this->cdata ===
'0000-00-00 00:00:00') {
1937 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'AgreeDate', $this->
stripTags($this->cdata)));
1941 if ($this->currentPrefKey != null) {
1942 $this->
verifyPref($this->currentPrefKey, $this->cdata);
1955 if ($a_data !==
"\n") {
1956 $a_data = preg_replace(
'/\t+/',
' ', $a_data);
1959 if (strlen($a_data) > 0) {
1960 $this->cdata .= $a_data;
1984 if (!array_key_exists($aLogin, $this->protocol)) {
1985 $this->protocol[$aLogin] = [];
1988 $this->protocol[$aLogin][] = $aMessage;
1990 if ($this->error_level === self::IL_IMPORT_SUCCESS) {
1991 $this->error_level = self::IL_IMPORT_WARNING;
2002 if (!array_key_exists($aLogin, $this->protocol)) {
2003 $this->protocol[$aLogin] = [];
2006 $this->protocol[$aLogin][] = $aMessage;
2008 $this->error_level = self::IL_IMPORT_FAILURE;
2019 $this->user_mapping[$userid] = [
'login' => $aLogin,
'action' =>
$action,
'message' =>
'successful'];
2040 $block =
new ilTemplate(
'tpl.usr_import_log_block.html',
true,
true,
'Services/User');
2041 $block->setVariable(
'TXT_LOG_TITLE', $a_log_title);
2042 $block->setVariable(
'TXT_MESSAGE_ID', $this->
lng->txt(
'login'));
2043 $block->setVariable(
'TXT_MESSAGE_TEXT', $this->
lng->txt(
'message'));
2045 $block->setCurrentBlock(
'log_row');
2054 $block->setVariable(
'MESSAGE_ID', $login);
2055 $block->setVariable(
'MESSAGE_TEXT',
$reason);
2056 $block->parseCurrentBlock();
2058 return $block->get();
2066 return $this->error_level === self::IL_IMPORT_SUCCESS;
2092 if ($this->req_send_mail !=
'' ||
2093 ($this->
isSendMail() && $this->userObj->getEmail() !=
'')) {
2094 $this->acc_mail->setUser($this->userObj);
2095 $this->acc_mail->send();
2101 $this->send_mail = $value;
2116 if ($value === self::IL_USER_MAPPING_ID || $value === self::IL_USER_MAPPING_LOGIN) {
2117 $this->mapping_mode = $value;
2119 die(
'wrong argument using methode setUserMappingMethod in ' . __FILE__);
2137 if (is_array($this->required_fields)) {
2140 foreach ($this->
settings->getAll() as $field => $value) {
2141 if (strpos($field,
'require_') === 0 && $value == 1) {
2142 $value = substr($field, 8);
2143 $this->required_fields[$value] = $value;
2146 return $this->required_fields ?: [];
2155 return $this->user_profile->isProfileIncomplete($user_obj);
2167 $fieldname = strtolower(trim($fieldname));
2168 return array_key_exists($fieldname, $requiredFields);
2174 case 'mail_linebreak':
2175 case 'hits_per_page':
2176 if (!is_numeric($value) || $value < 0) {
2177 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Positiv numeric value expected for preference {$this->stripTags($key)}.");
2183 case 'ilPageEditor_HTMLMode':
2184 case 'ilPageEditor_JavaScript':
2185 case 'ilPageEditor_MediaMode':
2186 case 'tst_javascript':
2187 case 'tst_lastquestiontype':
2188 case 'tst_multiline_answers':
2189 case 'tst_use_previous_answers':
2190 case 'graphicalAnswerSetting':
2191 case 'priv_feed_pass':
2192 $this->
logFailure(
'---',
"Preference {$this->stripTags($key)} is not supported.");
2195 case 'public_country':
2196 case 'public_department':
2197 case 'public_email':
2198 case 'public_second_email':
2200 case 'public_hobby':
2201 case 'public_institution':
2202 case 'public_matriculation':
2203 case 'public_phone':
2204 case 'public_phone_home':
2205 case 'public_phone_mobile':
2206 case 'public_phone_office':
2207 case 'public_street':
2208 case 'public_upload':
2210 case 'public_interests_general':
2211 case 'public_interests_help_offered':
2212 case 'public_interests_help_looking':
2213 case 'send_info_mails':
2214 case 'bs_allow_to_contact_me':
2215 case 'chat_osc_accept_msg':
2216 case 'chat_broadcast_typing':
2217 case 'hide_own_online_status':
2218 if (!in_array($value, [
'y',
'n',
''])) {
2219 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y' or 'n' expected for preference {$this->stripTags($key)}.");
2222 case 'public_profile':
2223 if (!in_array($value, [
'y',
'n',
'g'])) {
2224 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y', 'g' or 'n' expected for preference {$this->stripTags($key)}.");
2227 case 'show_users_online':
2228 if (!in_array($value, [
'y',
'n',
'associated'])) {
2229 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y' or 'n' or 'associated' expected for preference {$this->stripTags($key)}.");
2232 case 'mail_incoming_type':
2233 if (!in_array((
int) $value, [
'0',
'1',
'2'])) {
2234 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value '0' (LOCAL),'1' (EMAIL) or '2' (BOTH) expected for preference {$this->stripTags($key)}.");
2238 if (!in_array($value, [
'0',
'1'])) {
2239 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value '0' (Sunday) or '1' (Monday) expected for preference {$this->stripTags($key)}.");
2243 case 'mail_signature':
2250 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Invalid timezone $value detected for preference {$this->stripTags($key)}.");
2255 $this->
logFailure(
'---',
"Preference {$this->stripTags($key)} is not supported.");
2263 if (array_key_exists(
'mail_incoming_type', $this->prefs) ||
2264 array_key_exists(
'mail_signature', $this->prefs) ||
2265 array_key_exists(
'mail_linebreak', $this->prefs)
2269 $mailOptions->setSignature(array_key_exists(
'mail_signature', $this->prefs) ? $this->prefs[
'mail_signature'] : $mailOptions->getSignature());
2270 $mailOptions->setIncomingType(array_key_exists(
'mail_incoming_type', $this->prefs) ? (
int) $this->prefs[
'mail_incoming_type'] : $mailOptions->getIncomingType());
2271 $mailOptions->updateOptions();
2282 return $this->
refinery->string()->stripTags()->transform($string);
bool $time_limit_owner_set
ilRecommendedContentManager $recommended_content_manager
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilUserSettingsConfig $user_settings_config
sendAccountMail()
send account mail
extractRolesEndTag( $a_xml_parser, string $a_name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupActivatedStyle(string $a_skin, string $a_style)
lookup if a style is activated
saveTempImage(string $image_data, string $filename)
Saves binary image data to a temporary image file and returns the name of the image file on success...
getCourseMembersObjectForRole(int $a_role_id)
Returns the parent object of the role folder object which contains the specified role.
static _getInstance(string $a_tz='')
get instance by timezone
assignToRoleWithParents(ilObjUser $a_user_obj, int $a_role_id)
Assigns a user to a role and to all parent roles.
handlerBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
Class ChatMainBarProvider .
verifyBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
stripTags(string $string)
importEndTag( $a_xml_parser, string $a_name)
getUserMappingMode()
read access to user mapping mode
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
static _getAllReferences(int $id)
get all reference ids for object ID
setRoleAssignment(array $a_assign)
set import to local role assignemt
isFieldRequired(string $fieldname)
determine if a field $fieldname is to a required field (global setting)
string $current_role_type
checkProfileIncomplete(ilObjUser $user_obj)
Check if profile is incomplete Will set the usr_data field profile_incomplete if any required field i...
ilObjectDataCache $object_data_cache
setUserMappingMode(int $value)
write access to user mapping mode
handlerCharacterData( $a_xml_parser, string $a_data)
handler for character data
static _lookupId($a_user_str)
logWarning(string $aLogin, string $aMessage)
Writes a warning log message to the protocol.
extractRolesBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
isSuccess()
Returns true, if the import was successful.
array $userStyles
User assigned styles.
detachFromRole(ilObjUser $a_user_obj, int $a_role_id)
Detaches a user from a role.
static _checkExternalAuthAccount(string $a_auth, string $a_account, bool $tryFallback=true)
check whether external account and authentication method matches with a user
static _getActiveServerList()
Get active server list.
static _lookupExternalAccount(int $a_user_id)
ilUserProfile $user_profile
static _getAuthModeName($a_auth_key)
static _uploadPersonalPicture(string $tmp_file, int $obj_id)
Create a personal picture image file from a temporary image file.
const IL_FAIL_ON_CONFLICT
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getUserIdByLogin(string $a_login)
$messages
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handlerEndTag( $a_xml_parser, string $a_name)
logSuccess(string $aLogin, int $userid, string $action)
Writes a success log message to the protocol.
static _lookupTitle(int $obj_id)
static _getInstanceByObjId(int $a_obj_id)
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class private
updateMailPreferences(int $usr_id)
getProtocol()
The protocol is an associative array.
array $logins
This variable is used to collect each login that we encounter in the import data. ...
Class for TimeZone exceptions.
header include for all ilias files.
array $localRoleCache
Cached local roles.
const IL_USER_MAPPING_LOGIN
set(string $a_field, string $a_value)
string $current_messenger_type
verifyPref(string $key, string $value)
getUserMapping()
returns a map user_id <=> login
buildTag(string $type, string $name, array $attr=null)
generate a tag with given name and attributes
int $error_level
This variable is used to report the error level of the validation process or the importing process...
setFolderId(int $a_folder_id)
assign users to this folder (normally the usr_folder) But if called from local admin => the ref_id of...
logFailure(string $aLogin, string $aMessage)
Writes a failure log message to the protocol.
foreach($mandatory_scripts as $file) $timestamp
importBeginTag( $a_xml_parser, string $a_name, array $a_attribs)
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
getProtocolAsHTML(string $a_log_title)
Returns the protocol as a HTML table.
getErrorLevel()
Returns the error level.
static isPrefExportable(string $key)
returns wether a key from db is exportable or not
array $personalPicture
Cached personal picture of the actual user This is used because the ilObjUser object has no field for...
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
array $protocol
The variable holds the protocol of the import.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_UPDATE_ON_CONFLICT
getParentRoleIds(int $a_role_id)
Get array of parent role ids from cache.
string $current_role_action
getRoleObject(int $a_role_id)
Returns the parent object of the role folder object which contains the specified role.
Class ilRbacAdmin Core functions for role based access control.
static getActiveIdpList()
verifyEndTag( $a_xml_parser, string $a_name)
handler for end of element when in verify mode.
static _lookupType(int $id, bool $reference=false)
__construct(?string $path_to_file='', ?bool $throw_exception=false)
ilRbacReview $rbac_review
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
tagContained(string $tagname)
array $parentRolesCache
Cached parent roles.
static _getUsedHTMLTags(string $a_module="")
Returns an array of all allowed HTML tags for text editing.
const IL_IGNORE_ON_CONFLICT
static _lookupLogin(int $a_user_id)
assignToRole(ilObjUser $a_user_obj, int $a_role_id)
Assigns a user to a role.