19 declare(strict_types=1);
69 private readonly \ILIAS\HTTP\GlobalHttpState
$http;
80 $this->
ctrl = $DIC->ctrl();
81 $this->tabs_gui = $DIC->tabs();
82 $this->
lng = $DIC->language();
83 $this->
lng->loadLanguageModule(
'ldap');
84 $this->
lng->loadLanguageModule(
'ui');
85 $this->ilErr = $DIC[
'ilErr'];
87 $this->component_repository = $DIC[
"component.repository"];
88 $this->rbacReview = $DIC->rbac()->review();
89 $this->rbacSystem = $DIC->rbac()->system();
90 $this->
toolbar = $DIC->toolbar();
91 $this->main_tpl = $DIC->ui()->mainTemplate();
92 $this->
http = $DIC->http();
93 $this->ui_factory = $DIC->ui()->factory();
94 $this->ui_renderer = $DIC->ui()->renderer();
96 $this->object_data_cache = $DIC[
'ilObjDataCache'];
98 $this->tpl = $DIC->ui()->mainTemplate();
100 if ($this->
ctrl->getCmd() !==
"addServerSettings") {
101 $this->
ctrl->saveParameter($this,
'ldap_server_id');
104 $http_wrapper = $DIC->http()->wrapper();
105 $is_post_request = $DIC->http()->request()->getMethod() ===
"POST";
106 $refinery = $DIC->refinery();
107 if ($http_wrapper->query()->has(
"rule_id")) {
108 $this->rule_id = $http_wrapper->query()->retrieve(
110 $refinery->kindlyTo()->int()
114 if ($http_wrapper->query()->has(
'ldap_server_id')) {
115 $this->ldap_server_id = $http_wrapper->query()->retrieve(
117 $refinery->kindlyTo()->int()
119 } elseif ($http_wrapper->query()->has(
'ldap_servers_server_id')) {
120 $this->ldap_server_id = $http_wrapper->query()->retrieve(
121 'ldap_servers_server_id',
123 $refinery->kindlyTo()->listOf(
124 $refinery->kindlyTo()->int()
126 $this->
refinery->custom()->constraint(
127 fn($value):
bool => count($value) === 1,
128 $this->
lng->txt(
'select_one')
130 $this->
refinery->custom()->transformation(
131 fn($value):
int => $value[0]
139 if ($http_wrapper->query()->has(
"mapping_id")) {
140 $this->mapping_id = $http_wrapper->query()->retrieve(
142 $refinery->kindlyTo()->int()
145 if ($http_wrapper->query()->has(
'ldap_role_mapping_mapping_ids')) {
146 $this->mappings = $http_wrapper->query()->retrieve(
147 'ldap_role_mapping_mapping_ids',
148 $refinery->kindlyTo()->listOf($refinery->kindlyTo()->string())
150 if ($this->mappings === [
'ALL_OBJECTS']) {
152 $this->mappings =
array_map(
static function (array $mapping):
int {
153 return $mapping[
'mapping_id'];
154 }, $mapping_instance->getMappings());
157 if (count($this->mappings) === 1) {
158 $this->mapping_id = current($this->mappings);
161 if ($http_wrapper->query()->has(
'ldap_role_assignment_rule_ids')) {
162 $this->rule_ids = $http_wrapper->query()->retrieve(
163 'ldap_role_assignment_rule_ids',
164 $refinery->kindlyTo()->listOf($refinery->kindlyTo()->string())
166 if ($this->rule_ids === [
'ALL_OBJECTS']) {
173 if (count($this->rule_ids) === 1) {
174 $this->rule_id = current($this->rule_ids);
177 if ($is_post_request) {
178 if ($http_wrapper->post()->has(
'rule_ids')) {
179 $this->rule_ids = $http_wrapper->post()->retrieve(
181 $refinery->kindlyTo()->listOf($refinery->kindlyTo()->int())
184 if ($http_wrapper->post()->has(
'role_id')) {
185 $this->role_id = $http_wrapper->post()->retrieve(
187 $refinery->kindlyTo()->int()
190 if ($http_wrapper->post()->has(
'rule_id')) {
191 $this->rule_id = $http_wrapper->post()->retrieve(
193 $refinery->kindlyTo()->int()
196 if ($http_wrapper->post()->has(
'mappings')) {
197 $this->mappings = $http_wrapper->post()->retrieve(
199 $refinery->kindlyTo()->listOf($refinery->kindlyTo()->int())
202 if ($http_wrapper->post()->has(
'server_ids')) {
203 $this->server_ids = $http_wrapper->post()->retrieve(
205 $refinery->kindlyTo()->listOf($refinery->kindlyTo()->int())
208 if ($http_wrapper->post()->has(
'mapping_template')) {
209 $this->mapping_template = $http_wrapper->post()->retrieve(
211 $refinery->kindlyTo()->string()
214 if ($http_wrapper->post()->has(
'role_bind_user')) {
217 $refinery->kindlyTo()->string()
220 if ($http_wrapper->post()->has(
'role_bind_pass')) {
223 $refinery->kindlyTo()->string()
226 if ($http_wrapper->post()->has(
'role_sync_active')) {
227 $this->role_sync_active = $http_wrapper->post()->retrieve(
229 $refinery->kindlyTo()->bool()
233 if ($http_wrapper->post()->has($key .
'_value')) {
236 $refinery->kindlyTo()->string()
237 )), $http_wrapper->post()->has($key .
'_update')];
239 $this->attribute_mappings[$key] = [
"",
false];
244 $this->ref_id = $a_auth_ref_id;
252 $next_class = $this->
ctrl->getNextClass($this);
253 $cmd = $this->
ctrl->getCmd();
254 if ($this->
http->wrapper()->query()->has(
'ldap_role_mapping_table_action')) {
255 $cmd = $this->
http->wrapper()->query()->retrieve(
256 'ldap_role_mapping_table_action',
257 $this->
refinery->kindlyTo()->string()
260 if ($this->
http->wrapper()->query()->has(
'ldap_role_assignment_table_action')) {
261 $cmd = $this->
http->wrapper()->query()->retrieve(
262 'ldap_role_assignment_table_action',
263 $this->
refinery->kindlyTo()->string()
267 if ($cmd !==
"serverList" && !$this->rbacSystem->checkAccess(
"visible,read", $this->ref_id)) {
268 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_write'),
true);
269 $this->
ctrl->redirect($this,
"serverList");
271 switch ($next_class) {
284 if (!$this->
ilAccess->checkAccess($a_permission,
'', $this->ref_id)) {
285 $this->ilErr->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->ilErr->WARNING);
300 $keys[] =
'udf_' . $definition[
'field_id'];
320 $this->tabs_gui->activateTab(
'role_assignments');
322 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_assignments.html',
'components/ILIAS/LDAP');
326 $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->
form->getHTML());
330 $this->tpl->setVariable(
'RULES_TBL', $this->ui_renderer->render($this->getRoleAssignmentTable()));
340 if (!$this->rule_id) {
341 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
346 $this->tabs_gui->activateTab(
'role_assignments');
348 $this->
ctrl->setParameter($this,
'rule_id', $this->rule_id);
354 $this->tpl->setContent($this->
form->getHTML());
363 $role_id = $this->role_mapping_rule->getRoleId();
364 if ($this->rbacReview->isGlobalRole($role_id)) {
365 $val[
'role_name'] = 0;
368 $val[
'role_name'] = 1;
371 $val[
'add_missing'] = (
int) $this->role_mapping_rule->isAddOnUpdateEnabled();
372 $val[
'remove_deprecated'] = (
int) $this->role_mapping_rule->isRemoveOnUpdateEnabled();
373 $val[
'type'] = $this->role_mapping_rule->getType();
374 $val[
'dn'] = $this->role_mapping_rule->getDN();
375 $val[
'at'] = $this->role_mapping_rule->getMemberAttribute();
376 $val[
'isdn'] = $this->role_mapping_rule->isMemberAttributeDN();
377 $val[
'name'] = $this->role_mapping_rule->getAttributeName();
378 $val[
'value'] = $this->role_mapping_rule->getAttributeValue();
379 $val[
'plugin_id'] = $this->role_mapping_rule->getPluginId();
381 $this->
form->setValuesByArray($val);
389 if (!$this->
ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
390 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
397 $formWithoutErrors = $this->
form->checkInput();
399 if (!$formWithoutErrors || $roleErrorMessage !==
'') {
400 if ($roleErrorMessage !==
'') {
401 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt($roleErrorMessage));
404 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_assignments.html',
'components/ILIAS/LDAP');
406 $this->
form->setValuesByPost();
407 $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->
form->getHTML());
408 $this->tabs_gui->activateSubTab(
'role_assignments');
414 $this->
ctrl->redirect($this,
'showRoleSelection');
416 $this->rule->update();
417 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
431 if (!$this->rule_ids) {
432 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
437 $this->tabs_gui->activateTab(
'role_assignments');
442 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteRules"));
443 $c_gui->setHeaderText($this->
lng->txt(
"ldap_confirm_del_role_ass"));
444 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"roleAssignments");
445 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteRules");
448 foreach ($this->rule_ids as $rule_id) {
452 $this->tpl->setContent($c_gui->getHTML());
460 if (!$this->rule_ids) {
461 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_once'));
465 foreach ($this->rule_ids as $rule_id) {
469 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'ldap_deleted_rule'));
470 $this->
ctrl->redirect($this,
'roleAssignments');
478 if (!$this->
ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
479 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
485 $formWithoutErrors = $this->
form->checkInput();
487 if (!$formWithoutErrors || $roleErrorMessage !==
'') {
488 if ($roleErrorMessage !==
'') {
489 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt($roleErrorMessage));
492 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_assignments.html',
'components/ILIAS/LDAP');
495 $this->
form->setValuesByPost();
496 $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->
form->getHTML());
497 $this->tpl->setVariable(
'RULES_TBL', $this->ui_renderer->render($this->getRoleAssignmentTable()));
498 $this->tabs_gui->activateSubTab(
'role_assignments');
503 $this->
ctrl->redirect($this,
'showRoleSelection');
505 $this->rule->create();
506 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
507 $this->
ctrl->redirect($this,
'roleAssignments');
514 if ($this->rule->getRoleId() > 0) {
518 $rule[
'server_id'] = $this->
getServer()->getServerId();
519 $rule[
'rule_id'] = $this->rule_id ?: 0;
520 $rule[
'role_search'] = $this->
form->getInput(
'role_search');
521 $rule[
'add_on_update'] = $this->
form->getInput(
'add_missing');
522 $rule[
'remove_on_update'] = $this->
form->getInput(
'remove_deprecated');
523 $rule[
'type'] = $this->
form->getInput(
'type');
524 $rule[
'dn'] = $this->
form->getInput(
'dn');
525 $rule[
'at'] = $this->
form->getInput(
'at');
526 $rule[
'isdn'] = $this->
form->getInput(
'isdn');
527 $rule[
'name'] = $this->
form->getInput(
'name');
528 $rule[
'value'] = $this->
form->getInput(
'value');
529 $rule[
'plugin'] = $this->
form->getInput(
'plugin_id');
531 $this->
ctrl->saveParameter($this,
'rule_id');
543 $this->tabs_gui->activateTab(
'role_assignment');
544 $this->
ctrl->saveParameter($this,
'rule_id');
547 $parser->setMinWordLength(1);
552 $object_search->setFilter(array(
'role'));
553 $res = $object_search->performSearch();
555 $entries =
$res->getEntries();
558 $table->setTitle($this->
lng->txt(
'ldap_role_selection'));
559 $table->addMultiCommand(
'saveRoleSelection', $this->
lng->txt(
'ldap_choose_role'));
560 $table->parse($entries);
562 $this->tpl->setContent($table->getHTML());
572 if (!$this->
ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
573 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
578 if (!$this->role_id) {
579 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
585 $this->rule->setRoleId($this->role_id);
587 if ($this->rule_id) {
588 $this->rule->update();
590 $this->rule->create();
593 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
605 $this->rule->validate();
606 return $this->ilErr->getMessage();
616 $this->
http->request(),
620 $this->
server->getServerId(),
633 if (is_object($this->rule)) {
639 if ($load_from_form) {
640 if ($this->
form->getInput(
'role_name') ===
'0') {
641 $this->rule->setRoleId((
int) $this->
form->getInput(
'role_id'));
642 } elseif ($this->
form->getInput(
'role_search')) {
651 $object_search->setFilter(array(
'role'));
652 $res = $object_search->performSearch();
654 $entries =
$res->getEntries();
655 if (count($entries) === 1) {
656 $role = current($entries);
657 $this->rule->setRoleId($role[
'obj_id']);
658 } elseif (count($entries) > 1) {
659 $this->rule->setRoleId(-1);
663 $this->rule->setAttributeName($this->
form->getInput(
'name'));
664 $this->rule->setAttributeValue($this->
form->getInput(
'value'));
665 $this->rule->setDN($this->
form->getInput(
'dn'));
666 $this->rule->setMemberAttribute($this->
form->getInput(
'at'));
667 $this->rule->setMemberIsDN((
bool) $this->
form->getInput(
'isdn'));
668 $this->rule->enableAddOnUpdate((
bool) $this->
form->getInput(
'add_missing'));
669 $this->rule->enableRemoveOnUpdate((
bool) $this->
form->getInput(
'remove_deprecated'));
670 $this->rule->setPluginId((
int) $this->
form->getInput(
'plugin_id'));
671 $this->rule->setType((
int) $this->
form->getInput(
'type'));
672 $this->rule->setServerId($this->
getServer()->getServerId());
677 $this->rule->setServerId($this->
getServer()->getServerId());
678 $rule = unserialize(
ilSession::get(
'ldap_role_ass'), [
"allowed_classes" =>
false]);
680 $this->rule->enableAddOnUpdate((
bool) ($rule[
'add_on_update'] ??
false));
681 $this->rule->enableRemoveOnUpdate((
bool) ($rule[
'remove_on_update'] ??
false));
695 if (!$this->mappings) {
696 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
703 foreach ($this->mappings as $mapping_id) {
704 $this->role_mapping->delete($mapping_id);
706 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'ldap_deleted_role_mapping'));
713 if (!$this->mapping_template) {
719 $this->mapping->clearRules();
722 $this->mapping->setRule($key, $value,
false);
730 $this->tabs_gui->activateTab(
'role_mapping');
733 $this->mapping->setRule(
735 $this->attribute_mappings[$key][0],
736 $this->attribute_mappings[$key][1]
740 foreach ($this->udf->getDefinitions() as $definition) {
741 $key =
'udf_' . $definition[
'field_id'];
742 $this->mapping->setRule(
744 $this->attribute_mappings[$key][0],
745 $this->attribute_mappings[$key][1]
749 $this->mapping->save();
752 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
757 $action = $this->
http->wrapper()->query()->retrieve(
758 'ldap_servers_table_action',
760 $this->refinery->kindlyTo()->string(),
769 default => $this->
ctrl->redirect($this,
'serverList'),
775 if (!$this->rbacSystem->checkAccess(
'visible,read', $this->ref_id)) {
776 $this->ilErr->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->ilErr->WARNING);
780 $this->main_tpl->setOnScreenMessage(
'failure',
'Missing LDAP libraries. Please ensure that the PHP LDAP module is installed on your server.');
783 if ($this->rbacSystem->checkAccess(
'write', $this->ref_id)) {
785 $this->
lng->txt(
'add_ldap_server'),
786 $this->
ctrl->getLinkTarget($this,
'addServerSettings')
790 $table = new \ILIAS\LDAP\Server\UI\ServerTable(
797 $this->
http->request(),
798 new \ILIAS\Data\Factory(),
799 'handleServerTableActions',
800 $this->rbacSystem->checkAccess(
'write', $this->ref_id)
803 $this->tpl->setContent($this->ui_renderer->render($table->getComponent()));
808 $this->form_gui->setValuesByArray(array(
809 'active' => $this->
server->isActive(),
810 'ds' => !$this->
server->isAuthenticationEnabled(),
811 'server_name' => $this->
server->getName(),
812 'server_url' => $this->
server->getUrlString(),
813 'version' => $this->
server->getVersion(),
814 'base_dn' => $this->
server->getBaseDN(),
815 'referrals' => $this->
server->isActiveReferrer(),
816 'tls' => $this->
server->isActiveTLS(),
817 'binding_type' => $this->
server->getBindingType(),
818 'bind_dn' => $this->
server->getBindUser(),
819 'bind_pass' => $this->
server->getBindPassword(),
820 'bind_pass_retype' => $this->
server->getBindPassword(),
821 'search_base' => $this->
server->getSearchBase(),
822 'user_scope' => $this->
server->getUserScope(),
823 'user_attribute' => $this->
server->getUserAttribute(),
824 'filter' => $this->
server->getFilter(),
825 'group_dn' => $this->
server->getGroupDN(),
826 'group_scope' => $this->
server->getGroupScope(),
827 'group_filter' => $this->
server->getGroupFilter(),
828 'group_member' => $this->
server->getGroupMember(),
829 'memberisdn' => $this->
server->enabledGroupMemberIsDN(),
830 'group' => $this->
server->getGroupName(),
831 'group_attribute' => $this->
server->getGroupAttribute(),
832 'group_optional' => $this->
server->isMembershipOptional(),
833 'group_user_filter' => $this->
server->getGroupUserFilter(),
834 'sync_on_login' => $this->
server->enabledSyncOnLogin(),
835 'sync_per_cron' => $this->
server->enabledSyncPerCron(),
837 'migration' => (
int) $this->
server->isAccountMigrationEnabled(),
838 "name_filter" => $this->
server->getUsernameFilter(),
839 'escape_dn' => $this->
server->enabledEscapeDN()
846 $this->form_gui->setFormAction($this->
ctrl->getFormAction($this,
'save'));
847 $this->form_gui->setTitle($this->
lng->txt(
'ldap_configure'));
850 $active->setValue(
"1");
851 $this->form_gui->addItem($active);
855 $ds->setInfo($this->
lng->txt(
'ldap_as_ds_info'));
856 $this->form_gui->addItem($ds);
858 $servername =
new ilTextInputGUI($this->
lng->txt(
'ldap_server_name'),
'server_name');
859 $servername->setRequired(
true);
860 $servername->setInfo($this->
lng->txt(
'ldap_server_name_info'));
861 $servername->setSize(32);
862 $servername->setMaxLength(32);
863 $this->form_gui->addItem($servername);
866 $namefilter =
new ilTextInputGUI($this->
lng->txt(
'ldap_username_filter'),
"name_filter");
867 $namefilter->setInfo($this->
lng->txt(
"ldap_username_filter_info"));
868 $namefilter->setSize(64);
869 $namefilter->setMaxLength(255);
870 $this->form_gui->addItem($namefilter);
874 $serverurl->setRequired(
true);
875 $serverurl->setInfo($this->
lng->txt(
'ldap_server_url_info'));
876 $serverurl->setSize(64);
877 $serverurl->setMaxLength(255);
878 $this->form_gui->addItem($serverurl);
881 $version->setOptions(array(2 => 2, 3 => 3));
882 $version->setInfo($this->
lng->txt(
'ldap_server_version_info'));
886 $basedsn->setRequired(
true);
887 $basedsn->setSize(64);
888 $basedsn->setMaxLength(255);
889 $this->form_gui->addItem($basedsn);
892 $referrals->setValue(
"1");
893 $referrals->setInfo($this->
lng->txt(
'ldap_referrals_info'));
894 $this->form_gui->addItem($referrals);
897 $section_security->setTitle($this->
lng->txt(
'ldap_server_security_settings'));
898 $this->form_gui->addItem($section_security);
902 $this->form_gui->addItem($tls);
906 $binding->addOption($anonymous);
910 $dn->setMaxLength(255);
911 $user->addSubItem($dn);
915 $pass->setMaxLength(100);
916 $user->addSubItem($pass);
917 $binding->addOption($user);
918 $this->form_gui->addItem($binding);
921 $section_auth->setTitle($this->
lng->txt(
'ldap_authentication_settings'));
922 $this->form_gui->addItem($section_auth);
924 $search_base =
new ilTextInputGUI($this->
lng->txt(
'ldap_user_dn'),
'search_base');
925 $search_base->setInfo($this->
lng->txt(
'ldap_search_base_info'));
926 $search_base->setSize(64);
927 $search_base->setMaxLength(255);
928 $this->form_gui->addItem($search_base);
933 $user_scope->setInfo($this->
lng->txt(
'ldap_user_scope_info'));
934 $this->form_gui->addItem($user_scope);
936 $user_attribute =
new ilTextInputGUI($this->
lng->txt(
'ldap_user_attribute'),
'user_attribute');
937 $user_attribute->setSize(16);
938 $user_attribute->setMaxLength(64);
939 $user_attribute->setRequired(
true);
940 $this->form_gui->addItem($user_attribute);
943 $filter->setInfo($this->
lng->txt(
'ldap_filter_info'));
944 $filter->setSize(64);
945 $filter->setMaxLength(512);
946 $this->form_gui->addItem($filter);
949 $section_restrictions->setTitle($this->
lng->txt(
'ldap_group_restrictions'));
950 $this->form_gui->addItem($section_restrictions);
952 $group_dn =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_search_base'),
'group_dn');
953 $group_dn->setInfo($this->
lng->txt(
'ldap_group_dn_info'));
954 $group_dn->setSize(64);
955 $group_dn->setMaxLength(255);
956 $this->form_gui->addItem($group_dn);
961 $group_scope->setInfo($this->
lng->txt(
'ldap_group_scope_info'));
962 $this->form_gui->addItem($group_scope);
964 $group_filter =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_filter'),
'group_filter');
965 $group_filter->setInfo($this->
lng->txt(
'ldap_group_filter_info'));
966 $group_filter->setSize(64);
967 $group_filter->setMaxLength(255);
968 $this->form_gui->addItem($group_filter);
970 $group_member =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_member'),
'group_member');
971 $group_member->setInfo($this->
lng->txt(
'ldap_group_member_info'));
972 $group_member->setSize(32);
973 $group_member->setMaxLength(255);
974 $this->form_gui->addItem($group_member);
978 #$group_member_isdn->setInfo($this->lng->txt('ldap_group_member_info')); 979 $this->form_gui->addItem($group_member_isdn);
980 #$group_member->addSubItem($group_member_isdn); 983 $escapedn->setValue(
"1");
984 $escapedn->setInfo($this->
lng->txt(
'ldap_escapedn_info'));
985 $this->form_gui->addItem($escapedn);
988 $group->setInfo($this->
lng->txt(
'ldap_group_name_info'));
990 $group->setMaxLength(255);
991 $this->form_gui->addItem($group);
993 $group_atrr =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_attribute'),
'group_attribute');
994 $group_atrr->setInfo($this->
lng->txt(
'ldap_group_attribute_info'));
995 $group_atrr->setSize(16);
996 $group_atrr->setMaxLength(64);
997 $this->form_gui->addItem($group_atrr);
999 $group_optional =
new ilCheckboxInputGUI($this->
lng->txt(
'ldap_group_membership'),
'group_optional');
1000 $group_optional->setOptionTitle($this->
lng->txt(
'ldap_group_member_optional'));
1001 $group_optional->setInfo($this->
lng->txt(
'ldap_group_optional_info'));
1002 $group_optional->setValue(
"1");
1003 $group_user_filter =
new ilTextInputGUI($this->
lng->txt(
'ldap_group_user_filter'),
'group_user_filter');
1004 $group_user_filter->setSize(64);
1005 $group_user_filter->setMaxLength(255);
1006 $group_optional->addSubItem($group_user_filter);
1007 $this->form_gui->addItem($group_optional);
1010 $section_sync->setTitle($this->
lng->txt(
'ldap_user_sync'));
1011 $this->form_gui->addItem($section_sync);
1015 $sync_on_login->setValue(
"1");
1018 $sync_per_cron->setValue(
"1");
1019 $ci_gui->addSubItem($sync_per_cron);
1020 $ci_gui->setInfo($this->
lng->txt(
'ldap_user_sync_info'));
1021 $this->form_gui->addItem($ci_gui);
1023 $global_role =
new ilSelectInputGUI($this->
lng->txt(
'ldap_global_role_assignment'),
'global_role');
1025 $global_role->setInfo($this->
lng->txt(
'ldap_global_role_info'));
1026 $this->form_gui->addItem($global_role);
1029 $migr->setInfo($this->
lng->txt(
'auth_ldap_migration_info'));
1030 $migr->setValue(
"1");
1031 $this->form_gui->addItem($migr);
1039 $this->form_gui->addCommandButton(
'save', $this->
lng->txt(
'save'));
1040 if ($this->
ctrl->getCmd() ===
"addServerSettings") {
1041 $this->form_gui->addCommandButton(
'serverList', $this->
lng->txt(
'cancel'));
1051 $this->tabs_gui->setTabActive(
'settings');
1054 if ($this->form_gui->checkInput()) {
1055 $this->
server->toggleActive((
bool) $this->form_gui->getInput(
'active'));
1056 $this->
server->enableAuthentication(!(
bool) $this->form_gui->getInput(
'ds'));
1057 $this->
server->setName($this->form_gui->getInput(
'server_name'));
1058 $this->
server->setUrl($this->form_gui->getInput(
'server_url'));
1059 $this->
server->setVersion((
int) $this->form_gui->getInput(
'version'));
1060 $this->
server->setBaseDN($this->form_gui->getInput(
'base_dn'));
1061 $this->
server->toggleReferrer((
bool) $this->form_gui->getInput(
'referrals'));
1062 $this->
server->toggleTLS((
bool) $this->form_gui->getInput(
'tls'));
1063 $this->
server->setBindingType((
int) $this->form_gui->getInput(
'binding_type'));
1064 $this->
server->setBindUser($this->form_gui->getInput(
'bind_dn'));
1065 $this->
server->setBindPassword($this->form_gui->getInput(
'bind_pass'));
1066 $this->
server->setSearchBase($this->form_gui->getInput(
'search_base'));
1067 $this->
server->setUserScope((
int) $this->form_gui->getInput(
'user_scope'));
1068 $this->
server->setUserAttribute($this->form_gui->getInput(
'user_attribute'));
1069 $this->
server->setFilter($this->form_gui->getInput(
'filter'));
1070 $this->
server->setGroupDN($this->form_gui->getInput(
'group_dn'));
1071 $this->
server->setGroupScope((
int) $this->form_gui->getInput(
'group_scope'));
1072 $this->
server->setGroupFilter($this->form_gui->getInput(
'group_filter'));
1073 $this->
server->setGroupMember($this->form_gui->getInput(
'group_member'));
1074 $this->
server->enableGroupMemberIsDN((
bool) $this->form_gui->getInput(
'memberisdn'));
1075 $this->
server->setGroupName($this->form_gui->getInput(
'group'));
1076 $this->
server->setGroupAttribute($this->form_gui->getInput(
'group_attribute'));
1077 $this->
server->setGroupUserFilter($this->form_gui->getInput(
'group_user_filter'));
1078 $this->
server->toggleMembershipOptional((
bool) $this->form_gui->getInput(
'group_optional'));
1079 $this->
server->enableSyncOnLogin((
bool) $this->form_gui->getInput(
'sync_on_login'));
1080 $this->
server->enableSyncPerCron((
bool) $this->form_gui->getInput(
'sync_per_cron'));
1081 $this->
server->setGlobalRole((
int) $this->form_gui->getInput(
'global_role'));
1082 $this->
server->enableAccountMigration((
bool) $this->form_gui->getInput(
'migration'));
1083 $this->
server->setUsernameFilter($this->form_gui->getInput(
"name_filter"));
1084 $this->
server->enableEscapeDN((
bool) $this->form_gui->getInput(
'escape_dn'));
1085 if (!$this->
server->validate()) {
1086 $this->main_tpl->setOnScreenMessage(
'failure', $this->ilErr->getMessage());
1087 $this->form_gui->setValuesByPost();
1088 $this->tpl->setContent($this->form_gui->getHTML());
1093 if ($this->
server->getServerId()) {
1101 $this->mapping->setRule(
'global_role', (
string) $this->form_gui->getInput(
'global_role'),
false);
1102 $this->mapping->save();
1104 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1105 $this->
ctrl->redirect($this,
'serverList');
1109 $this->form_gui->setValuesByPost();
1110 $this->tpl->setContent($this->form_gui->getHTML());
1121 $this->tabs_gui->clearTargets();
1123 $this->tabs_gui->setBackTarget(
1124 $this->
lng->txt(
"back"),
1125 $this->
ctrl->getLinkTarget($this,
'serverList')
1129 $this->tabs_gui->addTab(
1131 $this->
lng->txt(
"ldap_settings"),
1132 $this->
ctrl->getLinkTarget($this,
'editServerSettings')
1140 $this->tabs_gui->addTab(
1142 $this->
lng->txt(
"ldap_user_mapping"),
1143 $this->
ctrl->getLinkTarget($this,
'userMapping')
1146 $this->tabs_gui->addTab(
1148 $this->
lng->txt(
'ldap_role_assignments'),
1149 $this->
ctrl->getLinkTarget($this,
'roleAssignments')
1152 $this->tabs_gui->addTab(
1154 $this->
lng->txt(
"ldap_role_mapping"),
1155 $this->
ctrl->getLinkTarget($this,
'roleMapping')
1163 if ($this->ldap_server_id) {
1187 $this->rbacReview->getGlobalRoles(),
1193 $select[0] = $this->
lng->txt(
'links_select_one');
1194 foreach ($global_roles as $role_id) {
1202 return array(
'gender' => $this->
lng->txt(
'gender'),
1203 'firstname' => $this->
lng->txt(
'firstname'),
1204 'lastname' => $this->
lng->txt(
'lastname'),
1205 'title' => $this->
lng->txt(
'person_title'),
1206 'institution' => $this->
lng->txt(
'institution'),
1207 'department' => $this->
lng->txt(
'department'),
1208 'street' => $this->
lng->txt(
'street'),
1209 'city' => $this->
lng->txt(
'city'),
1210 'zipcode' => $this->
lng->txt(
'zipcode'),
1211 'country' => $this->
lng->txt(
'country'),
1212 'phone_office' => $this->
lng->txt(
'phone_office'),
1213 'phone_home' => $this->
lng->txt(
'phone_home'),
1214 'phone_mobile' => $this->
lng->txt(
'phone_mobile'),
1215 'fax' => $this->
lng->txt(
'fax'),
1216 'email' => $this->
lng->txt(
'email'),
1217 'second_email' => $this->
lng->txt(
'second_email'),
1218 'hobby' => $this->
lng->txt(
'hobby'),
1219 'matriculation' => $this->
lng->txt(
'matriculation'));
1230 $this->mapping_template,
1232 [0 => $this->
lng->txt(
'ldap_mapping_template'),
1233 "inetOrgPerson" =>
'inetOrgPerson',
1234 "organizationalPerson" =>
'organizationalPerson',
1235 "person" =>
'person',
1236 "ad_2003" =>
'Active Directory (Win 2003)' 1251 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1255 $this->
form->setTitle($this->
lng->txt(
'ldap_edit_role_ass_rule'));
1256 $this->
form->addCommandButton(
'updateRoleAssignment', $this->
lng->txt(
'save'));
1260 $this->
form->setTitle($this->
lng->txt(
'ldap_add_role_ass_rule'));
1261 $this->
form->addCommandButton(
'addRoleAssignment', $this->
lng->txt(
'ldap_btn_add_role_ass'));
1272 $role->addOption($global);
1276 $global->addSubItem($role_select);
1280 $role->addOption($local);
1283 $role_search->setSize(40);
1284 $local->addSubItem($role_search);
1286 $role->setInfo($this->
lng->txt(
'ldap_role_name_info'));
1287 $this->
form->addItem($role);
1291 $update->setValue($this->
lng->txt(
'ldap_check_role_assignment'));
1294 $add->setOptionTitle($this->
lng->txt(
'ldap_add_missing'));
1295 $update->addSubItem($add);
1298 $remove->setOptionTitle($this->
lng->txt(
'ldap_remove_deprecated'));
1299 $update->addSubItem($remove);
1301 $this->
form->addItem($update);
1307 #$group->setValue($current_rule->getType()); 1314 #$dn->setValue($current_rule->getDN()); 1316 $dn->setMaxLength(512);
1317 $dn->setInfo($this->
lng->txt(
'ldap_role_grp_dn_info'));
1318 $radio_group->addSubItem($dn);
1320 #$at->setValue($current_rule->getMemberAttribute()); 1322 $at->setMaxLength(128);
1323 $radio_group->addSubItem($at);
1325 #$isdn->setChecked($current_rule->isMemberAttributeDN()); 1326 $isdn->setInfo($this->
lng->txt(
'ldap_group_member_info'));
1327 $radio_group->addSubItem($isdn);
1328 $radio_group->setInfo($this->
lng->txt(
'ldap_role_grp_info'));
1330 $group->addOption($radio_group);
1335 #$name->setValue($current_rule->getAttributeName()); 1337 $name->setMaxLength(128);
1338 #$name->setInfo($this->lng->txt('ldap_role_at_name_info')); 1339 $radio_attribute->addSubItem($name);
1343 #$val->setValue($current_rule->getAttributeValue()); 1345 $val->setMaxLength(128);
1346 #$val->setInfo($this->lng->txt('ldap_role_at_value_info')); 1347 $radio_attribute->addSubItem($val);
1348 $radio_attribute->setInfo($this->
lng->txt(
'ldap_role_at_info'));
1350 $group->addOption($radio_attribute);
1353 $pl_active = $this->component_repository->getPluginSlotById(
"ldaphk")->hasActivePlugins();
1356 $pl->
setInfo($this->
lng->txt(
'ldap_plugin_info'));
1357 $pl->setDisabled(!$pl_active);
1360 $id->setDisabled(!$pl_active);
1362 $id->setMaxLength(3);
1363 $id->setMaxValue(999);
1364 $id->setMinValue(1);
1365 $pl->addSubItem(
$id);
1367 $group->addOption($pl);
1368 $this->
form->addItem($group);
1386 $select_form->setPostVar(
"mapping_template");
1388 "" => $this->
lng->txt(
'ldap_mapping_template'),
1389 "inetOrgPerson" =>
'inetOrgPerson',
1390 "organizationalPerson" =>
'organizationalPerson',
1391 "person" =>
'person',
1392 "ad_2003" =>
'Active Directory (Win 2003)');
1393 $select_form->setOptions($options);
1394 $select_form->setValue($this->mapping_template);
1396 $this->
toolbar->addInputItem($select_form);
1397 $this->
toolbar->addFormButton($this->
lng->txt(
'show'),
"chooseMapping");
1398 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this,
"chooseMapping"));
1407 $propertie_form->setTitle($this->
lng->txt(
'ldap_mapping_table'));
1408 $propertie_form->setFormAction($this->
ctrl->getFormAction($this,
'saveMapping'));
1409 $propertie_form->addCommandButton(
'saveMapping', $this->
lng->txt(
'save'));
1413 $text_form->setPostVar($mapping .
"_value");
1414 $text_form->setValue($this->mapping->getValue($mapping));
1415 $text_form->setSize(32);
1416 $text_form->setMaxLength(255);
1417 $propertie_form->addItem($text_form);
1420 $checkbox_form->setPostVar($mapping .
"_update");
1421 $checkbox_form->setChecked($this->mapping->enabledUpdate($mapping));
1422 $checkbox_form->setOptionTitle($this->
lng->txt(
'ldap_update_field_info'));
1423 $propertie_form->addItem($checkbox_form);
1427 foreach ($this->udf->getDefinitions() as $definition) {
1429 $text_form->setPostVar(
'udf_' . $definition[
'field_id'] .
'_value');
1430 $text_form->setValue($this->mapping->getValue(
'udf_' . $definition[
'field_id']));
1431 $text_form->setSize(32);
1432 $text_form->setMaxLength(255);
1433 $propertie_form->addItem($text_form);
1436 $checkbox_form->setPostVar(
'udf_' . $definition[
'field_id'] .
'_update');
1437 $checkbox_form->setChecked($this->mapping->enabledUpdate(
'udf_' . $definition[
'field_id']));
1438 $checkbox_form->setOptionTitle($this->
lng->txt(
'ldap_update_field_info'));
1439 $propertie_form->addItem($checkbox_form);
1442 return $propertie_form;
1451 $this->tabs_gui->setTabActive(
'role_mapping');
1453 $this->
lng->txt(
"ldap_new_role_assignment"),
1454 $this->
ctrl->getLinkTarget($this,
'addRoleMapping')
1459 $propertie_form->setTitle($this->
lng->txt(
'ldap_role_settings'));
1460 $propertie_form->setFormAction($this->
ctrl->getFormAction($this,
"saveSyncronizationSettings"));
1461 $propertie_form->addCommandButton(
"saveSyncronizationSettings", $this->
lng->txt(
'save'));
1463 $role_active->setPostVar(
'role_sync_active');
1464 $role_active->setChecked($this->
server->enabledRoleSynchronization());
1465 $propertie_form->addItem($role_active);
1467 $binding->
setInfo($this->
lng->txt(
'ldap_role_bind_user_info'));
1469 $user->setPostVar(
"role_bind_user");
1470 $user->setValue($this->
server->getRoleBindDN());
1472 $user->setMaxLength(255);
1473 $binding->addCombinationItem(
"0", $user, $this->
lng->txt(
'ldap_role_bind_user'));
1476 $pass->setPostVar(
"role_bind_pass");
1477 $pass->setValue($this->
server->getRoleBindPassword());
1479 $pass->setMaxLength(100);
1480 $pass->setRetype(
false);
1481 $binding->addCombinationItem(
"1", $pass, $this->
lng->txt(
'ldap_role_bind_pass'));
1483 $propertie_form->addItem($binding);
1485 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_mappings.html',
'components/ILIAS/LDAP');
1486 $this->tpl->setVariable(
"NEW_ASSIGNMENT_TBL", $propertie_form->getHTML());
1489 $this->
http->request(),
1493 $this->
server->getServerId(),
1497 $this->tpl->setVariable(
'RULES_TBL', $this->ui_renderer->render($table->getComponent()));
1509 $propertie_form->setTitle($this->
lng->txt(
'ldap_edit_role_assignment'));
1510 if ($propertie_form->getItemByPostVar(
"url")) {
1511 $propertie_form->getItemByPostVar(
"url")->setValue($mapping->getURL());
1513 if ($propertie_form->getItemByPostVar(
"dn")) {
1514 $propertie_form->getItemByPostVar(
"dn")->setValue($mapping->getDN());
1516 if ($propertie_form->getItemByPostVar(
"member")) {
1517 $propertie_form->getItemByPostVar(
"member")->setValue($mapping->getMemberAttribute());
1519 if ($propertie_form->getItemByPostVar(
"memberisdn")) {
1520 $propertie_form->getItemByPostVar(
"memberisdn")->setChecked($mapping->getMemberISDN());
1522 if ($propertie_form->getItemByPostVar(
"role")) {
1523 $propertie_form->getItemByPostVar(
"role")->setValue($mapping->getRoleName());
1525 if ($propertie_form->getItemByPostVar(
"info")) {
1526 $propertie_form->getItemByPostVar(
"info")->setValue($mapping->getMappingInfo());
1528 if ($propertie_form->getItemByPostVar(
"info_type")) {
1529 $propertie_form->getItemByPostVar(
"info_type")->setChecked($mapping->getMappingInfoType());
1532 $this->tpl->setContent($propertie_form->getHTML());
1544 if ($propertie_form->checkInput() && $this->rbacReview->roleExists($propertie_form->getInput(
"role"))) {
1546 $mapping->setServerId($this->
server->getServerId());
1547 $mapping->setURL($propertie_form->getInput(
"url"));
1548 $mapping->setDN($propertie_form->getInput(
"dn"));
1549 $mapping->setMemberAttribute($propertie_form->getInput(
"member"));
1550 $mapping->setMemberISDN((
bool) $propertie_form->getInput(
"memberisdn"));
1551 $mapping->setRoleByName($propertie_form->getInput(
"role"));
1552 $mapping->setMappingInfo($propertie_form->getInput(
"info"));
1553 $mapping->setMappingInfoType((
bool) $propertie_form->getInput(
"info_type"));
1556 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1557 $this->
ctrl->redirect($this,
"roleMapping");
1559 if (!$this->rbacReview->roleExists($propertie_form->getInput(
"role"))) {
1560 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"ldap_role_not_exists") .
" " .
1561 $propertie_form->getInput(
"role"));
1563 $propertie_form->setValuesByPost();
1564 $this->tpl->setContent($propertie_form->getHTML());
1573 if (!$this->mappings) {
1574 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
1575 $this->
ctrl->redirect($this,
"roleMapping");
1582 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteRoleMapping"));
1583 $c_gui->setHeaderText($this->
lng->txt(
"ldap_confirm_del_role_ass"));
1584 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"roleMapping");
1585 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteRoleMapping");
1587 foreach ($this->mappings as
$id) {
1590 $txt = $this->
lng->txt(
'obj_role') .
": " . $mapping->getRoleName() .
", ";
1591 $txt .= $this->
lng->txt(
'ldap_group_dn') .
": " . $mapping->getDN() .
", ";
1592 $txt .= $this->
lng->txt(
'ldap_server_short') .
" " . $mapping->getURL() .
", ";
1593 $txt .= $this->
lng->txt(
'ldap_group_member_short') .
" " . $mapping->getMemberAttribute();
1595 $c_gui->addItem(
"mappings[]", (
string) $id,
$txt);
1597 $this->tpl->setContent($c_gui->getHTML());
1604 $this->
ctrl->clearParameters($this);
1607 $this->tpl->setContent($this->form_gui->getHTML());
1615 $this->tabs_gui->setTabActive(
'settings');
1619 $this->tpl->setContent($this->form_gui->getHTML());
1630 if (!$this->ldap_server_id) {
1631 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
1639 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteServerSettings"));
1640 $c_gui->setHeaderText($this->
lng->txt(
"ldap_confirm_del_server_settings"));
1641 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"serverList");
1642 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteServerSettings");
1646 $c_gui->addItem(
'server_ids[]', (
string) $setting->getServerId(), $setting->getName());
1648 $this->tpl->setContent($c_gui->getHTML());
1656 if (!$this->server_ids) {
1657 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
1662 foreach ($this->server_ids as $server_id) {
1666 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'deleted'));
1667 $this->
ctrl->redirect($this,
"serverlist");
1678 $this->tabs_gui->activateTab(
'user_mapping');
1683 $this->tpl->setContent($propertie_form->getHTML());
1692 $this->
server->toggleActive(
true);
1701 $this->
server->toggleActive(
false);
1716 $this->tabs_gui->activateTab(
'role_mapping');
1718 if ($this->mapping_id) {
1719 $this->
ctrl->setParameter($this,
'mapping_id', $this->mapping_id);
1723 $propertie_form->setTitle($this->
lng->txt(
'ldap_mapping_table'));
1724 $propertie_form->setFormAction($this->
ctrl->getFormAction($this, $command));
1725 $propertie_form->addCommandButton($command, $this->
lng->txt(
'save'));
1726 $propertie_form->addCommandButton(
"roleMapping", $this->
lng->txt(
'cancel'));
1729 $url->setPostVar(
"url");
1731 $url->setMaxLength(255);
1732 $url->setRequired(
true);
1735 $group_dn->setPostVar(
"dn");
1736 $group_dn->setSize(50);
1737 $group_dn->setMaxLength(255);
1738 $group_dn->setInfo($this->
lng->txt(
'ldap_dn_info'));
1739 $group_dn->setRequired(
true);
1742 $member->setPostVar(
"member");
1743 $member->setSize(32);
1744 $member->setMaxLength(255);
1745 $member->setInfo($this->
lng->txt(
'ldap_member_info'));
1746 $member->setRequired(
true);
1749 $member_isdn->setPostVar(
"memberisdn");
1750 $member_isdn->setOptionTitle($this->
lng->txt(
'ldap_memberisdn'));
1753 $role->setPostVar(
"role");
1755 $role->setMaxLength(255);
1756 $role->setInfo($this->
lng->txt(
'ldap_role_info'));
1757 $role->setRequired(
true);
1760 $info->setPostVar(
"info");
1763 $info->setInfo($this->
lng->txt(
'ldap_info_text_info'));
1766 $info_type->setPostVar(
"info_type");
1767 $info_type->setOptionTitle($this->
lng->txt(
'ldap_mapping_info_type'));
1769 $propertie_form->addItem(
$url);
1770 $propertie_form->addItem($group_dn);
1771 $propertie_form->addItem($member);
1772 $propertie_form->addItem($member_isdn);
1773 $propertie_form->addItem($role);
1774 $propertie_form->addItem(
$info);
1775 $propertie_form->addItem($info_type);
1777 return $propertie_form;
1788 if ($propertie_form->getItemByPostVar(
"url")) {
1789 $propertie_form->getItemByPostVar(
"url")->setValue($this->
server->getUrl());
1791 if ($this->mapping_id) {
1794 if ($propertie_form->getItemByPostVar(
"url")) {
1795 $propertie_form->getItemByPostVar(
"url")->setValue($mapping->getURL());
1797 if ($propertie_form->getItemByPostVar(
"dn")) {
1798 $propertie_form->getItemByPostVar(
"dn")->setValue($mapping->getDN());
1800 if ($propertie_form->getItemByPostVar(
"member")) {
1801 $propertie_form->getItemByPostVar(
"member")->setValue($mapping->getMemberAttribute());
1803 if ($propertie_form->getItemByPostVar(
"memberisdn")) {
1804 $propertie_form->getItemByPostVar(
"memberisdn")->setChecked($mapping->getMemberISDN());
1806 if ($propertie_form->getItemByPostVar(
"role")) {
1807 $propertie_form->getItemByPostVar(
"role")->setValue($mapping->getRoleName());
1809 if ($propertie_form->getItemByPostVar(
"info")) {
1810 $propertie_form->getItemByPostVar(
"info")->setValue($mapping->getMappingInfo());
1812 if ($propertie_form->getItemByPostVar(
"info_type")) {
1813 $propertie_form->getItemByPostVar(
"info_type")->setChecked($mapping->getMappingInfoType());
1817 $this->tpl->setContent($propertie_form->getHTML());
1828 if ($propertie_form->checkInput() && $this->rbacReview->roleExists($propertie_form->getInput(
"role"))) {
1830 $mapping->setServerId($this->
server->getServerId());
1831 $mapping->setURL($propertie_form->getInput(
"url"));
1832 $mapping->setDN($propertie_form->getInput(
"dn"));
1833 $mapping->setMemberAttribute($propertie_form->getInput(
"member"));
1834 $mapping->setMemberISDN((
bool) $propertie_form->getInput(
"memberisdn"));
1835 $mapping->setRoleByName($propertie_form->getInput(
"role"));
1836 $mapping->setMappingInfo($propertie_form->getInput(
"info"));
1837 $mapping->setMappingInfoType((
bool) $propertie_form->getInput(
"info_type"));
1840 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1841 $this->
ctrl->redirect($this,
"roleMapping");
1843 if (!$this->rbacReview->roleExists($propertie_form->getInput(
"role"))) {
1844 $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"ldap_role_not_exists") .
" " .
1845 $propertie_form->getInput(
"role"));
1847 $propertie_form->setValuesByPost();
1848 $this->tpl->setContent($propertie_form->getHTML());
1857 $this->
server->setRoleBindDN($this->role_bind_user);
1858 $this->
server->setRoleBindPassword($this->role_bind_pass);
1859 $this->
server->enableRoleSynchronization($this->role_sync_active);
1862 if ($this->
server->getServerId()) {
1865 $this->main_tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1866 $this->
ctrl->redirect($this,
"roleMapping");
static checkLDAPLib()
Check if ldap module is installed.
confirmDeleteRules()
Confirm delete rules.
userMappingToolbar()
Create Toolbar.
static get(string $a_var)
checkRoleAssignmentInput(int $a_rule_id=0)
Check role assignment input.
This class represents an option in a radio group.
Readable part of repository interface to ilComponentDataDB.
createRoleMapping()
Check add screen input and save to db.
loadRoleAssignmentRule(int $a_rule_id, bool $load_from_form=true)
Load input from form.
ilLDAPRoleGroupMappingSettings $role_mapping
__construct(int $a_auth_ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initFormRoleAssignments(string $a_mode)
Init form table for new role assignments.
saveSyncronizationSettings()
save Syncronization Settings on Role Mapping screen
static _getServerList()
Get list of all configured servers.
readonly ILIAS UI Factory $ui_factory
Additional user data fields definition.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static _getAllServer()
Get list of all configured servers.
readonly ILIAS Refinery Factory $refinery
prepareGlobalRoleSelection()
New implementation for InputForm.
getServer()
Get server settings.
updateRoleMapping()
Check edit screen input and save to db.
readonly ilObjectDataCache $object_data_cache
setSubTabs()
Set sub tabs for ldap section.
editRoleAssignment()
Edit role assignment.
static _getMappingRulesByClass(string $a_class)
Get mapping rule by objectClass.
server()
description: > This example shows how a Progress Bar can be rendered and updated by the server...
setValuesByArray()
set values of form array
ilGlobalTemplateInterface $main_tpl
showRoleSelection()
show role selection
ilGlobalTemplateInterface $tpl
confirmDeleteRoleMapping()
confirm delete role mappings
static _getRules($a_server_id)
Get all rules.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setMinWordLength(int $a_length)
ilPropertyFormGUI $form_gui
checkAccess(string $a_permission)
addRoleMapping()
Add Assigments for role mapping.
ilAccessHandler $ilAccess
ilComponentRepository $component_repository
const LDAP_BIND_ANONYMOUS
handleServerTableActions()
confirmDeleteServerSettings()
Confirm delete rules.
static http()
Fetches the global http state from ILIAS.
readonly ILIAS HTTP GlobalHttpState $http
static _lookupTitle(int $obj_id)
deleteRules()
delete role assignment rule
ilLDAPAttributeMapping $mapping
addRoleAutoCompleteObject()
Add Member for autoComplete.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addRoleAssignment()
add new role assignment
static _lookupGlobalRole(int $a_server_id)
userMapping()
Ldap User Mapping.
roleAssignments()
Edit role assignments.
roleMapping()
Role Mapping Tab.
updateRoleAssignment()
update role assignment
array $attribute_mappings
This class stores the settings that define the mapping between LDAP attribute and user profile fields...
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,7),'usr_data','lastname','usr_id') => sorts by lastname.
initUserMappingForm()
Create Property Form GUI for User Mapping.
saveRoleSelection()
Save role selection.
static _getInstanceByRuleId(int $a_rule_id)
form( $class_path, string $cmd, string $submit_caption="")
static _getInstanceByServerId(int $a_server_id)
Get instance of class.
readonly ILIAS UI Renderer $ui_renderer
read()
Read mapping settings from db.
getAttributeMappingKeys()
Get all possible attribute keys for mapping ldap attribute to ilias user attributes.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This class represents a text area property in a property form.
save()
Save mapping rules to db.
ilLDAPRoleAssignmentRule $rule
initRoleMappingForm(string $command)
init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
static set(string $a_var, $a_val)
Set a value.
static _getInstanceByServerId(int $a_server_id)
ilLDAPRoleAssignmentRule $role_mapping_rule
getRoleAssignmentTable()
Show active role assignments.
editRoleMapping()
Edit Assigments for role mapping.