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);
504 $this->auth_mode_set =
true;
505 $this->userObj->setAuthMode($a_attribs[
'type']);
510 $this->userObj->getLogin(),
511 sprintf($this->
lng->txt(
'usrimport_xml_element_inapplicable'),
'AuthMode', $this->
stripTags($a_attribs[
'type']))
516 case 'UserDefinedField':
517 $this->tmp_udf_id = $a_attribs[
'Id'];
518 $this->tmp_udf_name = $a_attribs[
'Name'];
522 $this->current_messenger_type = strtolower($a_attribs[
'Type']);
525 $this->userObj->setLatitude($a_attribs[
'latitude']);
526 $this->userObj->setLongitude($a_attribs[
'longitude']);
527 $this->userObj->setLocationZoom($a_attribs[
'zoom']);
530 $this->currentPrefKey = $a_attribs[
'key'];
545 if ($a_attribs[
'Id'] ==
'') {
546 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_missing'),
'Role',
'Id'));
548 $this->current_role_id = $a_attribs[
'Id'];
549 $this->current_role_type = $a_attribs[
'Type'];
550 if ($this->current_role_type !==
'Global' 551 && $this->current_role_type !==
'Local') {
552 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_missing'),
'Role',
'Type'));
554 $this->current_role_action = (!isset($a_attribs[
'Action'])) ?
'Assign' : $a_attribs[
'Action'];
555 if ($this->current_role_action !==
'Assign' 556 && $this->current_role_action !==
'AssignWithParents' 557 && $this->current_role_action !==
'Detach') {
558 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Role',
'Action', $this->
stripTags($a_attribs[
'Action'])));
560 if ($this->action ===
'Insert' 561 && $this->current_role_action ===
'Detach') {
562 $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)));
564 if ($this->action ===
'Delete') {
565 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_inapplicable'),
'Role',
'Delete'));
571 $this->containedTags = [];
573 $this->userObj->setLanguage($a_attribs[
'Language'] ??
'');
574 $this->userObj->setImportId($a_attribs[
'Id'] ??
'');
575 $this->currentPrefKey =
null;
579 if (isset($a_attribs[
'Id']) && $this->
getUserMappingMode() === self::IL_USER_MAPPING_ID) {
580 if (is_numeric($a_attribs[
'Id'])) {
581 $this->user_id = (
int) $a_attribs[
'Id'];
583 $this->user_id =
$id;
587 $this->action = !isset($a_attribs[
'Action']) ?
'Insert' : $a_attribs[
'Action'];
588 if ($this->action !==
'Insert' 589 && $this->action !==
'Update' 590 && $this->action !==
'Delete') {
591 $this->
logFailure($this->userObj->getImportId(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'User',
'Action', $this->
stripTags($a_attribs[
'Action'])));
593 $this->currPassword =
null;
594 $this->currPasswordType =
null;
598 $this->currPasswordType = $a_attribs[
'Type'];
601 if (array_key_exists(
'type', $a_attribs)) {
602 switch ($a_attribs[
'type']) {
605 if (strcmp(
'saml', $a_attribs[
'type']) === 0) {
607 if (count($list) !== 1) {
609 $this->userObj->getImportId(),
610 sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type', $this->
stripTags($a_attribs[
'type']))
615 if (strcmp(
'ldap', $a_attribs[
'type']) === 0) {
618 if (count($list) != 1) {
620 $this->userObj->getImportId(),
621 sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type', $this->
stripTags($a_attribs[
'type']))
635 $this->userObj->setAuthMode($a_attribs[
'type']);
639 $this->
logFailure($this->userObj->getImportId(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'AuthMode',
'type',
''));
643 $this->currentPrefKey = $a_attribs[
'key'];
652 switch ($this->mode) {
653 case self::IL_EXTRACT_ROLES:
656 case self::IL_USER_IMPORT:
659 case self::IL_VERIFY:
686 if (array_key_exists($a_role_id, $this->localRoleCache)) {
687 return $this->localRoleCache[$a_role_id];
689 $role_obj =
new ilObjRole($a_role_id,
false);
691 $this->localRoleCache[$a_role_id] = $role_obj;
701 if (array_key_exists($a_role_id .
'_courseMembersObject', $this->localRoleCache)) {
702 return $this->localRoleCache[$a_role_id .
'_courseMembersObject'];
704 $course_refs = $this->rbac_review->getFoldersAssignedToRole($a_role_id,
true);
705 $course_ref = $course_refs[0];
708 $this->localRoleCache[$a_role_id .
'_courseMembersObject'] = $crsmembers_obj;
709 return $crsmembers_obj;
722 if ($this->rbac_review->isAssigned($a_user_obj->
getId(), $a_role_id)) {
729 $this->rbac_admin->assignUser($a_role_id, $a_user_obj->
getId(),
true);
730 $obj_id = $this->rbac_review->getObjectOfRole($a_role_id);
735 $ref_id = current((array) $ref_ids);
754 if (!array_key_exists($a_role_id, $this->parentRolesCache)) {
755 $parent_role_ids = [];
758 $short_role_title = substr($role_obj->getTitle(), 0, 12);
759 $folders = $this->rbac_review->getFoldersAssignedToRole($a_role_id,
true);
760 if (count($folders) > 0) {
761 $all_parent_role_ids = $this->rbac_review->getParentRoleIds($folders[0]);
762 foreach ($all_parent_role_ids as $parent_role_id => $parent_role_data) {
763 if ($parent_role_id != $a_role_id) {
764 switch (substr($parent_role_data[
'title'], 0, 12)) {
767 if ($short_role_title ===
'il_crs_admin' || $short_role_title ===
'il_grp_admin') {
768 $parent_role_ids[] = $parent_role_id;
773 if ($short_role_title ===
'il_crs_tutor' || $short_role_title ===
'il_grp_tutor') {
774 $parent_role_ids[] = $parent_role_id;
779 if ($short_role_title ===
'il_crs_membe' || $short_role_title ===
'il_grp_membe') {
780 $parent_role_ids[] = $parent_role_id;
789 $this->parentRolesCache[$a_role_id] = $parent_role_ids;
791 return $this->parentRolesCache[$a_role_id];
804 foreach ($parent_role_ids as $parent_role_id) {
816 $this->rbac_admin->deassignUser($a_role_id, $a_user_obj->
getId());
824 $this->rbac_review->getObjectOfRole($a_role_id)
830 $this->recommended_content_manager->removeObjectRecommendation($a_user_obj->
getId(),
$ref_id);
835 return in_array($tagname, $this->containedTags,
true);
845 $this->containedTags[] = $a_name;
854 case 'PersonalPicture':
855 switch ($this->personalPicture[
'encoding']) {
857 $this->personalPicture[
'content'] = base64_decode($this->cdata);
860 $this->personalPicture[
'content'] = convert_uudecode($this->cdata);
866 $this->userObj->setFullname();
869 if ($this->user_id == -1 || $this->action ===
'Insert') {
880 switch ($this->conflict_rule) {
881 case self::IL_FAIL_ON_CONFLICT:
884 case self::IL_UPDATE_ON_CONFLICT:
885 switch ($this->action) {
888 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_replaced'),
'Insert',
'Update'));
889 $this->action =
'Update';
894 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_replaced'),
'Update',
'Insert'));
895 $this->action =
'Insert';
900 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Delete'));
901 $this->action =
'Ignore';
906 case self::IL_IGNORE_ON_CONFLICT:
907 switch ($this->action) {
910 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Insert'));
911 $this->action =
'Ignore';
916 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Update'));
917 $this->action =
'Ignore';
922 $this->
logWarning($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_action_ignored'),
'Delete'));
923 $this->action =
'Ignore';
934 $am = ($this->userObj->getAuthMode() ===
'default' || $this->userObj->getAuthMode() ==
'')
936 : $this->userObj->getAuthMode();
937 $loginForExternalAccount = ($this->userObj->getExternalAccount() ==
'')
940 switch ($this->action) {
942 if ($loginForExternalAccount !=
'') {
944 $this->userObj->getLogin(),
945 $this->
lng->txt(
'usrimport_no_insert_ext_account_exists')
946 .
' (' . $this->
stripTags($this->userObj->getExternalAccount()) .
')' 948 $this->action =
'Ignore';
957 if ($loginForExternalAccount !=
'') {
961 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->userObj->getLogin())) {
963 $this->userObj->getLogin(),
964 $this->
lng->txt(
'usrimport_no_update_ext_account_exists')
965 .
' (' . $this->
stripTags($this->userObj->getExternalAccount()) .
')' 967 $this->action =
'Ignore';
973 if (count($this->multi_values)) {
974 if (isset($this->multi_values[
'GeneralInterest'])) {
975 $this->userObj->setGeneralInterests($this->multi_values[
'GeneralInterest']);
977 if (isset($this->multi_values[
'OfferingHelp'])) {
978 $this->userObj->setOfferingHelp($this->multi_values[
'OfferingHelp']);
980 if (isset($this->multi_values[
'LookingForHelp'])) {
981 $this->userObj->setLookingForHelp($this->multi_values[
'LookingForHelp']);
986 switch ($this->action) {
989 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_insert'));
991 if ($this->currPassword !==
null) {
992 switch (strtoupper($this->currPasswordType)) {
995 $this->userObj->setPasswordEncodingType(
'bcryptphp');
996 $this->userObj->setPasswordSalt(
null);
1001 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1005 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1016 $this->userObj->setTitle($this->userObj->getFullname());
1017 $this->userObj->setDescription($this->userObj->getEmail());
1019 if (!$this->time_limit_owner_set) {
1020 $this->userObj->setTimeLimitOwner($this->
getFolderId());
1024 if (!$this->time_limit_set) {
1025 $this->userObj->setTimeLimitUnlimited(
true);
1026 $this->userObj->setTimeLimitMessage(
'');
1028 if (!$this->approve_date_set) {
1029 $this->userObj->setApproveDate(date(
'Y-m-d H:i:s'));
1034 $this->userObj->setActive($this->currActive ===
'true' || is_null($this->currActive));
1040 if (count($this->udf_data)) {
1041 $this->userObj->setUserDefinedData($this->udf_data);
1044 if (!$this->userObj->getLanguage()) {
1045 $this->userObj->setLanguage($this->
lng->getDefaultLanguage());
1049 $this->userObj->create();
1052 $this->userObj->saveAsNew();
1054 if (count($this->prefs)) {
1055 foreach ($this->prefs as $key => $value) {
1056 if ($key !==
'mail_incoming_type' &&
1057 $key !==
'mail_signature' &&
1058 $key !==
'mail_linebreak' 1060 $this->userObj->setPref($key, $value);
1065 if (!is_array($this->prefs) || !array_key_exists(
'chat_osc_accept_msg', $this->prefs)) {
1066 $this->userObj->setPref(
'chat_osc_accept_msg', $this->
settings->get(
'chat_osc_accept_msg',
'n'));
1068 if (!is_array($this->prefs) || !array_key_exists(
'chat_broadcast_typing', $this->prefs)) {
1069 $this->userObj->setPref(
'chat_broadcast_typing', $this->
settings->get(
'chat_broadcast_typing',
'n'));
1071 if (!is_array($this->prefs) || !array_key_exists(
'bs_allow_to_contact_me', $this->prefs)) {
1072 $this->userObj->setPref(
'bs_allow_to_contact_me', $this->
settings->get(
'bs_allow_to_contact_me',
'n'));
1075 $this->userObj->writePrefs();
1080 if (is_array($this->personalPicture)) {
1081 if (strlen($this->personalPicture[
'content'])) {
1083 if (preg_match(
'/.*(png|jpg|gif|jpeg)$/', $this->personalPicture[
'imagetype'], $matches)) {
1084 $extension = $matches[1];
1086 $tmp_name = $this->
saveTempImage($this->personalPicture[
'content'],
".{$extension}");
1087 if (strlen($tmp_name)) {
1095 foreach ($this->roles as $role_id => $role) {
1096 if (isset($this->role_assign[$role_id]) && $this->role_assign[$role_id]) {
1097 $this->
assignToRole($this->userObj, (
int) $this->role_assign[$role_id]);
1101 if (count($this->udf_data)) {
1103 foreach ($this->udf_data as $field => $value) {
1104 $udd->
set(
'f_' . $field, $value);
1110 $this->
logSuccess($this->userObj->getLogin(), $this->userObj->getId(),
'Insert');
1112 $this->acc_mail->reset();
1118 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_update'));
1121 $updateUser->read();
1122 $updateUser->readPrefs();
1123 if ($this->currPassword !=
null) {
1124 switch (strtoupper($this->currPasswordType)) {
1127 $updateUser->setPasswordEncodingType(
'bcryptphp');
1128 $updateUser->setPasswordSalt(
null);
1133 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1137 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1142 $updateUser->setFirstname($this->userObj->getFirstname());
1145 $updateUser->setLastname($this->userObj->getLastname());
1148 $updateUser->setUTitle($this->userObj->getUTitle());
1151 $updateUser->setGender($this->userObj->getGender());
1154 $updateUser->setEmail($this->userObj->getEmail());
1157 $updateUser->setSecondEmail($this->userObj->getSecondEmail());
1160 $updateUser->setBirthday($this->userObj->getBirthday());
1163 $updateUser->setInstitution($this->userObj->getInstitution());
1166 $updateUser->setStreet($this->userObj->getStreet());
1169 $updateUser->setCity($this->userObj->getCity());
1172 $updateUser->setZipcode($this->userObj->getZipcode());
1175 $updateUser->setCountry($this->userObj->getCountry());
1178 $updateUser->setSelectedCountry($this->userObj->getSelectedCountry());
1181 $updateUser->setPhoneOffice($this->userObj->getPhoneOffice());
1184 $updateUser->setPhoneHome($this->userObj->getPhoneHome());
1187 $updateUser->setPhoneMobile($this->userObj->getPhoneMobile());
1190 $updateUser->setFax($this->userObj->getFax());
1193 $updateUser->setHobby($this->userObj->getHobby());
1196 $updateUser->setGeneralInterests($this->userObj->getGeneralInterests());
1199 $updateUser->setOfferingHelp($this->userObj->getOfferingHelp());
1202 $updateUser->setLookingForHelp($this->userObj->getLookingForHelp());
1205 $updateUser->setComment($this->userObj->getComment());
1208 $updateUser->setDepartment($this->userObj->getDepartment());
1211 $updateUser->setMatriculation($this->userObj->getMatriculation());
1213 if (!is_null($this->currActive)) {
1214 $updateUser->setActive($this->currActive ===
'true', is_object($this->
user) ? $this->
user->getId() : 0);
1217 $updateUser->setClientIP($this->userObj->getClientIP());
1219 if ($this->time_limit_set) {
1220 $updateUser->setTimeLimitUnlimited($this->userObj->getTimeLimitUnlimited());
1223 $updateUser->setTimeLimitFrom($this->userObj->getTimeLimitFrom());
1226 $updateUser->setTimeLimitUntil($this->userObj->getTimeLimitUntil());
1229 $updateUser->setTimeLimitMessage($this->userObj->getTimeLimitMessage());
1232 $updateUser->setApproveDate($this->userObj->getApproveDate());
1235 $updateUser->setAgreeDate($this->userObj->getAgreeDate());
1238 $updateUser->setLanguage($this->userObj->getLanguage());
1241 $updateUser->setExternalAccount($this->userObj->getExternalAccount());
1245 #if (! is_null($this->userObj->getAuthMode())) $updateUser->setAuthMode($this->userObj->getAuthMode()); 1246 if ($this->auth_mode_set) {
1247 $updateUser->setAuthMode($this->userObj->getAuthMode());
1251 if ($this->time_limit_owner_set) {
1252 $updateUser->setTimeLimitOwner($this->userObj->getTimeLimitOwner());
1255 if (count($this->prefs)) {
1256 foreach ($this->prefs as $key => $value) {
1257 if ($key !==
'mail_incoming_type' &&
1258 $key !==
'mail_signature' &&
1259 $key !==
'mail_linebreak' 1261 $updateUser->setPref($key, $value);
1267 if ($this->updateLookAndSkin) {
1268 $updateUser->setPref(
'skin', $this->userObj->getPref(
'skin'));
1269 $updateUser->setPref(
'style', $this->userObj->getPref(
'style'));
1273 $updateUser->writePrefs();
1279 if (count($this->udf_data)) {
1280 $updateUser->setUserDefinedData($this->udf_data);
1284 $updateUser->setFullname();
1285 $updateUser->setTitle($updateUser->getFullname());
1286 $updateUser->setDescription($updateUser->getEmail());
1287 $updateUser->update();
1289 if (count($this->udf_data)) {
1291 foreach ($this->udf_data as $field => $value) {
1292 $udd->
set(
'f_' . $field, $value);
1298 if ($this->
tagContained(
'Login') && $this->user_id != -1) {
1300 $updateUser->updateLogin($this->userObj->getLogin());
1308 if (is_array($this->personalPicture)) {
1309 if (strlen($this->personalPicture[
'content'])) {
1311 if (preg_match(
'/.*(png|jpg|gif|jpeg)$/', $this->personalPicture[
'imagetype'], $matches)) {
1312 $extension = $matches[1];
1314 $tmp_name = $this->
saveTempImage($this->personalPicture[
'content'],
".{$extension}");
1315 if (strlen($tmp_name)) {
1325 foreach ($this->roles as $role_id => $role) {
1326 if (array_key_exists($role_id, $this->role_assign)) {
1327 switch ($role[
'action']) {
1329 $this->
assignToRole($updateUser, (
int) $this->role_assign[$role_id]);
1331 case 'AssignWithParents':
1335 $this->
detachFromRole($updateUser, (
int) $this->role_assign[$role_id]);
1345 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_delete'));
1348 $deleteUser->delete();
1380 $this->userObj->setGender($this->cdata);
1391 if (strtotime($birthday) !==
false) {
1392 $this->userObj->setBirthday($birthday);
1439 case 'GeneralInterest':
1440 case 'OfferingHelp':
1441 case 'LookingForHelp':
1453 case 'Matriculation':
1465 case 'TimeLimitOwner':
1466 $this->time_limit_owner_set =
true;
1467 $this->userObj->setTimeLimitOwner((
int) $this->cdata);
1470 case 'TimeLimitUnlimited':
1471 $this->time_limit_set =
true;
1472 $this->userObj->setTimeLimitUnlimited((
bool) $this->cdata);
1475 case 'TimeLimitFrom':
1476 if (is_numeric($this->cdata)) {
1478 $this->userObj->setTimeLimitFrom((
int) $this->cdata);
1482 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1483 $this->userObj->setTimeLimitFrom(
$timestamp);
1484 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1485 $this->userObj->setTimeLimitFrom(
null);
1490 case 'TimeLimitUntil':
1491 if (is_numeric($this->cdata)) {
1493 $this->userObj->setTimeLimitUntil((
int) $this->cdata);
1497 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1498 $this->userObj->setTimeLimitUntil(
$timestamp);
1499 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1500 $this->userObj->setTimeLimitUntil(
null);
1505 case 'TimeLimitMessage':
1506 $this->userObj->setTimeLimitMessage($this->cdata);
1510 $this->approve_date_set =
true;
1511 if (is_numeric($this->cdata)) {
1518 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1521 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1522 $this->userObj->setApproveDate(
null);
1528 if (is_numeric($this->cdata)) {
1535 if (
$timestamp !==
false && trim($this->cdata) !==
'0000-00-00 00:00:00') {
1538 } elseif ($this->cdata ===
'0000-00-00 00:00:00') {
1539 $this->userObj->setAgreeDate(
null);
1544 case 'ExternalAccount':
1549 $this->updateLookAndSkin =
false;
1550 if ($this->skin !==
'' && $this->style !==
'') {
1551 if (is_array($this->userStyles)) {
1552 if (in_array($this->skin .
':' . $this->style, $this->userStyles)) {
1553 $this->userObj->setPref(
'skin', $this->skin);
1554 $this->userObj->setPref(
'style', $this->style);
1555 $this->updateLookAndSkin =
true;
1561 case 'UserDefinedField':
1564 $field_id = $udf->fetchFieldIdFromImportId($this->tmp_udf_id);
1566 if ($field_id === 0) {
1567 $field_id = $udf->fetchFieldIdFromName($this->tmp_udf_name);
1570 if ($field_id === 0) {
1578 if ($this->current_messenger_type ===
'external') {
1579 $this->userObj->setExternalAccount($this->cdata);
1583 if ($this->currentPrefKey !=
null && strlen(trim($this->cdata)) > 0
1587 $this->currentPrefKey =
null;
1601 $fh = fopen($tempname,
'wb');
1605 fwrite($fh, $image_data);
1617 $externalAccountHasChanged =
false;
1627 $this->userObj->setFullname();
1628 if ($this->user_id != -1 && ($this->action ===
'Update' || $this->action ===
'Delete')) {
1633 $user_exists = $user_id != 0;
1635 if (is_null($this->userObj->getLogin())) {
1636 $this->
logFailure(
'---', sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Login',
'Insert'));
1640 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_xml_anonymous_or_root_not_allowed'));
1644 switch ($this->action) {
1646 if ($user_exists and $this->conflict_rule === self::IL_FAIL_ON_CONFLICT) {
1647 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_insert'));
1649 if (is_null($this->userObj->getGender()) && $this->
isFieldRequired(
'gender')) {
1650 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Gender',
'Insert'));
1652 if (is_null($this->userObj->getFirstname())) {
1653 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Firstname',
'Insert'));
1655 if (is_null($this->userObj->getLastname())) {
1656 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Lastname',
'Insert'));
1658 if (count($this->roles) == 0) {
1659 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_for_action_required'),
'Role',
'Insert'));
1661 $has_global_role =
false;
1662 foreach ($this->roles as $role) {
1663 if ($role[
'type'] ===
'Global') {
1664 $has_global_role =
true;
1668 if (!$has_global_role) {
1669 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_global_role_for_action_required'),
'Insert'));
1674 if (!$user_exists) {
1675 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_update'));
1676 } elseif ($this->user_id != -1 && $this->
tagContained(
'Login')) {
1681 $this->
logFailure($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_login_is_not_unique'));
1686 if (!$user_exists) {
1687 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_cant_delete'));
1697 if (array_key_exists($this->cdata, $this->logins)) {
1698 $this->
logWarning($this->cdata, $this->
lng->txt(
'usrimport_login_is_not_unique'));
1702 $this->userObj->setLogin($this->
stripTags($this->cdata));
1706 switch ($this->currPasswordType) {
1709 $this->userObj->setPasswordEncodingType(
'bcryptphp');
1710 $this->userObj->setPasswordSalt(
null);
1715 $this->acc_mail->setUserPassword((
string) $this->currPassword);
1719 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_attribute_value_illegal'),
'Type',
'Password', $this->
stripTags($this->currPasswordType)));
1725 $this->userObj->setFirstname($this->cdata);
1729 $this->userObj->setLastname($this->cdata);
1733 $this->userObj->setUTitle($this->cdata);
1737 if (!in_array(strtolower($this->cdata), [
'n',
'm',
'f',
''])) {
1739 $this->userObj->getLogin(),
1740 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'Gender', $this->
stripTags($this->cdata))
1743 $this->userObj->setGender($this->cdata);
1747 $this->userObj->setEmail($this->cdata);
1750 $this->userObj->setSecondEmail($this->cdata);
1753 $this->userObj->setInstitution($this->cdata);
1757 $this->userObj->setStreet($this->cdata);
1761 $this->userObj->setCity($this->cdata);
1765 $this->userObj->setZipcode($this->cdata);
1769 $this->userObj->setCountry($this->cdata);
1773 if (mb_strlen($this->cdata) !== 2) {
1775 $this->userObj->getLogin(),
1776 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'SelCountry', $this->
stripTags($this->cdata))
1779 $this->userObj->setSelectedCountry($this->cdata);
1783 $this->userObj->setPhoneOffice($this->cdata);
1787 $this->userObj->setPhoneHome($this->cdata);
1791 $this->userObj->setPhoneMobile($this->cdata);
1795 $this->userObj->setFax($this->cdata);
1799 $this->userObj->setHobby($this->cdata);
1802 case 'GeneralInterest':
1803 case 'OfferingHelp':
1804 case 'LookingForHelp':
1809 $this->userObj->setComment($this->cdata);
1813 $this->userObj->setDepartment($this->cdata);
1816 case 'Matriculation':
1817 $this->userObj->setMatriculation($this->cdata);
1820 case 'ExternalAccount':
1821 $am = ($this->userObj->getAuthMode() ===
'default' || $this->userObj->getAuthMode() ==
'')
1823 : $this->userObj->getAuthMode();
1824 $loginForExternalAccount = (trim($this->cdata) ==
'')
1827 switch ($this->action) {
1829 if ($loginForExternalAccount !=
'') {
1830 $this->
logWarning($this->userObj->getLogin(), $this->
lng->txt(
'usrimport_no_insert_ext_account_exists') .
' (' . $this->
stripTags($this->cdata) .
')');
1835 if ($loginForExternalAccount !=
'') {
1837 if ($externalAccountHasChanged && trim($loginForExternalAccount) != trim($this->userObj->getLogin())) {
1839 $this->userObj->getLogin(),
1840 $this->
lng->txt(
'usrimport_no_update_ext_account_exists') .
' (' . $this->
stripTags($this->cdata) .
' for ' . $this->
stripTags($loginForExternalAccount) .
')' 1846 if ($externalAccountHasChanged) {
1847 $this->userObj->setExternalAccount(trim($this->cdata));
1852 if ($this->cdata !==
'true' 1853 && $this->cdata !==
'false') {
1855 $this->userObj->getLogin(),
1856 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'Active', $this->
stripTags($this->cdata))
1861 case 'TimeLimitOwner':
1862 if (!preg_match(
'/\d+/', $this->cdata)) {
1864 $this->userObj->getLogin(),
1865 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1867 } elseif (!$this->
access->checkAccess(
'cat_administrate_users',
'', (
int) $this->cdata)) {
1869 $this->userObj->getLogin(),
1870 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1872 } elseif ($this->object_data_cache->lookupType($this->object_data_cache->lookupObjId((
int) $this->cdata)) !==
'cat' && !(
int) $this->cdata ==
USER_FOLDER_ID) {
1874 $this->userObj->getLogin(),
1875 sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitOwner', $this->
stripTags($this->cdata))
1878 $this->userObj->setTimeLimitOwner((
int) $this->cdata);
1880 case 'TimeLimitUnlimited':
1881 switch (strtolower($this->cdata)) {
1884 $this->userObj->setTimeLimitUnlimited(
true);
1888 $this->userObj->setTimeLimitUnlimited(
false);
1891 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitUnlimited', $this->
stripTags($this->cdata)));
1895 case 'TimeLimitFrom':
1897 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata)) {
1898 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitFrom', $this->
stripTags($this->cdata)));
1900 $this->userObj->setTimeLimitFrom((
int) $this->cdata);
1902 case 'TimeLimitUntil':
1904 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata)) {
1905 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitUntil', $this->
stripTags($this->cdata)));
1907 $this->userObj->setTimeLimitUntil((
int) $this->cdata);
1909 case 'TimeLimitMessage':
1910 switch (strtolower($this->cdata)) {
1912 $this->userObj->setTimeLimitMessage(
'1');
1915 $this->userObj->setTimeLimitMessage(
'0');
1918 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'TimeLimitMessage', $this->
stripTags($this->cdata)));
1924 if (strtotime($this->cdata) ===
false && !is_numeric($this->cdata) && !$this->cdata ===
'0000-00-00 00:00:00') {
1925 $this->
logFailure($this->userObj->getLogin(), sprintf($this->
lng->txt(
'usrimport_xml_element_content_illegal'),
'ApproveDate', $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'),
'AgreeDate', $this->
stripTags($this->cdata)));
1935 if ($this->currentPrefKey !=
null) {
1936 $this->
verifyPref($this->currentPrefKey, $this->cdata);
1949 if ($a_data !==
"\n") {
1950 $a_data = preg_replace(
'/\t+/',
' ', $a_data);
1953 if (strlen($a_data) > 0) {
1954 $this->cdata .= $a_data;
1978 if (!array_key_exists($aLogin, $this->protocol)) {
1979 $this->protocol[$aLogin] = [];
1982 $this->protocol[$aLogin][] = $aMessage;
1984 if ($this->error_level === self::IL_IMPORT_SUCCESS) {
1985 $this->error_level = self::IL_IMPORT_WARNING;
1996 if (!array_key_exists($aLogin, $this->protocol)) {
1997 $this->protocol[$aLogin] = [];
2000 $this->protocol[$aLogin][] = $aMessage;
2002 $this->error_level = self::IL_IMPORT_FAILURE;
2013 $this->user_mapping[$userid] = [
'login' => $aLogin,
'action' =>
$action,
'message' =>
'successful'];
2034 $block =
new ilTemplate(
'tpl.usr_import_log_block.html',
true,
true,
'components/ILIAS/User');
2035 $block->setVariable(
'TXT_LOG_TITLE', $a_log_title);
2036 $block->setVariable(
'TXT_MESSAGE_ID', $this->
lng->txt(
'login'));
2037 $block->setVariable(
'TXT_MESSAGE_TEXT', $this->
lng->txt(
'message'));
2039 $block->setCurrentBlock(
'log_row');
2042 if ($reason ==
'') {
2048 $block->setVariable(
'MESSAGE_ID', $login);
2049 $block->setVariable(
'MESSAGE_TEXT', $reason);
2050 $block->parseCurrentBlock();
2052 return $block->get();
2060 return $this->error_level === self::IL_IMPORT_SUCCESS;
2086 if ($this->req_send_mail !=
'' ||
2087 ($this->
isSendMail() && $this->userObj->getEmail() !=
'')) {
2088 $this->acc_mail->setUser($this->userObj);
2089 $this->acc_mail->send();
2095 $this->send_mail = $value;
2110 if ($value === self::IL_USER_MAPPING_ID || $value === self::IL_USER_MAPPING_LOGIN) {
2111 $this->mapping_mode = $value;
2113 die(
'wrong argument using methode setUserMappingMethod in ' . __FILE__);
2131 if (is_array($this->required_fields)) {
2134 foreach ($this->
settings->getAll() as $field => $value) {
2135 if (strpos($field,
'require_') === 0 && $value == 1) {
2136 $value = substr($field, 8);
2137 $this->required_fields[$value] = $value;
2140 return $this->required_fields ?: [];
2149 return $this->user_profile->isProfileIncomplete($user_obj);
2161 $fieldname = strtolower(trim($fieldname));
2162 return array_key_exists($fieldname, $requiredFields);
2168 case 'mail_linebreak':
2172 case 'ilPageEditor_HTMLMode':
2173 case 'ilPageEditor_JavaScript':
2174 case 'ilPageEditor_MediaMode':
2175 case 'tst_javascript':
2176 case 'tst_lastquestiontype':
2177 case 'tst_multiline_answers':
2178 case 'tst_use_previous_answers':
2179 case 'graphicalAnswerSetting':
2180 case 'priv_feed_pass':
2181 $this->
logFailure(
'---',
"Preference {$this->stripTags($key)} is not supported.");
2184 case 'public_country':
2185 case 'public_department':
2186 case 'public_email':
2187 case 'public_second_email':
2189 case 'public_hobby':
2190 case 'public_institution':
2191 case 'public_matriculation':
2192 case 'public_phone':
2193 case 'public_phone_home':
2194 case 'public_phone_mobile':
2195 case 'public_phone_office':
2196 case 'public_street':
2197 case 'public_upload':
2199 case 'public_interests_general':
2200 case 'public_interests_help_offered':
2201 case 'public_interests_help_looking':
2202 case 'send_info_mails':
2203 case 'bs_allow_to_contact_me':
2204 case 'chat_osc_accept_msg':
2205 case 'chat_broadcast_typing':
2206 case 'hide_own_online_status':
2207 if (!in_array($value, [
'y',
'n',
''])) {
2208 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y' or 'n' expected for preference {$this->stripTags($key)}.");
2211 case 'public_profile':
2212 if (!in_array($value, [
'y',
'n',
'g'])) {
2213 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y', 'g' or 'n' expected for preference {$this->stripTags($key)}.");
2216 case 'show_users_online':
2217 if (!in_array($value, [
'y',
'n',
'associated'])) {
2218 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value 'y' or 'n' or 'associated' expected for preference {$this->stripTags($key)}.");
2221 case 'mail_incoming_type':
2222 if (!in_array((
int) $value, [
'0',
'1',
'2'])) {
2223 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value '0' (LOCAL),'1' (EMAIL) or '2' (BOTH) expected for preference {$this->stripTags($key)}.");
2227 if (!in_array($value, [
'0',
'1'])) {
2228 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Value '0' (Sunday) or '1' (Monday) expected for preference {$this->stripTags($key)}.");
2232 case 'mail_signature':
2239 $this->
logFailure(
'---',
"Wrong value '{$this->stripTags($value)}': Invalid timezone $value detected for preference {$this->stripTags($key)}.");
2244 $this->
logFailure(
'---',
"Preference {$this->stripTags($key)} is not supported.");
2252 if (array_key_exists(
'mail_incoming_type', $this->prefs) ||
2253 array_key_exists(
'mail_signature', $this->prefs) ||
2254 array_key_exists(
'mail_linebreak', $this->prefs)
2258 $mailOptions->setSignature(array_key_exists(
'mail_signature', $this->prefs) ? $this->prefs[
'mail_signature'] : $mailOptions->getSignature());
2259 $mailOptions->setIncomingType(array_key_exists(
'mail_incoming_type', $this->prefs) ? (
int) $this->prefs[
'mail_incoming_type'] : $mailOptions->getIncomingType());
2260 $mailOptions->updateOptions();
2271 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 _getUsedHTMLTags(string $module='')
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.
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.