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;
317 $this->role_assign = $a_assign;
323 public function buildTag(
string $type,
string $name, ?array $attr =
null): string
327 if ($type ===
'end') {
333 if (is_array($attr)) {
334 foreach ($attr as $k => $v) {
335 $tag .=
" {$k}='{$v}'";
349 switch ($this->mode) {
350 case self::IL_EXTRACT_ROLES:
353 case self::IL_USER_IMPORT:
356 case self::IL_VERIFY:
375 $current_role_id = $a_attribs[
'Id'];
377 $current_role_id = $internal_id;
379 $this->current_role_id = $this->
refinery->kindlyTo()->string()->transform($current_role_id);
380 $this->current_role_type = $a_attribs[
'Type'];
395 $current_role_id = $a_attribs[
'Id'];
397 $current_role_id = $internal_id;
399 $this->current_role_id = (string) $current_role_id;
400 $this->current_role_type = $a_attribs[
'Type'];
401 $this->current_role_action = (!isset($a_attribs[
'Action'])) ?
'Assign' : $a_attribs[
'Action'];
404 case 'PersonalPicture':
405 $this->personalPicture = [
406 'encoding' => $a_attribs[
'encoding'],
407 'imagetype' => $a_attribs[
'imagetype'],
413 $this->skin = $a_attribs[
'Skin'];
414 $this->style = $a_attribs[
'Style'];
418 $this->containedTags = [];
420 $this->acc_mail->reset();
422 $this->currentPrefKey =
null;
423 $this->auth_mode_set =
false;
424 $this->approve_date_set =
false;
425 $this->time_limit_set =
false;
426 $this->time_limit_owner_set =
false;
427 $this->updateLookAndSkin =
false;
430 $this->personalPicture =
null;
435 $this->udf_data = [];
439 if (isset($a_attribs[
'Id']) && $this->
getUserMappingMode() === self::IL_USER_MAPPING_ID) {
440 if (is_numeric($a_attribs[
'Id'])) {
441 $this->user_id = (
int) $a_attribs[
'Id'];
443 $this->user_id =
$id;
447 $this->userObj->setPref(
449 $this->
ilias->ini->readVariable(
'layout',
'skin')
451 $this->userObj->setPref(
453 $this->
ilias->ini->readVariable(
'layout',
'style')
456 if (isset($a_attribs[
'Language'])) {
457 $this->containedTags[] =
'Language';
459 $this->userObj->setLanguage($a_attribs[
'Language'] ??
'');
460 $this->userObj->setImportId($a_attribs[
'Id'] ??
'');
461 $this->action = (is_null($a_attribs[
'Action'])) ?
'Insert' : $a_attribs[
'Action'];
462 $this->currPassword =
null;
463 $this->currPasswordType =
null;
464 $this->currActive =
null;
465 $this->multi_values = [];
469 $this->currPasswordType = $a_attribs[
'Type'];
472 if (array_key_exists(
'type', $a_attribs)) {
473 switch ($a_attribs[
'type']) {
476 if (strcmp(
'saml', $a_attribs[
'type']) === 0) {
478 if (count($list) === 1) {
479 $this->auth_mode_set =
true;
480 $idp = current($list);
481 $this->userObj->setAuthMode(
'saml_' . $idp->getIdpId());
485 if (strcmp(
'ldap', $a_attribs[
'type']) === 0) {
488 if (count($list) == 1) {
489 $this->auth_mode_set =
true;
490 $ldap_id = current($list);
491 $this->userObj->setAuthMode(
'ldap_' . $ldap_id);
505 $this->auth_mode_set =
true;
506 $this->userObj->setAuthMode($a_attribs[
'type']);
511 $this->userObj->getLogin(),
512 sprintf($this->
lng->txt(
'usrimport_xml_element_inapplicable'),
'AuthMode', $this->
stripTags($a_attribs[
'type']))
517 case 'UserDefinedField':
518 $this->tmp_udf_id = $a_attribs[
'Id'];
519 $this->tmp_udf_name = $a_attribs[
'Name'];
523 $this->current_messenger_type = strtolower($a_attribs[
'Type']);
526 $this->userObj->setLatitude($a_attribs[
'latitude']);
527 $this->userObj->setLongitude($a_attribs[
'longitude']);
528 $this->userObj->setLocationZoom($a_attribs[
'zoom']);
531 $this->currentPrefKey = $a_attribs[
'key'];
546 if ($a_attribs[
'Id'] ==
'') {
547 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_missing'),
'Role',
'Id'));
549 $this->current_role_id = $a_attribs[
'Id'];
550 $this->current_role_type = $a_attribs[
'Type'];
551 if ($this->current_role_type !==
'Global' 552 && $this->current_role_type !==
'Local') {
553 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_missing'),
'Role',
'Type'));
555 $this->current_role_action = (!isset($a_attribs[
'Action'])) ?
'Assign' : $a_attribs[
'Action'];
556 if ($this->current_role_action !==
'Assign' 557 && $this->current_role_action !==
'AssignWithParents' 558 && $this->current_role_action !==
'Detach') {
559 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Role',
'Action', $this->
stripTags($a_attribs[
'Action'])));
561 if ($this->action ===
'Insert' 562 && $this->current_role_action ===
'Detach') {
563 $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)));
565 if ($this->action ===
'Delete') {
566 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_inapplicable'),
'Role',
'Delete'));
572 $this->containedTags = [];
574 $this->userObj->setLanguage($a_attribs[
'Language'] ??
'');
575 $this->userObj->setImportId($a_attribs[
'Id'] ??
'');
576 $this->currentPrefKey =
null;
580 if (isset($a_attribs[
'Id']) && $this->
getUserMappingMode() === self::IL_USER_MAPPING_ID) {
581 if (is_numeric($a_attribs[
'Id'])) {
582 $this->user_id = (
int) $a_attribs[
'Id'];
584 $this->user_id =
$id;
588 $this->action = !isset($a_attribs[
'Action']) ?
'Insert' : $a_attribs[
'Action'];
589 if ($this->action !==
'Insert' 590 && $this->action !==
'Update' 591 && $this->action !==
'Delete') {
592 $this->
logFailure($this->userObj->getImportId(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'User',
'Action', $this->
stripTags($a_attribs[
'Action'])));
594 $this->currPassword =
null;
595 $this->currPasswordType =
null;
599 $this->currPasswordType = $a_attribs[
'Type'];
602 if (array_key_exists(
'type', $a_attribs)) {
603 switch ($a_attribs[
'type']) {
606 if (strcmp(
'saml', $a_attribs[
'type']) === 0) {
608 if (count($list) !== 1) {
610 $this->userObj->getImportId(),
611 sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type', $this->
stripTags($a_attribs[
'type']))
616 if (strcmp(
'ldap', $a_attribs[
'type']) === 0) {
619 if (count($list) != 1) {
621 $this->userObj->getImportId(),
622 sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type', $this->
stripTags($a_attribs[
'type']))
637 $this->userObj->setAuthMode($a_attribs[
'type']);
641 $this->
logFailure($this->userObj->getImportId(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type',
''));
645 $this->currentPrefKey = $a_attribs[
'key'];
654 switch ($this->mode) {
655 case self::IL_EXTRACT_ROLES:
658 case self::IL_USER_IMPORT:
661 case self::IL_VERIFY:
688 if (array_key_exists($a_role_id, $this->localRoleCache)) {
689 return $this->localRoleCache[$a_role_id];
691 $role_obj =
new ilObjRole($a_role_id,
false);
693 $this->localRoleCache[$a_role_id] = $role_obj;
703 if (array_key_exists($a_role_id .
'_courseMembersObject', $this->localRoleCache)) {
704 return $this->localRoleCache[$a_role_id .
'_courseMembersObject'];
706 $course_refs = $this->rbac_review->getFoldersAssignedToRole($a_role_id,
true);
707 $course_ref = $course_refs[0];
710 $this->localRoleCache[$a_role_id .
'_courseMembersObject'] = $crsmembers_obj;
711 return $crsmembers_obj;
724 if ($this->rbac_review->isAssigned($a_user_obj->
getId(), $a_role_id)) {
731 $this->rbac_admin->assignUser($a_role_id, $a_user_obj->
getId(),
true);
732 $obj_id = $this->rbac_review->getObjectOfRole($a_role_id);
737 $ref_id = current((array) $ref_ids);
756 if (!array_key_exists($a_role_id, $this->parentRolesCache)) {
757 $parent_role_ids = [];
760 $short_role_title = substr($role_obj->getTitle(), 0, 12);
761 $folders = $this->rbac_review->getFoldersAssignedToRole($a_role_id,
true);
762 if (count($folders) > 0) {
763 $all_parent_role_ids = $this->rbac_review->getParentRoleIds($folders[0]);
764 foreach ($all_parent_role_ids as $parent_role_id => $parent_role_data) {
765 if ($parent_role_id != $a_role_id) {
766 switch (substr($parent_role_data[
'title'], 0, 12)) {
769 if ($short_role_title ===
'il_crs_admin' || $short_role_title ===
'il_grp_admin') {
770 $parent_role_ids[] = $parent_role_id;
775 if ($short_role_title ===
'il_crs_tutor' || $short_role_title ===
'il_grp_tutor') {
776 $parent_role_ids[] = $parent_role_id;
781 if ($short_role_title ===
'il_crs_membe' || $short_role_title ===
'il_grp_membe') {
782 $parent_role_ids[] = $parent_role_id;
791 $this->parentRolesCache[$a_role_id] = $parent_role_ids;
793 return $this->parentRolesCache[$a_role_id];
806 foreach ($parent_role_ids as $parent_role_id) {
818 $this->rbac_admin->deassignUser($a_role_id, $a_user_obj->
getId());
822 $obj = $this->rbac_review->getObjectOfRole($a_role_id);
825 $this->recommended_content_manager->removeObjectRecommendation($a_user_obj->
getId(),
$ref_id);
831 return in_array($tagname, $this->containedTags,
true);
841 $this->containedTags[] = $a_name;
850 case 'PersonalPicture':
851 switch ($this->personalPicture[
'encoding']) {
853 $this->personalPicture[
'content'] = base64_decode($this->cdata);
856 $this->personalPicture[
'content'] = convert_uudecode($this->cdata);
862 $this->userObj->setFullname();
865 if ($this->user_id == -1 || $this->action ===
'Insert') {
876 switch ($this->conflict_rule) {
877 case self::IL_FAIL_ON_CONFLICT:
880 case self::IL_UPDATE_ON_CONFLICT:
881 switch ($this->action) {
884 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_replaced'),
'Insert',
'Update'));
885 $this->action =
'Update';
890 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_replaced'),
'Update',
'Insert'));
891 $this->action =
'Insert';
896 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Delete'));
897 $this->action =
'Ignore';
902 case self::IL_IGNORE_ON_CONFLICT:
903 switch ($this->action) {
906 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Insert'));
907 $this->action =
'Ignore';
912 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Update'));
913 $this->action =
'Ignore';
918 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Delete'));
919 $this->action =
'Ignore';
930 $am = ($this->userObj->getAuthMode() ===
'default' || $this->userObj->getAuthMode() ==
'')
932 : $this->userObj->getAuthMode();
933 $loginForExternalAccount = ($this->userObj->getExternalAccount() ==
'')
936 switch ($this->action) {
938 if ($loginForExternalAccount !=
'') {
940 $this->userObj->getLogin(),
941 $this->
lng->txt(
'usrimport_no_insert_ext_account_exists')
942 .
' (' . $this->
stripTags($this->userObj->getExternalAccount()) .
')' 944 $this->action =
'Ignore';
953 if ($loginForExternalAccount !=
'') {
957 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->userObj->getLogin())) {
959 $this->userObj->getLogin(),
960 $this->
lng->txt(
'usrimport_no_update_ext_account_exists')
961 .
' (' . $this->
stripTags($this->userObj->getExternalAccount()) .
')' 963 $this->action =
'Ignore';
969 if (count($this->multi_values)) {
970 if (isset($this->multi_values[
'GeneralInterest'])) {
971 $this->userObj->setGeneralInterests($this->multi_values[
'GeneralInterest']);
973 if (isset($this->multi_values[
'OfferingHelp'])) {
974 $this->userObj->setOfferingHelp($this->multi_values[
'OfferingHelp']);
976 if (isset($this->multi_values[
'LookingForHelp'])) {
977 $this->userObj->setLookingForHelp($this->multi_values[
'LookingForHelp']);
982 switch ($this->action) {
985 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_insert'));
987 if ($this->currPassword !==
null) {
988 switch (strtoupper($this->currPasswordType)) {
991 $this->userObj->setPasswordEncodingType(
'bcryptphp');
992 $this->userObj->setPasswordSalt(
null);
997 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1001 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1012 $this->userObj->setTitle($this->userObj->getFullname());
1013 $this->userObj->setDescription($this->userObj->getEmail());
1015 if (!$this->time_limit_owner_set) {
1016 $this->userObj->setTimeLimitOwner($this->
getFolderId());
1020 if (!$this->time_limit_set) {
1021 $this->userObj->setTimeLimitUnlimited(
true);
1022 $this->userObj->setTimeLimitMessage(
'');
1024 if (!$this->approve_date_set) {
1025 $this->userObj->setApproveDate(date(
'Y-m-d H:i:s'));
1030 $this->userObj->setActive($this->currActive ===
'true' || is_null($this->currActive));
1036 if (count($this->udf_data)) {
1037 $this->userObj->setUserDefinedData($this->udf_data);
1040 if (!$this->userObj->getLanguage()) {
1041 $this->userObj->setLanguage($this->
lng->getDefaultLanguage());
1045 $this->userObj->create();
1048 $this->userObj->saveAsNew();
1050 if (count($this->prefs)) {
1051 foreach ($this->prefs as $key => $value) {
1052 if ($key !==
'mail_incoming_type' &&
1053 $key !==
'mail_signature' &&
1054 $key !==
'mail_linebreak' 1056 $this->userObj->setPref($key, $value);
1061 if (!is_array($this->prefs) || !array_key_exists(
'chat_osc_accept_msg', $this->prefs)) {
1062 $this->userObj->setPref(
'chat_osc_accept_msg', $this->
settings->get(
'chat_osc_accept_msg',
'n'));
1064 if (!is_array($this->prefs) || !array_key_exists(
'chat_broadcast_typing', $this->prefs)) {
1065 $this->userObj->setPref(
'chat_broadcast_typing', $this->
settings->get(
'chat_broadcast_typing',
'n'));
1067 if (!is_array($this->prefs) || !array_key_exists(
'bs_allow_to_contact_me', $this->prefs)) {
1068 $this->userObj->setPref(
'bs_allow_to_contact_me', $this->
settings->get(
'bs_allow_to_contact_me',
'n'));
1071 $this->userObj->writePrefs();
1076 if (is_array($this->personalPicture)) {
1077 if (strlen($this->personalPicture[
'content'])) {
1079 if (preg_match(
'/.*(png|jpg|gif|jpeg)$/', $this->personalPicture[
'imagetype'], $matches)) {
1080 $extension = $matches[1];
1082 $tmp_name = $this->
saveTempImage($this->personalPicture[
'content'],
".{$extension}");
1083 if (strlen($tmp_name)) {
1091 foreach ($this->roles as $role_id => $role) {
1092 if (isset($this->role_assign[$role_id]) && $this->role_assign[$role_id]) {
1093 $this->
assignToRole($this->userObj, (
int) $this->role_assign[$role_id]);
1097 if (count($this->udf_data)) {
1099 foreach ($this->udf_data as $field => $value) {
1100 $udd->
set(
'f_' . $field, $value);
1106 $this->
logSuccess($this->userObj->getLogin(), $this->userObj->getId(),
'Insert');
1108 $this->acc_mail->reset();
1114 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_update'));
1117 $updateUser->read();
1118 $updateUser->readPrefs();
1119 if ($this->currPassword !=
null) {
1120 switch (strtoupper($this->currPasswordType)) {
1123 $updateUser->setPasswordEncodingType(
'bcryptphp');
1124 $updateUser->setPasswordSalt(
null);
1129 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1133 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1138 $updateUser->setFirstname($this->userObj->getFirstname());
1141 $updateUser->setLastname($this->userObj->getLastname());
1144 $updateUser->setUTitle($this->userObj->getUTitle());
1147 $updateUser->setGender($this->userObj->getGender());
1150 $updateUser->setEmail($this->userObj->getEmail());
1153 $updateUser->setSecondEmail($this->userObj->getSecondEmail());
1156 $updateUser->setBirthday($this->userObj->getBirthday());
1159 $updateUser->setInstitution($this->userObj->getInstitution());
1162 $updateUser->setStreet($this->userObj->getStreet());
1165 $updateUser->setCity($this->userObj->getCity());
1168 $updateUser->setZipcode($this->userObj->getZipcode());
1171 $updateUser->setCountry($this->userObj->getCountry());
1174 $updateUser->setSelectedCountry($this->userObj->getSelectedCountry());
1177 $updateUser->setPhoneOffice($this->userObj->getPhoneOffice());
1180 $updateUser->setPhoneHome($this->userObj->getPhoneHome());
1183 $updateUser->setPhoneMobile($this->userObj->getPhoneMobile());
1186 $updateUser->setFax($this->userObj->getFax());
1189 $updateUser->setHobby($this->userObj->getHobby());
1192 $updateUser->setGeneralInterests($this->userObj->getGeneralInterests());
1195 $updateUser->setOfferingHelp($this->userObj->getOfferingHelp());
1198 $updateUser->setLookingForHelp($this->userObj->getLookingForHelp());
1201 $updateUser->setComment($this->userObj->getComment());
1204 $updateUser->setDepartment($this->userObj->getDepartment());
1207 $updateUser->setMatriculation($this->userObj->getMatriculation());
1209 if (!is_null($this->currActive)) {
1210 $updateUser->setActive($this->currActive ===
'true', is_object($this->
user) ? $this->
user->getId() : 0);
1213 $updateUser->setClientIP($this->userObj->getClientIP());
1215 if ($this->time_limit_set) {
1216 $updateUser->setTimeLimitUnlimited($this->userObj->getTimeLimitUnlimited());
1219 $updateUser->setTimeLimitFrom($this->userObj->getTimeLimitFrom());
1222 $updateUser->setTimeLimitUntil($this->userObj->getTimeLimitUntil());
1225 $updateUser->setTimeLimitMessage($this->userObj->getTimeLimitMessage());
1228 $updateUser->setApproveDate($this->userObj->getApproveDate());
1231 $updateUser->setAgreeDate($this->userObj->getAgreeDate());
1234 $updateUser->setLanguage($this->userObj->getLanguage());
1237 $updateUser->setExternalAccount($this->userObj->getExternalAccount());
1241 #if (! is_null($this->userObj->getAuthMode())) $updateUser->setAuthMode($this->userObj->getAuthMode()); 1242 if ($this->auth_mode_set) {
1243 $updateUser->setAuthMode($this->userObj->getAuthMode());
1247 if ($this->time_limit_owner_set) {
1248 $updateUser->setTimeLimitOwner($this->userObj->getTimeLimitOwner());
1251 if (count($this->prefs)) {
1252 foreach ($this->prefs as $key => $value) {
1253 if ($key !==
'mail_incoming_type' &&
1254 $key !==
'mail_signature' &&
1255 $key !==
'mail_linebreak' 1257 $updateUser->setPref($key, $value);
1263 if ($this->updateLookAndSkin) {
1264 $updateUser->setPref(
'skin', $this->userObj->getPref(
'skin'));
1265 $updateUser->setPref(
'style', $this->userObj->getPref(
'style'));
1269 $updateUser->writePrefs();
1275 if (count($this->udf_data)) {
1276 $updateUser->setUserDefinedData($this->udf_data);
1280 $updateUser->setFullname();
1281 $updateUser->setTitle($updateUser->getFullname());
1282 $updateUser->setDescription($updateUser->getEmail());
1283 $updateUser->update();
1285 if (count($this->udf_data)) {
1287 foreach ($this->udf_data as $field => $value) {
1288 $udd->
set(
'f_' . $field, $value);
1294 if ($this->
tagContained(
'Login') && $this->user_id != -1) {
1296 $updateUser->updateLogin($this->userObj->getLogin());
1304 if (is_array($this->personalPicture)) {
1305 if (strlen($this->personalPicture[
'content'])) {
1307 if (preg_match(
'/.*(png|jpg|gif|jpeg)$/', $this->personalPicture[
'imagetype'], $matches)) {
1308 $extension = $matches[1];
1310 $tmp_name = $this->
saveTempImage($this->personalPicture[
'content'],
".{$extension}");
1311 if (strlen($tmp_name)) {
1321 foreach ($this->roles as $role_id => $role) {
1322 if (array_key_exists($role_id, $this->role_assign)) {
1323 switch ($role[
'action']) {
1325 $this->
assignToRole($updateUser, (
int) $this->role_assign[$role_id]);
1327 case 'AssignWithParents':
1331 $this->
detachFromRole($updateUser, (
int) $this->role_assign[$role_id]);
1341 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_delete'));
1344 $deleteUser->delete();
1376 $this->userObj->setGender($this->cdata);
1387 if (strtotime($birthday) !==
false) {
1388 $this->userObj->setBirthday($birthday);
1435 case 'GeneralInterest':
1436 case 'OfferingHelp':
1437 case 'LookingForHelp':
1449 case 'Matriculation':
1461 case 'TimeLimitOwner':
1462 $this->time_limit_owner_set =
true;
1463 $this->userObj->setTimeLimitOwner((
int) $this->cdata);
1466 case 'TimeLimitUnlimited':
1467 $this->time_limit_set =
true;
1468 $this->userObj->setTimeLimitUnlimited((
bool) $this->cdata);
1471 case 'TimeLimitFrom':
1472 if (is_numeric($this->cdata)) {
1474 $this->userObj->setTimeLimitFrom((
int) $this->cdata);
1478 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1479 $this->userObj->setTimeLimitFrom(
$timestamp);
1480 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1481 $this->userObj->setTimeLimitFrom(
null);
1486 case 'TimeLimitUntil':
1487 if (is_numeric($this->cdata)) {
1489 $this->userObj->setTimeLimitUntil((
int) $this->cdata);
1493 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1494 $this->userObj->setTimeLimitUntil(
$timestamp);
1495 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1496 $this->userObj->setTimeLimitUntil(
null);
1501 case 'TimeLimitMessage':
1502 $this->userObj->setTimeLimitMessage($this->cdata);
1506 $this->approve_date_set =
true;
1507 if (is_numeric($this->cdata)) {
1514 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1517 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1518 $this->userObj->setApproveDate(
null);
1524 if (is_numeric($this->cdata)) {
1531 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1534 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1535 $this->userObj->setAgreeDate(
null);
1540 case 'ExternalAccount':
1545 $this->updateLookAndSkin =
false;
1546 if ($this->skin !==
'' && $this->style !==
'') {
1547 if (is_array($this->userStyles)) {
1548 if (in_array($this->skin .
':' . $this->style, $this->userStyles)) {
1549 $this->userObj->setPref(
'skin', $this->skin);
1550 $this->userObj->setPref(
'style', $this->style);
1551 $this->updateLookAndSkin =
true;
1557 case 'UserDefinedField':
1560 $field_id = $udf->fetchFieldIdFromImportId($this->tmp_udf_id);
1562 if ($field_id === 0) {
1563 $field_id = $udf->fetchFieldIdFromName($this->tmp_udf_name);
1566 if ($field_id === 0) {
1574 if ($this->current_messenger_type ===
'external') {
1575 $this->userObj->setExternalAccount($this->cdata);
1579 if ($this->currentPrefKey !=
null && strlen(trim($this->cdata)) > 0
1583 $this->currentPrefKey =
null;
1597 $fh = fopen($tempname,
'wb');
1601 fwrite($fh, $image_data);
1613 $externalAccountHasChanged =
false;
1623 $this->userObj->setFullname();
1624 if ($this->user_id != -1 && ($this->action ===
'Update' || $this->action ===
'Delete')) {
1629 $user_exists = $user_id != 0;
1631 if (is_null($this->userObj->getLogin())) {
1632 $this->
logFailure(
'---', sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Login',
'Insert'));
1636 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_xml_anonymous_or_root_not_allowed'));
1640 switch ($this->action) {
1642 if ($user_exists and $this->conflict_rule === self::IL_FAIL_ON_CONFLICT) {
1643 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_insert'));
1645 if (is_null($this->userObj->getGender()) && $this->
isFieldRequired(
'gender')) {
1646 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Gender',
'Insert'));
1648 if (is_null($this->userObj->getFirstname())) {
1649 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Firstname',
'Insert'));
1651 if (is_null($this->userObj->getLastname())) {
1652 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Lastname',
'Insert'));
1654 if (count($this->roles) == 0) {
1655 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Role',
'Insert'));
1657 $has_global_role =
false;
1658 foreach ($this->roles as $role) {
1659 if ($role[
'type'] ===
'Global') {
1660 $has_global_role =
true;
1664 if (!$has_global_role) {
1665 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_global_role_for_action_required'),
'Insert'));
1670 if (!$user_exists) {
1671 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_update'));
1672 } elseif ($this->user_id != -1 && $this->
tagContained(
'Login')) {
1677 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_login_is_not_unique'));
1682 if (!$user_exists) {
1683 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_delete'));
1693 if (array_key_exists($this->cdata, $this->logins)) {
1694 $this->
logWarning($this->cdata, $this->
lng->txt(
'usrimport_login_is_not_unique'));
1698 $this->userObj->setLogin($this->
stripTags($this->cdata));
1702 switch ($this->currPasswordType) {
1705 $this->userObj->setPasswordEncodingType(
'bcryptphp');
1706 $this->userObj->setPasswordSalt(
null);
1711 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1715 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1721 $this->userObj->setFirstname($this->cdata);
1725 $this->userObj->setLastname($this->cdata);
1729 $this->userObj->setUTitle($this->cdata);
1733 if (!in_array(strtolower($this->cdata), [
'n',
'm',
'f',
''])) {
1735 $this->userObj->getLogin(),
1736 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'Gender', $this->
stripTags($this->cdata))
1739 $this->userObj->setGender($this->cdata);
1743 $this->userObj->setEmail($this->cdata);
1746 $this->userObj->setSecondEmail($this->cdata);
1749 $this->userObj->setInstitution($this->cdata);
1753 $this->userObj->setStreet($this->cdata);
1757 $this->userObj->setCity($this->cdata);
1761 $this->userObj->setZipcode($this->cdata);
1765 $this->userObj->setCountry($this->cdata);
1769 if (mb_strlen($this->cdata) !== 2) {
1771 $this->userObj->getLogin(),
1772 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'SelCountry', $this->
stripTags($this->cdata))
1775 $this->userObj->setSelectedCountry($this->cdata);
1779 $this->userObj->setPhoneOffice($this->cdata);
1783 $this->userObj->setPhoneHome($this->cdata);
1787 $this->userObj->setPhoneMobile($this->cdata);
1791 $this->userObj->setFax($this->cdata);
1795 $this->userObj->setHobby($this->cdata);
1798 case 'GeneralInterest':
1799 case 'OfferingHelp':
1800 case 'LookingForHelp':
1805 $this->userObj->setComment($this->cdata);
1809 $this->userObj->setDepartment($this->cdata);
1812 case 'Matriculation':
1813 $this->userObj->setMatriculation($this->cdata);
1816 case 'ExternalAccount':
1817 $am = ($this->userObj->getAuthMode() ===
'default' || $this->userObj->getAuthMode() ==
'')
1819 : $this->userObj->getAuthMode();
1820 $loginForExternalAccount = (trim($this->cdata) ==
'')
1823 switch ($this->action) {
1825 if ($loginForExternalAccount !=
'') {
1826 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_no_insert_ext_account_exists') .
' (' . $this->
stripTags($this->cdata) .
')');
1831 if ($loginForExternalAccount !=
'') {
1833 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->userObj->getLogin())) {
1835 $this->userObj->getLogin(),
1836 $this->
lng->txt(
'usrimport_no_update_ext_account_exists') .
' (' . $this->
stripTags($this->cdata) .
' for ' . $this->
stripTags($loginForExternalAccount) .
')' 1842 if ($externalAccountHasChanged) {
1843 $this->userObj->setExternalAccount(trim($this->cdata));
1848 if ($this->cdata !==
'true' 1849 && $this->cdata !==
'false') {
1851 $this->userObj->getLogin(),
1852 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'Active', $this->
stripTags($this->cdata))
1857 case 'TimeLimitOwner':
1858 if (!preg_match(
'/\d+/', $this->cdata)) {
1860 $this->userObj->getLogin(),
1861 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1863 } elseif (!$this->
access->checkAccess(
'cat_administrate_users',
'', (
int) $this->cdata)) {
1865 $this->userObj->getLogin(),
1866 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1868 } elseif ($this->object_data_cache->lookupType($this->object_data_cache->lookupObjId((
int) $this->cdata)) !==
'cat' && !(
int) $this->cdata ==
USER_FOLDER_ID) {
1870 $this->userObj->getLogin(),
1871 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1874 $this->userObj->setTimeLimitOwner((
int) $this->cdata);
1876 case 'TimeLimitUnlimited':
1877 switch (strtolower($this->cdata)) {
1880 $this->userObj->setTimeLimitUnlimited(
true);
1884 $this->userObj->setTimeLimitUnlimited(
false);
1887 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitUnlimited', $this->
stripTags($this->cdata)));
1891 case 'TimeLimitFrom':
1893 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata)) {
1894 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitFrom', $this->
stripTags($this->cdata)));
1896 $this->userObj->setTimeLimitFrom((
int) $this->cdata);
1898 case 'TimeLimitUntil':
1900 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata)) {
1901 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitUntil', $this->
stripTags($this->cdata)));
1903 $this->userObj->setTimeLimitUntil((
int) $this->cdata);
1905 case 'TimeLimitMessage':
1906 switch (strtolower($this->cdata)) {
1908 $this->userObj->setTimeLimitMessage(
'1');
1911 $this->userObj->setTimeLimitMessage(
'0');
1914 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitMessage', $this->
stripTags($this->cdata)));
1920 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata) && !$this->cdata ===
'0000-00-00 00:00:00') {
1921 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'ApproveDate', $this->
stripTags($this->cdata)));
1926 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata) && !$this->cdata ===
'0000-00-00 00:00:00') {
1927 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'AgreeDate', $this->
stripTags($this->cdata)));
1931 if ($this->currentPrefKey !=
null) {
1932 $this->
verifyPref($this->currentPrefKey, $this->cdata);
1945 if ($a_data !==
"\n") {
1946 $a_data = preg_replace(
'/\t+/',
' ', $a_data);
1949 if (strlen($a_data) > 0) {
1950 $this->cdata .= $a_data;
1974 if (!array_key_exists($aLogin, $this->protocol)) {
1975 $this->protocol[$aLogin] = [];
1978 $this->protocol[$aLogin][] = $aMessage;
1980 if ($this->error_level === self::IL_IMPORT_SUCCESS) {
1981 $this->error_level = self::IL_IMPORT_WARNING;
1992 if (!array_key_exists($aLogin, $this->protocol)) {
1993 $this->protocol[$aLogin] = [];
1996 $this->protocol[$aLogin][] = $aMessage;
1998 $this->error_level = self::IL_IMPORT_FAILURE;
2009 $this->user_mapping[$userid] = [
'login' => $aLogin,
'action' =>
$action,
'message' =>
'successful'];
2030 $block =
new ilTemplate(
'tpl.usr_import_log_block.html',
true,
true,
'components/ILIAS/User');
2031 $block->setVariable(
'TXT_LOG_TITLE', $a_log_title);
2032 $block->setVariable(
'TXT_MESSAGE_ID', $this->
lng->txt(
'login'));
2033 $block->setVariable(
'TXT_MESSAGE_TEXT', $this->
lng->txt(
'message'));
2035 $block->setCurrentBlock(
'log_row');
2038 if ($reason ==
'') {
2044 $block->setVariable(
'MESSAGE_ID', $login);
2045 $block->setVariable(
'MESSAGE_TEXT', $reason);
2046 $block->parseCurrentBlock();
2048 return $block->get();
2056 return $this->error_level === self::IL_IMPORT_SUCCESS;
2082 if ($this->req_send_mail !=
'' ||
2083 ($this->
isSendMail() && $this->userObj->getEmail() !=
'')) {
2084 $this->acc_mail->setUser($this->userObj);
2085 $this->acc_mail->send();
2091 $this->send_mail = $value;
2106 if ($value === self::IL_USER_MAPPING_ID || $value === self::IL_USER_MAPPING_LOGIN) {
2107 $this->mapping_mode = $value;
2109 die(
'wrong argument using methode setUserMappingMethod in ' . __FILE__);
2127 if (is_array($this->required_fields)) {
2130 foreach ($this->
settings->getAll() as $field => $value) {
2131 if (strpos($field,
'require_') === 0 && $value == 1) {
2132 $value = substr($field, 8);
2133 $this->required_fields[$value] = $value;
2136 return $this->required_fields ?: [];
2145 return $this->user_profile->isProfileIncomplete($user_obj);
2157 $fieldname = strtolower(trim($fieldname));
2158 return array_key_exists($fieldname, $requiredFields);
2164 case 'mail_linebreak':
2168 case 'ilPageEditor_HTMLMode':
2169 case 'ilPageEditor_JavaScript':
2170 case 'ilPageEditor_MediaMode':
2171 case 'tst_javascript':
2172 case 'tst_lastquestiontype':
2173 case 'tst_multiline_answers':
2174 case 'tst_use_previous_answers':
2175 case 'graphicalAnswerSetting':
2176 case 'priv_feed_pass':
2177 $this->
logFailure(
'---',
"Preference {$this->stripTags($key)} is not supported.");
2180 case 'public_country':
2181 case 'public_department':
2182 case 'public_email':
2183 case 'public_second_email':
2185 case 'public_hobby':
2186 case 'public_institution':
2187 case 'public_matriculation':
2188 case 'public_phone':
2189 case 'public_phone_home':
2190 case 'public_phone_mobile':
2191 case 'public_phone_office':
2192 case 'public_street':
2193 case 'public_upload':
2195 case 'public_interests_general':
2196 case 'public_interests_help_offered':
2197 case 'public_interests_help_looking':
2198 case 'send_info_mails':
2199 case 'bs_allow_to_contact_me':
2200 case 'chat_osc_accept_msg':
2201 case 'chat_broadcast_typing':
2202 case 'hide_own_online_status':
2203 if (!in_array($value, [
'y',
'n',
''])) {
2204 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y' or 'n' expected for preference {$this->stripTags($key)}.");
2207 case 'public_profile':
2208 if (!in_array($value, [
'y',
'n',
'g'])) {
2209 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y', 'g' or 'n' expected for preference {$this->stripTags($key)}.");
2212 case 'show_users_online':
2213 if (!in_array($value, [
'y',
'n',
'associated'])) {
2214 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y' or 'n' or 'associated' expected for preference {$this->stripTags($key)}.");
2217 case 'mail_incoming_type':
2218 if (!in_array((
int) $value, [
'0',
'1',
'2'])) {
2219 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value '0' (LOCAL),'1' (EMAIL) or '2' (BOTH) expected for preference {$this->stripTags($key)}.");
2223 if (!in_array($value, [
'0',
'1'])) {
2224 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value '0' (Sunday) or '1' (Monday) expected for preference {$this->stripTags($key)}.");
2228 case 'mail_signature':
2235 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Invalid timezone $value detected for preference {$this->stripTags($key)}.");
2240 $this->
logFailure(
'---',
"Preference {$this->stripTags($key)} is not supported.");
2248 if (array_key_exists(
'mail_incoming_type', $this->prefs) ||
2249 array_key_exists(
'mail_signature', $this->prefs) ||
2250 array_key_exists(
'mail_linebreak', $this->prefs)
2254 $mailOptions->setSignature(array_key_exists(
'mail_signature', $this->prefs) ? $this->prefs[
'mail_signature'] : $mailOptions->getSignature());
2255 $mailOptions->setIncomingType(array_key_exists(
'mail_incoming_type', $this->prefs) ? (
int) $this->prefs[
'mail_incoming_type'] : $mailOptions->getIncomingType());
2256 $mailOptions->updateOptions();
2267 return $this->
refinery->string()->stripTags()->transform($string);
bool $time_limit_owner_set
ilRecommendedContentManager $recommended_content_manager
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)
Interface Observer Contains several chained tasks and infos about them.
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getUserIdByLogin(string $a_login)
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.
Class ilObjForumAdministration.
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
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.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
buildTag(string $type, string $name, ?array $attr=null)
generate a tag with given name and attributes
array $protocol
The variable holds the protocol of the import.
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.