19declare(strict_types=1);
68 private readonly \ILIAS\HTTP\GlobalHttpState
$http;
77 $this->
ctrl = $DIC->ctrl();
78 $this->tabs_gui =
$DIC->tabs();
79 $this->
lng = $DIC->language();
80 $this->
lng->loadLanguageModule(
'ldap');
81 $this->
lng->loadLanguageModule(
'ui');
82 $this->ilErr =
$DIC[
'ilErr'];
84 $this->component_repository =
$DIC[
'component.repository'];
85 $this->rbacReview =
$DIC->rbac()->review();
86 $this->rbacSystem =
$DIC->rbac()->system();
87 $this->
toolbar = $DIC->toolbar();
88 $this->main_tpl =
$DIC->ui()->mainTemplate();
89 $this->
http = $DIC->http();
90 $this->ui_factory =
$DIC->ui()->factory();
91 $this->ui_renderer =
$DIC->ui()->renderer();
93 $this->object_data_cache =
$DIC[
'ilObjDataCache'];
94 $this->
profile = $DIC[
'user']->getProfile();
96 $this->tpl =
$DIC->ui()->mainTemplate();
98 $http_wrapper =
$DIC->http()->wrapper();
99 $is_post_request =
$DIC->http()->request()->getMethod() ===
'POST';
102 if ($http_wrapper->query()->has(
'rule_id')) {
103 $this->rule_id = $http_wrapper->query()->retrieve(
108 if ($http_wrapper->query()->has(
'ldap_server_id')) {
109 $this->ldap_server_id = $http_wrapper->query()->retrieve(
113 } elseif ($http_wrapper->query()->has(
'ldap_servers_server_id')) {
114 $this->ldap_server_id = $http_wrapper->query()->retrieve(
115 'ldap_servers_server_id',
117 $refinery->kindlyTo()->listOf(
120 $this->refinery->custom()->constraint(
121 fn($value):
bool => count($value) === 1,
122 $this->
lng->txt(
'select_one')
124 $this->refinery->custom()->transformation(
125 fn($value):
int => $value[0]
132 if ($http_wrapper->query()->has(
'mapping_id')) {
133 $this->mapping_id = $http_wrapper->query()->retrieve(
138 if ($http_wrapper->query()->has(
'ldap_role_mapping_mapping_ids')) {
139 $this->mappings = $http_wrapper->query()->retrieve(
140 'ldap_role_mapping_mapping_ids',
143 if ($this->mappings === [
'ALL_OBJECTS']) {
145 $this->mappings = array_map(
static function (array
$mapping):
int {
147 }, $mapping_instance->getMappings());
149 $this->mappings = $this->
refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int())->transform($this->mappings);
150 if (count($this->mappings) === 1) {
151 $this->mapping_id = current($this->mappings);
154 if ($http_wrapper->query()->has(
'ldap_role_assignment_rule_ids')) {
155 $this->rule_ids = $http_wrapper->query()->retrieve(
156 'ldap_role_assignment_rule_ids',
159 if ($this->rule_ids === [
'ALL_OBJECTS']) {
165 $this->rule_ids = $this->
refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int())->transform($this->rule_ids);
166 if (count($this->rule_ids) === 1) {
167 $this->rule_id = current($this->rule_ids);
170 if ($is_post_request) {
171 if ($http_wrapper->post()->has(
'rule_ids')) {
172 $this->rule_ids = $http_wrapper->post()->retrieve(
177 if ($http_wrapper->post()->has(
'role_id')) {
178 $this->role_id = $http_wrapper->post()->retrieve(
183 if ($http_wrapper->post()->has(
'rule_id')) {
184 $this->rule_id = $http_wrapper->post()->retrieve(
189 if ($http_wrapper->post()->has(
'mappings')) {
190 $this->mappings = $http_wrapper->post()->retrieve(
195 if ($http_wrapper->post()->has(
'server_ids')) {
196 $this->server_ids = $http_wrapper->post()->retrieve(
201 if ($http_wrapper->post()->has(
'mapping_template')) {
202 $this->mapping_template = $http_wrapper->post()->retrieve(
207 if ($http_wrapper->post()->has(
'role_bind_user')) {
213 if ($http_wrapper->post()->has(
'role_bind_pass')) {
219 if ($http_wrapper->post()->has(
'role_sync_active')) {
220 $this->role_sync_active = $http_wrapper->post()->retrieve(
226 if ($http_wrapper->post()->has($key .
'_value')) {
230 )), $http_wrapper->post()->has($key .
'_update')];
232 $this->attribute_mappings[$key] = [
'',
false];
237 $this->ref_id = $a_auth_ref_id;
239 if ($this->
ctrl->getCmd() !==
'addServerSettings') {
240 $this->
ctrl->setParameter($this,
'ldap_server_id', $this->ldap_server_id);
246 $cmd = $this->
ctrl->getCmd();
248 if ($cmd ===
null || $cmd ===
'' || !method_exists($this, $cmd .
'Cmd')) {
252 if ($cmd !==
'serverList' && !$this->rbacSystem->checkAccess(
'visible,read', $this->ref_id)) {
253 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_write'),
true);
254 $this->
ctrl->redirect($this,
'serverList');
257 $verified_command = $cmd .
'Cmd';
258 $this->$verified_command();
266 $this->ilErr->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->ilErr->WARNING);
279 foreach ($this->user_defined_fields as $field) {
280 $keys[] =
'udf_' . $field->getIdentifier();
295 $this->tabs_gui->activateTab(
'role_assignments');
297 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_assignments.html',
'components/ILIAS/LDAP');
301 $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->
form->getHTML());
305 $this->tpl->setVariable(
'RULES_TBL', $this->ui_renderer->render($this->getRoleAssignmentTable()));
311 if (!$this->rule_id) {
312 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
318 $this->tabs_gui->activateTab(
'role_assignments');
320 $this->
ctrl->setParameter($this,
'rule_id', $this->rule_id);
326 $this->tpl->setContent($this->
form->getHTML());
331 $role_id = $this->role_mapping_rule->getRoleId();
332 if ($this->rbacReview->isGlobalRole(
$role_id)) {
333 $val[
'role_name'] = 0;
336 $val[
'role_name'] = 1;
339 $val[
'add_missing'] = (
int) $this->role_mapping_rule->isAddOnUpdateEnabled();
340 $val[
'remove_deprecated'] = (
int) $this->role_mapping_rule->isRemoveOnUpdateEnabled();
341 $val[
'type'] = $this->role_mapping_rule->getType();
342 $val[
'dn'] = $this->role_mapping_rule->getDN();
343 $val[
'at'] = $this->role_mapping_rule->getMemberAttribute();
344 $val[
'isdn'] = $this->role_mapping_rule->isMemberAttributeDN();
345 $val[
'name'] = $this->role_mapping_rule->getAttributeName();
346 $val[
'value'] = $this->role_mapping_rule->getAttributeValue();
347 $val[
'plugin_id'] = $this->role_mapping_rule->getPluginId();
349 $this->
form->setValuesByArray($val);
355 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
362 $formWithoutErrors = $this->
form->checkInput();
364 if (!$formWithoutErrors || $roleErrorMessage !==
'') {
365 if ($roleErrorMessage !==
'') {
366 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt($roleErrorMessage));
369 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_assignments.html',
'components/ILIAS/LDAP');
371 $this->
form->setValuesByPost();
372 $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->
form->getHTML());
373 $this->tabs_gui->activateSubTab(
'role_assignments');
378 $this->
ctrl->redirect($this,
'showRoleSelection');
380 $this->rule->update();
382 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
383 $this->
ctrl->redirect($this,
'roleAssignments');
391 if (!$this->rule_ids) {
392 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
398 $this->tabs_gui->activateTab(
'role_assignments');
401 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
'deleteRules'));
402 $c_gui->setHeaderText($this->
lng->txt(
'ldap_confirm_del_role_ass'));
403 $c_gui->setCancel($this->
lng->txt(
'cancel'),
'roleAssignments');
404 $c_gui->setConfirm($this->
lng->txt(
'confirm'),
'deleteRules');
405 foreach ($this->rule_ids as
$rule_id) {
410 $this->tpl->setContent($c_gui->getHTML());
415 if (!$this->rule_ids) {
416 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_once'));
421 foreach ($this->rule_ids as
$rule_id) {
426 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'ldap_deleted_rule'),
true);
427 $this->
ctrl->redirect($this,
'roleAssignments');
433 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'));
441 $formWithoutErrors = $this->
form->checkInput();
443 if (!$formWithoutErrors || $roleErrorMessage !==
'') {
444 if ($roleErrorMessage !==
'') {
445 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt($roleErrorMessage));
448 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_assignments.html',
'components/ILIAS/LDAP');
450 $this->
form->setValuesByPost();
451 $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->
form->getHTML());
452 $this->tpl->setVariable(
'RULES_TBL', $this->ui_renderer->render($this->getRoleAssignmentTable()));
453 $this->tabs_gui->activateSubTab(
'role_assignments');
458 $this->
ctrl->redirect($this,
'showRoleSelection');
460 $this->rule->create();
462 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
463 $this->
ctrl->redirect($this,
'roleAssignments');
469 if ($this->rule->getRoleId() > 0) {
475 $rule[
'rule_id'] = $this->rule_id ?: 0;
476 $rule[
'role_search'] = $this->
form->getInput(
'role_search');
477 $rule[
'add_on_update'] = $this->
form->getInput(
'add_missing');
478 $rule[
'remove_on_update'] = $this->
form->getInput(
'remove_deprecated');
479 $rule[
'type'] = $this->
form->getInput(
'type');
480 $rule[
'dn'] = $this->
form->getInput(
'dn');
481 $rule[
'at'] = $this->
form->getInput(
'at');
482 $rule[
'isdn'] = $this->
form->getInput(
'isdn');
483 $rule[
'name'] = $this->
form->getInput(
'name');
484 $rule[
'value'] = $this->
form->getInput(
'value');
485 $rule[
'plugin'] = $this->
form->getInput(
'plugin_id');
487 $this->
ctrl->saveParameter($this,
'rule_id');
495 $this->tabs_gui->activateTab(
'role_assignments');
496 $this->
ctrl->saveParameter($this,
'rule_id');
499 $parser->setMinWordLength(1);
504 $object_search->setFilter([
'role']);
505 $res = $object_search->performSearch();
507 $entries =
$res->getEntries();
510 $table->setTitle($this->
lng->txt(
'ldap_role_selection'));
511 $table->addMultiCommand(
'saveRoleSelection', $this->
lng->txt(
'ldap_choose_role'));
512 $table->parse($entries);
514 $this->tpl->setContent($table->getHTML());
520 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
525 if (!$this->role_id) {
526 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
532 $this->rule->setRoleId($this->role_id);
534 if ($this->rule_id) {
535 $this->rule->update();
537 $this->rule->create();
540 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
541 $this->
ctrl->setParameter($this,
'rule_id',
null);
542 $this->
ctrl->redirect($this,
'roleAssignments');
548 $this->rule->validate();
550 return $this->ilErr->getMessage();
558 $this->
http->request(),
565 $this->server->getServerId(),
574 if (is_object($this->rule)) {
580 if ($load_from_form) {
581 if ($this->
form->getInput(
'role_name') ===
'0') {
582 $this->rule->setRoleId((
int) $this->
form->getInput(
'role_id'));
583 } elseif ($this->
form->getInput(
'role_search')) {
587 $parser->setMinWordLength(1);
592 $object_search->setFilter([
'role']);
593 $res = $object_search->performSearch();
595 $entries =
$res->getEntries();
596 if (count($entries) === 1) {
597 $role = current($entries);
598 $this->rule->setRoleId($role[
'obj_id']);
599 } elseif (count($entries) > 1) {
600 $this->rule->setRoleId(-1);
604 $this->rule->setAttributeName($this->
form->getInput(
'name'));
605 $this->rule->setAttributeValue($this->
form->getInput(
'value'));
606 $this->rule->setDN($this->
form->getInput(
'dn'));
607 $this->rule->setMemberAttribute($this->
form->getInput(
'at'));
608 $this->rule->setMemberIsDN((
bool) $this->
form->getInput(
'isdn'));
609 $this->rule->enableAddOnUpdate((
bool) $this->
form->getInput(
'add_missing'));
610 $this->rule->enableRemoveOnUpdate((
bool) $this->
form->getInput(
'remove_deprecated'));
611 $this->rule->setPluginId((
int) $this->
form->getInput(
'plugin_id'));
612 $this->rule->setType((
int) $this->
form->getInput(
'type'));
613 $this->rule->setServerId($this->
getServer()->getServerId());
617 $this->rule->setServerId($this->
getServer()->getServerId());
620 $this->rule->enableAddOnUpdate((
bool) (
$rule[
'add_on_update'] ??
false));
621 $this->rule->enableRemoveOnUpdate((
bool) (
$rule[
'remove_on_update'] ??
false));
635 if (!$this->mappings) {
636 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
646 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'ldap_deleted_role_mapping'));
652 if (!$this->mapping_template) {
658 $this->mapping->clearRules();
661 $this->mapping->setRule($key, $value,
false);
669 $this->tabs_gui->activateTab(
'role_mapping');
672 $this->mapping->setRule(
674 $this->attribute_mappings[$key][0],
675 $this->attribute_mappings[$key][1]
679 foreach ($this->user_defined_fields as $field) {
680 $key =
'udf_' . $field->getIdentifier();
681 $this->mapping->setRule(
683 $this->attribute_mappings[$key][0],
684 $this->attribute_mappings[$key][1]
688 $this->mapping->save();
691 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
696 return $this->
http->wrapper()->query()->retrieve(
697 'ldap_servers_table_action',
699 $this->refinery->kindlyTo()->string(),
700 $this->refinery->always(
'')
712 default => $this->
ctrl->redirect($this,
'serverList')
718 return $this->
http->wrapper()->query()->retrieve(
719 'ldap_role_assignment_table_action',
721 $this->refinery->kindlyTo()->string(),
722 $this->refinery->always(
'')
732 default => $this->
ctrl->redirect($this,
'serverList')
738 return $this->
http->wrapper()->query()->retrieve(
739 'ldap_role_mapping_table_action',
741 $this->refinery->kindlyTo()->string(),
742 $this->refinery->always(
'')
753 default => $this->
ctrl->redirect($this,
'serverList'),
759 if (!$this->rbacSystem->checkAccess(
'visible,read', $this->ref_id)) {
760 $this->ilErr->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->ilErr->WARNING);
764 $this->main_tpl->setOnScreenMessage(
'failure',
'Missing LDAP libraries. Please ensure that the PHP LDAP module is installed on your server.');
767 if ($this->rbacSystem->checkAccess(
'write', $this->ref_id)) {
769 $this->
lng->txt(
'add_ldap_server'),
770 $this->ctrl->getLinkTarget($this,
'addServerSettings')
774 $this->
ctrl->setParameter($this,
'ldap_server_id',
null);
776 $table = new \ILIAS\LDAP\Server\UI\ServerTable(
783 $this->
http->request(),
788 $this->rbacSystem->checkAccess(
'write', $this->ref_id)
791 $this->tpl->setContent($this->ui_renderer->render($table->getComponent()));
796 $this->form_gui->setValuesByArray([
797 'active' => $this->
server->isActive(),
798 'ds' => !$this->server->isAuthenticationEnabled(),
799 'server_name' => $this->server->getName(),
800 'server_url' => $this->server->getUrlString(),
801 'version' => $this->server->getVersion(),
802 'base_dn' => $this->server->getBaseDN(),
803 'referrals' => $this->server->isActiveReferrer(),
804 'tls' => $this->server->isActiveTLS(),
805 'binding_type' => $this->server->getBindingType(),
806 'bind_dn' => $this->server->getBindUser(),
807 'bind_pass' => $this->server->getBindPassword(),
808 'bind_pass_retype' => $this->server->getBindPassword(),
809 'search_base' => $this->server->getSearchBase(),
810 'user_scope' => $this->server->getUserScope(),
811 'user_attribute' => $this->server->getUserAttribute(),
812 'filter' => $this->server->getFilter(),
813 'group_dn' => $this->server->getGroupDN(),
814 'group_scope' => $this->server->getGroupScope(),
815 'group_filter' => $this->server->getGroupFilter(),
816 'group_member' => $this->server->getGroupMember(),
817 'memberisdn' => $this->server->enabledGroupMemberIsDN(),
818 'group' => $this->server->getGroupName(),
819 'group_attribute' => $this->server->getGroupAttribute(),
820 'group_optional' => $this->server->isMembershipOptional(),
821 'group_user_filter' => $this->server->getGroupUserFilter(),
822 'sync_on_login' => $this->server->enabledSyncOnLogin(),
823 'sync_per_cron' => $this->server->enabledSyncPerCron(),
825 'migration' => (
int) $this->server->isAccountMigrationEnabled(),
826 'name_filter' => $this->server->getUsernameFilter(),
827 'escape_dn' => $this->server->enabledEscapeDN()
834 $this->form_gui->setFormAction($this->
ctrl->getFormAction($this,
'save'));
835 $this->form_gui->setTitle($this->
lng->txt(
'ldap_configure'));
838 $active->setValue(
'1');
839 $this->form_gui->addItem($active);
843 $ds->setInfo($this->
lng->txt(
'ldap_as_ds_info'));
844 $this->form_gui->addItem($ds);
846 $servername =
new ilTextInputGUI($this->
lng->txt(
'ldap_server_name'),
'server_name');
847 $servername->setRequired(
true);
848 $servername->setInfo($this->
lng->txt(
'ldap_server_name_info'));
849 $servername->setSize(32);
850 $servername->setMaxLength(32);
851 $this->form_gui->addItem($servername);
853 $namefilter =
new ilTextInputGUI($this->
lng->txt(
'ldap_username_filter'),
'name_filter');
854 $namefilter->setInfo($this->
lng->txt(
'ldap_username_filter_info'));
855 $namefilter->setSize(64);
856 $namefilter->setMaxLength(255);
857 $this->form_gui->addItem($namefilter);
860 $serverurl->setRequired(
true);
861 $serverurl->setInfo($this->
lng->txt(
'ldap_server_url_info'));
862 $serverurl->setSize(64);
863 $serverurl->setMaxLength(255);
864 $this->form_gui->addItem($serverurl);
867 $version->setOptions([2 => 2, 3 => 3]);
868 $version->setInfo($this->
lng->txt(
'ldap_server_version_info'));
872 $basedsn->setRequired(
true);
873 $basedsn->setSize(64);
874 $basedsn->setMaxLength(255);
875 $this->form_gui->addItem($basedsn);
878 $referrals->setValue(
'1');
879 $referrals->setInfo($this->
lng->txt(
'ldap_referrals_info'));
880 $this->form_gui->addItem($referrals);
883 $section_security->setTitle($this->
lng->txt(
'ldap_server_security_settings'));
884 $this->form_gui->addItem($section_security);
888 $this->form_gui->addItem($tls);
892 $binding->addOption($anonymous);
896 $dn->setMaxLength(255);
897 $user->addSubItem($dn);
899 $pass->setSkipSyntaxCheck(
true);
901 $pass->setMaxLength(100);
902 $user->addSubItem($pass);
903 $binding->addOption($user);
904 $this->form_gui->addItem($binding);
907 $section_auth->setTitle($this->
lng->txt(
'ldap_authentication_settings'));
908 $this->form_gui->addItem($section_auth);
910 $search_base =
new ilTextInputGUI($this->
lng->txt(
'ldap_user_dn'),
'search_base');
911 $search_base->setInfo($this->
lng->txt(
'ldap_search_base_info'));
912 $search_base->setSize(64);
913 $search_base->setMaxLength(255);
914 $this->form_gui->addItem($search_base);
917 $user_scope->setOptions([
921 $user_scope->setInfo($this->
lng->txt(
'ldap_user_scope_info'));
922 $this->form_gui->addItem($user_scope);
924 $user_attribute =
new ilTextInputGUI($this->
lng->txt(
'ldap_user_attribute'),
'user_attribute');
925 $user_attribute->setSize(16);
926 $user_attribute->setMaxLength(64);
927 $user_attribute->setRequired(
true);
928 $this->form_gui->addItem($user_attribute);
931 $filter->setInfo($this->
lng->txt(
'ldap_filter_info'));
932 $filter->setSize(64);
933 $filter->setMaxLength(512);
934 $this->form_gui->addItem($filter);
937 $section_restrictions->setTitle($this->
lng->txt(
'ldap_group_restrictions'));
938 $this->form_gui->addItem($section_restrictions);
940 $group_dn =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_search_base'),
'group_dn');
941 $group_dn->setInfo($this->
lng->txt(
'ldap_group_dn_info'));
942 $group_dn->setSize(64);
943 $group_dn->setMaxLength(255);
944 $this->form_gui->addItem($group_dn);
947 $group_scope->setOptions([
951 $group_scope->setInfo($this->
lng->txt(
'ldap_group_scope_info'));
952 $this->form_gui->addItem($group_scope);
954 $group_filter =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_filter'),
'group_filter');
955 $group_filter->setInfo($this->
lng->txt(
'ldap_group_filter_info'));
956 $group_filter->setSize(64);
957 $group_filter->setMaxLength(255);
958 $this->form_gui->addItem($group_filter);
960 $group_member =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_member'),
'group_member');
961 $group_member->setInfo($this->
lng->txt(
'ldap_group_member_info'));
962 $group_member->setSize(32);
963 $group_member->setMaxLength(255);
964 $this->form_gui->addItem($group_member);
967 $this->form_gui->addItem($group_member_isdn);
970 $escapedn->setValue(
'1');
971 $escapedn->setInfo($this->
lng->txt(
'ldap_escapedn_info'));
972 $this->form_gui->addItem($escapedn);
975 $group->setInfo($this->
lng->txt(
'ldap_group_name_info'));
977 $group->setMaxLength(255);
978 $this->form_gui->addItem($group);
980 $group_atrr =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_attribute'),
'group_attribute');
981 $group_atrr->setInfo($this->
lng->txt(
'ldap_group_attribute_info'));
982 $group_atrr->setSize(16);
983 $group_atrr->setMaxLength(64);
984 $this->form_gui->addItem($group_atrr);
986 $group_optional =
new ilCheckboxInputGUI($this->
lng->txt(
'ldap_group_membership'),
'group_optional');
987 $group_optional->setOptionTitle($this->
lng->txt(
'ldap_group_member_optional'));
988 $group_optional->setInfo($this->
lng->txt(
'ldap_group_optional_info'));
989 $group_optional->setValue(
'1');
990 $group_user_filter =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_user_filter'),
'group_user_filter');
991 $group_user_filter->setSize(64);
992 $group_user_filter->setMaxLength(255);
993 $group_optional->addSubItem($group_user_filter);
994 $this->form_gui->addItem($group_optional);
997 $section_sync->setTitle($this->
lng->txt(
'ldap_user_sync'));
998 $this->form_gui->addItem($section_sync);
1002 $sync_on_login->setValue(
'1');
1003 $ci_gui->addSubItem($sync_on_login);
1005 $sync_per_cron->setValue(
'1');
1006 $ci_gui->addSubItem($sync_per_cron);
1007 $ci_gui->setInfo($this->
lng->txt(
'ldap_user_sync_info'));
1008 $this->form_gui->addItem($ci_gui);
1010 $global_role =
new ilSelectInputGUI($this->
lng->txt(
'ldap_global_role_assignment'),
'global_role');
1012 $global_role->setInfo($this->
lng->txt(
'ldap_global_role_info'));
1013 $this->form_gui->addItem($global_role);
1016 $migr->setInfo($this->
lng->txt(
'auth_ldap_migration_info'));
1017 $migr->setValue(
'1');
1018 $this->form_gui->addItem($migr);
1026 $this->form_gui->addCommandButton(
'save', $this->
lng->txt(
'save'));
1027 if ($this->
ctrl->getCmd() ===
'addServerSettings') {
1028 $this->form_gui->addCommandButton(
'serverList', $this->
lng->txt(
'cancel'));
1035 $this->tabs_gui->setTabActive(
'settings');
1038 if ($this->form_gui->checkInput()) {
1039 $this->
server->toggleActive((
bool) $this->form_gui->getInput(
'active'));
1040 $this->
server->enableAuthentication(!(
bool) $this->form_gui->getInput(
'ds'));
1041 $this->
server->setName($this->form_gui->getInput(
'server_name'));
1042 $this->
server->setUrl($this->form_gui->getInput(
'server_url'));
1043 $this->
server->setVersion((
int) $this->form_gui->getInput(
'version'));
1044 $this->
server->setBaseDN($this->form_gui->getInput(
'base_dn'));
1045 $this->
server->toggleReferrer((
bool) $this->form_gui->getInput(
'referrals'));
1046 $this->
server->toggleTLS((
bool) $this->form_gui->getInput(
'tls'));
1047 $this->
server->setBindingType((
int) $this->form_gui->getInput(
'binding_type'));
1048 $this->
server->setBindUser($this->form_gui->getInput(
'bind_dn'));
1049 $this->
server->setBindPassword($this->form_gui->getInput(
'bind_pass'));
1050 $this->
server->setSearchBase($this->form_gui->getInput(
'search_base'));
1051 $this->
server->setUserScope((
int) $this->form_gui->getInput(
'user_scope'));
1052 $this->
server->setUserAttribute($this->form_gui->getInput(
'user_attribute'));
1053 $this->
server->setFilter($this->form_gui->getInput(
'filter'));
1054 $this->
server->setGroupDN($this->form_gui->getInput(
'group_dn'));
1055 $this->
server->setGroupScope((
int) $this->form_gui->getInput(
'group_scope'));
1056 $this->
server->setGroupFilter($this->form_gui->getInput(
'group_filter'));
1057 $this->
server->setGroupMember($this->form_gui->getInput(
'group_member'));
1058 $this->
server->enableGroupMemberIsDN((
bool) $this->form_gui->getInput(
'memberisdn'));
1059 $this->
server->setGroupName($this->form_gui->getInput(
'group'));
1060 $this->
server->setGroupAttribute($this->form_gui->getInput(
'group_attribute'));
1061 $this->
server->setGroupUserFilter($this->form_gui->getInput(
'group_user_filter'));
1062 $this->
server->toggleMembershipOptional((
bool) $this->form_gui->getInput(
'group_optional'));
1063 $this->
server->enableSyncOnLogin((
bool) $this->form_gui->getInput(
'sync_on_login'));
1064 $this->
server->enableSyncPerCron((
bool) $this->form_gui->getInput(
'sync_per_cron'));
1065 $this->
server->setGlobalRole((
int) $this->form_gui->getInput(
'global_role'));
1066 $this->
server->enableAccountMigration((
bool) $this->form_gui->getInput(
'migration'));
1067 $this->
server->setUsernameFilter($this->form_gui->getInput(
'name_filter'));
1068 $this->
server->enableEscapeDN((
bool) $this->form_gui->getInput(
'escape_dn'));
1069 if (!$this->
server->validate()) {
1070 $this->main_tpl->setOnScreenMessage(
'failure', $this->ilErr->getMessage());
1071 $this->form_gui->setValuesByPost();
1072 $this->tpl->setContent($this->form_gui->getHTML());
1076 if ($this->
server->getServerId()) {
1083 $this->mapping->setRule(
'global_role', (
string) $this->form_gui->getInput(
'global_role'),
false);
1084 $this->mapping->save();
1086 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1087 $this->
ctrl->setParameter($this,
'ldap_server_id',
null);
1088 $this->
ctrl->redirect($this,
'serverList');
1091 $this->form_gui->setValuesByPost();
1092 $this->tpl->setContent($this->form_gui->getHTML());
1097 $this->
ctrl->setParameter($this,
'ldap_server_id',
null);
1098 $this->
ctrl->redirect($this,
'serverList');
1103 $this->tabs_gui->clearTargets();
1105 $this->tabs_gui->setBackTarget(
1106 $this->
lng->txt(
'back'),
1107 $this->ctrl->getLinkTarget($this,
'backToServerList')
1110 $this->tabs_gui->addTab(
1112 $this->
lng->txt(
'ldap_settings'),
1113 $this->ctrl->getLinkTarget($this,
'editServerSettings')
1121 $this->tabs_gui->addTab(
1123 $this->
lng->txt(
'ldap_user_mapping'),
1124 $this->ctrl->getLinkTarget($this,
'userMapping')
1127 $this->tabs_gui->addTab(
1129 $this->
lng->txt(
'ldap_role_assignments'),
1130 $this->ctrl->getLinkTarget($this,
'roleAssignments')
1133 $this->tabs_gui->addTab(
1135 $this->
lng->txt(
'ldap_role_mapping'),
1136 $this->ctrl->getLinkTarget($this,
'roleMapping')
1143 if ($this->ldap_server_id) {
1166 $this->rbacReview->getGlobalRoles(),
1172 $select[0] = $this->
lng->txt(
'links_select_one');
1173 foreach ($global_roles as
$role_id) {
1186 'gender' => $this->
lng->txt(
'gender'),
1187 'firstname' => $this->
lng->txt(
'firstname'),
1188 'lastname' => $this->
lng->txt(
'lastname'),
1189 'title' => $this->
lng->txt(
'person_title'),
1190 'institution' => $this->
lng->txt(
'institution'),
1191 'department' => $this->
lng->txt(
'department'),
1192 'street' => $this->
lng->txt(
'street'),
1193 'city' => $this->
lng->txt(
'city'),
1194 'zipcode' => $this->
lng->txt(
'zipcode'),
1195 'country' => $this->
lng->txt(
'country'),
1196 'phone_office' => $this->
lng->txt(
'phone_office'),
1197 'phone_home' => $this->
lng->txt(
'phone_home'),
1198 'phone_mobile' => $this->
lng->txt(
'phone_mobile'),
1199 'fax' => $this->
lng->txt(
'fax'),
1200 'email' => $this->
lng->txt(
'email'),
1201 'second_email' => $this->
lng->txt(
'second_email'),
1202 'hobby' => $this->
lng->txt(
'hobby'),
1203 'matriculation' => $this->
lng->txt(
'matriculation')
1209 if ($this->user_defined_fields ===
null) {
1210 $this->user_defined_fields = $this->
profile->getAllUserDefinedFields();
1217 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1221 $this->
form->setTitle($this->
lng->txt(
'ldap_edit_role_ass_rule'));
1222 $this->
form->addCommandButton(
'updateRoleAssignment', $this->
lng->txt(
'save'));
1225 $this->
form->setTitle($this->
lng->txt(
'ldap_add_role_ass_rule'));
1226 $this->
form->addCommandButton(
'addRoleAssignment', $this->
lng->txt(
'ldap_btn_add_role_ass'));
1231 $role->setInfo($this->
lng->txt(
'ldap_role_name_info'));
1232 $role->setRequired(
true);
1233 $this->
form->addItem($role);
1236 $role->addOption($global);
1240 $global->addSubItem($role_select);
1243 $role->addOption($local);
1246 $role_search->setSize(40);
1247 $local->addSubItem($role_search);
1250 $update->setValue($this->
lng->txt(
'ldap_check_role_assignment'));
1253 $add->setOptionTitle($this->
lng->txt(
'ldap_add_missing'));
1254 $update->addSubItem($add);
1257 $remove->setOptionTitle($this->
lng->txt(
'ldap_remove_deprecated'));
1258 $update->addSubItem($remove);
1260 $this->
form->addItem($update);
1263 $group->setRequired(
true);
1269 $dn->setMaxLength(512);
1270 $dn->setInfo($this->
lng->txt(
'ldap_role_grp_dn_info'));
1271 $radio_group->addSubItem($dn);
1274 $at->setMaxLength(128);
1275 $radio_group->addSubItem($at);
1277 $isdn->setInfo($this->
lng->txt(
'ldap_group_member_info'));
1278 $radio_group->addSubItem($isdn);
1279 $radio_group->setInfo($this->
lng->txt(
'ldap_role_grp_info'));
1281 $group->addOption($radio_group);
1286 $name->setMaxLength(128);
1287 $radio_attribute->addSubItem($name);
1291 $val->setMaxLength(128);
1292 $radio_attribute->addSubItem($val);
1293 $radio_attribute->setInfo($this->
lng->txt(
'ldap_role_at_info'));
1295 $group->addOption($radio_attribute);
1297 $pl_active = $this->component_repository->getPluginSlotById(
'ldaphk')->hasActivePlugins();
1300 $pl->setInfo($this->
lng->txt(
'ldap_plugin_info'));
1301 $pl->setDisabled(!$pl_active);
1304 $id->setDisabled(!$pl_active);
1306 $id->setMaxLength(3);
1307 $id->setMaxValue(999);
1308 $id->setMinValue(1);
1309 $pl->addSubItem(
$id);
1311 $group->addOption($pl);
1312 $this->
form->addItem($group);
1323 $select_form->setPostVar(
'mapping_template');
1325 '' => $this->
lng->txt(
'ldap_mapping_template'),
1326 'inetOrgPerson' =>
'inetOrgPerson',
1327 'organizationalPerson' =>
'organizationalPerson',
1328 'person' =>
'person',
1329 'ad_2003' =>
'Active Directory (Win 2003)'
1331 $select_form->setOptions($options);
1332 $select_form->setValue($this->mapping_template);
1334 $this->
toolbar->addInputItem($select_form);
1335 $this->
toolbar->addFormButton($this->
lng->txt(
'show'),
'chooseMapping');
1336 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this,
'chooseMapping'));
1342 $propertie_form->setTitle($this->
lng->txt(
'ldap_mapping_table'));
1343 $propertie_form->setFormAction($this->
ctrl->getFormAction($this,
'saveMapping'));
1344 $propertie_form->addCommandButton(
'saveMapping', $this->
lng->txt(
'save'));
1348 $text_form->setPostVar(
$mapping .
'_value');
1349 $text_form->setValue($this->mapping->getValue(
$mapping));
1350 $text_form->setSize(32);
1351 $text_form->setMaxLength(255);
1352 $propertie_form->addItem($text_form);
1355 $checkbox_form->setPostVar(
$mapping .
'_update');
1356 $checkbox_form->setChecked($this->mapping->enabledUpdate(
$mapping));
1357 $checkbox_form->setOptionTitle($this->
lng->txt(
'ldap_update_field_info'));
1358 $propertie_form->addItem($checkbox_form);
1362 foreach ($this->user_defined_fields as $field) {
1364 $text_form->setPostVar(
'udf_' . $field->getIdentifier() .
'_value');
1365 $text_form->setValue($this->mapping->getValue(
'udf_' . $field->getIdentifier()));
1366 $text_form->setSize(32);
1367 $text_form->setMaxLength(255);
1368 $propertie_form->addItem($text_form);
1371 $checkbox_form->setPostVar(
'udf_' . $field->getIdentifier() .
'_update');
1372 $checkbox_form->setChecked($this->mapping->enabledUpdate(
'udf_' . $field->getIdentifier()));
1373 $checkbox_form->setOptionTitle($this->
lng->txt(
'ldap_update_field_info'));
1374 $propertie_form->addItem($checkbox_form);
1377 return $propertie_form;
1383 $this->tabs_gui->setTabActive(
'role_mapping');
1385 $this->
lng->txt(
'ldap_new_role_assignment'),
1386 $this->ctrl->getLinkTarget($this,
'addRoleMapping')
1390 $propertie_form->setTitle($this->
lng->txt(
'ldap_role_settings'));
1391 $propertie_form->setFormAction($this->
ctrl->getFormAction($this,
'saveSyncronizationSettings'));
1392 $propertie_form->addCommandButton(
'saveSyncronizationSettings', $this->
lng->txt(
'save'));
1394 $role_active->setPostVar(
'role_sync_active');
1395 $role_active->setChecked($this->
server->enabledRoleSynchronization());
1396 $propertie_form->addItem($role_active);
1398 $binding->setInfo($this->
lng->txt(
'ldap_role_bind_user_info'));
1400 $user->setPostVar(
'role_bind_user');
1401 $user->setValue($this->
server->getRoleBindDN());
1403 $user->setMaxLength(255);
1404 $binding->addCombinationItem(
'0', $user, $this->
lng->txt(
'ldap_role_bind_user'));
1407 $pass->setPostVar(
'role_bind_pass');
1408 $pass->setValue($this->
server->getRoleBindPassword());
1410 $pass->setMaxLength(100);
1411 $pass->setRetype(
false);
1412 $binding->addCombinationItem(
'1', $pass, $this->
lng->txt(
'ldap_role_bind_pass'));
1414 $propertie_form->addItem($binding);
1416 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_mappings.html',
'components/ILIAS/LDAP');
1417 $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $propertie_form->getHTML());
1419 $this->tpl->setVariable(
1422 $this->
http->request(),
1425 $this->server->getServerId(),
1426 $this->object_data_cache,
1440 $propertie_form->setTitle($this->
lng->txt(
'ldap_edit_role_assignment'));
1441 if ($propertie_form->getItemByPostVar(
'url')) {
1442 $propertie_form->getItemByPostVar(
'url')->setValue(
$mapping->getURL());
1444 if ($propertie_form->getItemByPostVar(
'dn')) {
1445 $propertie_form->getItemByPostVar(
'dn')->setValue(
$mapping->getDN());
1447 if ($propertie_form->getItemByPostVar(
'member')) {
1448 $propertie_form->getItemByPostVar(
'member')->setValue(
$mapping->getMemberAttribute());
1450 if ($propertie_form->getItemByPostVar(
'memberisdn')) {
1451 $propertie_form->getItemByPostVar(
'memberisdn')->setChecked(
$mapping->getMemberISDN());
1453 if ($propertie_form->getItemByPostVar(
'role')) {
1454 $propertie_form->getItemByPostVar(
'role')->setValue(
$mapping->getRoleName());
1456 if ($propertie_form->getItemByPostVar(
'info')) {
1457 $propertie_form->getItemByPostVar(
'info')->setValue(
$mapping->getMappingInfo());
1459 if ($propertie_form->getItemByPostVar(
'info_type')) {
1460 $propertie_form->getItemByPostVar(
'info_type')->setChecked(
$mapping->getMappingInfoType());
1463 $this->tpl->setContent($propertie_form->getHTML());
1469 if ($propertie_form->checkInput() && $this->rbacReview->roleExists($propertie_form->getInput(
'role'))) {
1472 $mapping->setURL($propertie_form->getInput(
'url'));
1473 $mapping->setDN($propertie_form->getInput(
'dn'));
1474 $mapping->setMemberAttribute($propertie_form->getInput(
'member'));
1475 $mapping->setMemberISDN((
bool) $propertie_form->getInput(
'memberisdn'));
1476 $mapping->setRoleByName($propertie_form->getInput(
'role'));
1477 $mapping->setMappingInfo($propertie_form->getInput(
'info'));
1478 $mapping->setMappingInfoType((
bool) $propertie_form->getInput(
'info_type'));
1481 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1482 $this->
ctrl->redirect($this,
'roleMapping');
1484 if (!$this->rbacReview->roleExists($propertie_form->getInput(
'role'))) {
1485 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'ldap_role_not_exists') .
' ' .
1486 $propertie_form->getInput(
'role'));
1488 $propertie_form->setValuesByPost();
1490 $this->tpl->setContent($propertie_form->getHTML());
1496 if (!$this->mappings) {
1497 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
1498 $this->
ctrl->redirect($this,
'roleMapping');
1503 $this->tabs_gui->activateTab(
'role_mapping');
1506 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
'deleteRoleMapping'));
1507 $c_gui->setHeaderText($this->
lng->txt(
'ldap_confirm_del_role_ass'));
1508 $c_gui->setCancel($this->
lng->txt(
'cancel'),
'roleMapping');
1509 $c_gui->setConfirm($this->
lng->txt(
'confirm'),
'deleteRoleMapping');
1511 foreach ($this->mappings as
$id) {
1514 $txt = $this->
lng->txt(
'obj_role') .
': ' . $mapping->getRoleName() .
', ';
1515 $txt .= $this->
lng->txt(
'ldap_group_dn') .
': ' . $mapping->getDN() .
', ';
1516 $txt .= $this->
lng->txt(
'ldap_server_short') .
' ' . $mapping->getURL() .
', ';
1517 $txt .= $this->
lng->txt(
'ldap_group_member_short') .
' ' . $mapping->getMemberAttribute();
1518 $c_gui->addItem(
'mappings[]', (
string)
$id,
$txt);
1521 $this->tpl->setContent($c_gui->getHTML());
1528 $this->
ctrl->clearParameters($this);
1532 $this->tpl->setContent($this->form_gui->getHTML());
1540 $this->tabs_gui->setTabActive(
'settings');
1545 $this->tpl->setContent($this->form_gui->getHTML());
1552 if (!$this->ldap_server_id) {
1553 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
1559 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
'deleteServerSettings'));
1560 $c_gui->setHeaderText($this->
lng->txt(
'ldap_confirm_del_server_settings'));
1561 $c_gui->setCancel($this->
lng->txt(
'cancel'),
'serverList');
1562 $c_gui->setConfirm($this->
lng->txt(
'confirm'),
'deleteServerSettings');
1564 $c_gui->addItem(
'server_ids[]', (
string) $setting->getServerId(), $setting->getName());
1566 $this->tpl->setContent($c_gui->getHTML());
1571 if (!$this->server_ids) {
1572 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
1577 foreach ($this->server_ids as $server_id) {
1582 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'deleted'),
true);
1583 $this->
ctrl->redirect($this,
'serverlist');
1591 $this->tabs_gui->activateTab(
'user_mapping');
1596 $this->tpl->setContent($propertie_form->getHTML());
1603 $this->
server->toggleActive(
true);
1606 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->
lng->txt(
'saved_successfully'),
true);
1607 $this->
ctrl->setParameter($this,
'ldap_server_id',
null);
1608 $this->
ctrl->redirect($this,
'serverList');
1615 $this->
server->toggleActive(
false);
1618 $this->tpl->setOnScreenMessage($this->tpl::MESSAGE_TYPE_SUCCESS, $this->
lng->txt(
'saved_successfully'),
true);
1619 $this->
ctrl->setParameter($this,
'ldap_server_id',
null);
1620 $this->
ctrl->redirect($this,
'serverList');
1626 $this->tabs_gui->activateTab(
'role_mapping');
1628 if ($this->mapping_id) {
1629 $this->
ctrl->setParameter($this,
'mapping_id', $this->mapping_id);
1633 $propertie_form->setTitle($this->
lng->txt(
'ldap_mapping_table'));
1634 $propertie_form->setFormAction($this->
ctrl->getFormAction($this, $command));
1635 $propertie_form->addCommandButton($command, $this->
lng->txt(
'save'));
1636 $propertie_form->addCommandButton(
'roleMapping', $this->
lng->txt(
'cancel'));
1639 $url->setPostVar(
'url');
1641 $url->setMaxLength(255);
1642 $url->setRequired(
true);
1645 $group_dn->setPostVar(
'dn');
1646 $group_dn->setSize(50);
1647 $group_dn->setMaxLength(255);
1648 $group_dn->setInfo($this->
lng->txt(
'ldap_dn_info'));
1649 $group_dn->setRequired(
true);
1652 $member->setPostVar(
'member');
1653 $member->setSize(32);
1654 $member->setMaxLength(255);
1655 $member->setInfo($this->
lng->txt(
'ldap_member_info'));
1656 $member->setRequired(
true);
1659 $member_isdn->setPostVar(
'memberisdn');
1660 $member_isdn->setOptionTitle($this->
lng->txt(
'ldap_memberisdn'));
1663 $role->setPostVar(
'role');
1665 $role->setMaxLength(255);
1666 $role->setInfo($this->
lng->txt(
'ldap_role_info'));
1667 $role->setRequired(
true);
1670 $info->setPostVar(
'info');
1673 $info->setInfo($this->
lng->txt(
'ldap_info_text_info'));
1676 $info_type->setPostVar(
'info_type');
1677 $info_type->setOptionTitle($this->
lng->txt(
'ldap_mapping_info_type'));
1679 $propertie_form->addItem(
$url);
1680 $propertie_form->addItem($group_dn);
1681 $propertie_form->addItem($member);
1682 $propertie_form->addItem($member_isdn);
1683 $propertie_form->addItem($role);
1684 $propertie_form->addItem(
$info);
1685 $propertie_form->addItem($info_type);
1687 return $propertie_form;
1693 if ($propertie_form->getItemByPostVar(
'url')) {
1694 $propertie_form->getItemByPostVar(
'url')->setValue($this->
server->getUrl());
1697 if ($this->mapping_id) {
1700 if ($propertie_form->getItemByPostVar(
'url')) {
1701 $propertie_form->getItemByPostVar(
'url')->setValue(
$mapping->getURL());
1703 if ($propertie_form->getItemByPostVar(
'dn')) {
1704 $propertie_form->getItemByPostVar(
'dn')->setValue(
$mapping->getDN());
1706 if ($propertie_form->getItemByPostVar(
'member')) {
1707 $propertie_form->getItemByPostVar(
'member')->setValue(
$mapping->getMemberAttribute());
1709 if ($propertie_form->getItemByPostVar(
'memberisdn')) {
1710 $propertie_form->getItemByPostVar(
'memberisdn')->setChecked(
$mapping->getMemberISDN());
1712 if ($propertie_form->getItemByPostVar(
'role')) {
1713 $propertie_form->getItemByPostVar(
'role')->setValue(
$mapping->getRoleName());
1715 if ($propertie_form->getItemByPostVar(
'info')) {
1716 $propertie_form->getItemByPostVar(
'info')->setValue(
$mapping->getMappingInfo());
1718 if ($propertie_form->getItemByPostVar(
'info_type')) {
1719 $propertie_form->getItemByPostVar(
'info_type')->setChecked(
$mapping->getMappingInfoType());
1723 $this->tpl->setContent($propertie_form->getHTML());
1730 if ($propertie_form->checkInput() && $this->rbacReview->roleExists($propertie_form->getInput(
'role'))) {
1733 $mapping->setURL($propertie_form->getInput(
'url'));
1734 $mapping->setDN($propertie_form->getInput(
'dn'));
1735 $mapping->setMemberAttribute($propertie_form->getInput(
'member'));
1736 $mapping->setMemberISDN((
bool) $propertie_form->getInput(
'memberisdn'));
1737 $mapping->setRoleByName($propertie_form->getInput(
'role'));
1738 $mapping->setMappingInfo($propertie_form->getInput(
'info'));
1739 $mapping->setMappingInfoType((
bool) $propertie_form->getInput(
'info_type'));
1742 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1743 $this->
ctrl->redirect($this,
'roleMapping');
1745 if (!$this->rbacReview->roleExists($propertie_form->getInput(
'role'))) {
1746 $this->main_tpl->setOnScreenMessage(
1748 $this->
lng->txt(
'ldap_role_not_exists') .
' ' . $propertie_form->getInput(
'role')
1751 $propertie_form->setValuesByPost();
1753 $this->tpl->setContent($propertie_form->getHTML());
1759 $this->
server->setRoleBindDN($this->role_bind_user);
1760 $this->
server->setRoleBindPassword($this->role_bind_pass);
1761 $this->
server->enableRoleSynchronization($this->role_sync_active);
1763 if ($this->
server->getServerId()) {
1767 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1768 $this->
ctrl->redirect($this,
'roleMapping');
1774 'handleServerTableActions',
1775 'handleRoleAssignmentTableActions',
1776 'handleRoleMappingTableActions',
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Class ilAccessHandler Checks access for ILIAS objects.
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
Error Handling & global info handling.
static _getMappingRulesByClass(string $a_class)
Get mapping rule by objectClass.
This class stores the settings that define the mapping between LDAP attribute and user profile fields...
static _lookupGlobalRole(int $a_server_id)
static _getInstanceByServerId(int $a_server_id)
save()
Save mapping rules to db.
read()
Read mapping settings from db.
static _getRules($a_server_id)
Get all rules.
static _getInstanceByRuleId(int $a_rule_id)
static _getInstanceByServerId(int $a_server_id)
Get instance of class.
static _getServerList()
Get list of all configured servers.
const LDAP_BIND_ANONYMOUS
static checkLDAPLib()
Check if ldap module is installed.
static _getAllServer()
Get list of all configured servers.
checkAccess(string $permission)
array $attribute_mappings
handleServerTableActionsCmd()
addRoleAutoCompleteObjectCmd()
saveSyncronizationSettingsCmd()
ilLDAPRoleAssignmentRule $role_mapping_rule
readonly ILIAS HTTP GlobalHttpState $http
loadRoleAssignmentRule(int $a_rule_id, bool $load_from_form=true)
getUnsafeGetCommands()
This method must return a list of unsafe GET commands.
readonly ILIAS UI Factory $ui_factory
ilComponentRepository $component_repository
initRoleMappingForm(string $command)
getAttributeMappingKeys()
confirmDeleteRoleMapping()
updateRoleAssignmentCmd()
ilLDAPRoleGroupMappingSettings $role_mapping
checkRoleAssignmentInput(int $a_rule_id=0)
deleteServerSettingsCmd()
array $user_defined_fields
handleRoleMappingTableActionsCmd()
readonly ILIAS Refinery Factory $refinery
confirmDeleteServerSettings()
ilPropertyFormGUI $form_gui
getRoleAssigmentsTableAction()
readonly ILIAS UI Renderer $ui_renderer
handleRoleAssignmentTableActionsCmd()
getRoleMappingsTableAction()
__construct(int $a_auth_ref_id)
prepareGlobalRoleSelection()
readonly ilObjectDataCache $object_data_cache
ilAccessHandler $ilAccess
initFormRoleAssignments(string $a_mode)
ilGlobalTemplateInterface $tpl
getSafePostCommands()
This method must return a list of safe POST commands.
ilLDAPAttributeMapping $mapping
ilGlobalTemplateInterface $main_tpl
ilLDAPRoleAssignmentRule $rule
readonly Profile $profile
This class represents a non editable value in a property form.
static _lookupTitle(int $obj_id)
This class represents an option in a radio group.
class ilRbacReview Contains Review functions of core Rbac.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Readable part of repository interface to ilComponentDataDB.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
form( $class_path, string $cmd, string $submit_caption="")