42 $this->tabs_gui = $ilTabs;
44 $this->lng->loadLanguageModule(
'ldap');
48 $this->ctrl->saveParameter($this,
'ldap_server_id');
49 $this->ref_id = $a_auth_ref_id;
59 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
61 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$ilErr->WARNING);
64 $next_class = $this->ctrl->getNextClass($this);
65 $cmd = $this->ctrl->getCmd();
91 $this->tabs_gui->setSubTabActive(
'ldap_role_assignments');
93 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_assignments.html',
'Services/LDAP');
95 include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
97 $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL',$this->form->getHTML());
102 include_once(
"./Services/LDAP/classes/class.ilLDAPRoleAssignmentTableGUI.php");
104 $table_gui->setTitle($this->lng->txt(
"ldap_tbl_role_ass"));
105 $table_gui->parse($rules);
106 $table_gui->addMultiCommand(
"confirmDeleteRules", $this->lng->txt(
"delete"));
107 $table_gui->setSelectAllCheckbox(
"rule_id");
108 $this->tpl->setVariable(
'RULES_TBL',$table_gui->getHTML());
120 if(!
$_GET[
'rule_id'])
122 ilUtil::sendinfo($this->lng->txt(
'select_one'));
127 $this->tabs_gui->setSubTabActive(
'ldap_role_assignments');
129 $this->ctrl->saveParameter($this,
'rule_id',(
int)
$_GET[
'rule_id']);
130 include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
133 $this->tpl->setContent($this->form->getHTML());
146 if(!
$_GET[
'rule_id'])
152 include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
156 $role_assignment->setMemberIsDN((
int) $_POST[
'isdn']);
159 $role_assignment->setRoleId((
int) $_POST[
'role']);
160 $role_assignment->setType((
int) $_POST[
'type']);
162 if(!$role_assignment->validate())
169 $role_assignment->update();
183 if(!is_array($_POST[
'rule_ids']))
190 $this->tabs_gui->setSubTabActive(
'ldap_role_assignments');
192 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
196 $c_gui->setFormAction($this->ctrl->getFormAction($this,
"deleteRules"));
197 $c_gui->setHeaderText($this->lng->txt(
"ldap_confirm_del_role_ass"));
198 $c_gui->setCancel($this->lng->txt(
"cancel"),
"roleAssignments");
199 $c_gui->setConfirm($this->lng->txt(
"confirm"),
"deleteRules");
202 include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
203 foreach($_POST[
"rule_ids"] as $rule_id)
206 $c_gui->addItem(
'rule_ids[]',$rule_id,$rule->conditionToString());
208 $this->tpl->setContent($c_gui->getHTML());
219 if(!is_array($_POST[
'rule_ids']))
225 include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
226 foreach($_POST[
"rule_ids"] as $rule_id)
246 include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
247 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
253 $role_assignment->setMemberIsDN((
int) $_POST[
'isdn']);
256 $role_assignment->setRoleId((
int) $_POST[
'role']);
257 $role_assignment->setType((
int) $_POST[
'type']);
259 if(!$role_assignment->validate())
266 $role_assignment->create();
278 $this->tabs_gui->setSubTabActive(
'ldap_role_mapping');
280 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_role_mapping.html',
'Services/LDAP');
281 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this,
'saveRoleMapping'));
284 $this->tpl->setVariable(
'TXT_ROLE_SETTINGS',$this->lng->txt(
'ldap_role_settings'));
285 $this->tpl->setVariable(
'TXT_ROLE_ACTIVE',$this->lng->txt(
'ldap_role_active'));
286 $this->tpl->setVariable(
'TXT_ROLE_BIND_USER',$this->lng->txt(
'ldap_role_bind_user'));
287 $this->tpl->setVariable(
'TXT_ROLE_BIND_PASS',$this->lng->txt(
'ldap_role_bind_pass'));
288 $this->tpl->setVariable(
'TXT_ROLE_ASSIGNMENTS',$this->lng->txt(
'ldap_role_assignments'));
289 $this->tpl->setVariable(
'TXT_BINDING',$this->lng->txt(
'ldap_server_binding'));
291 $this->tpl->setVariable(
'TXT_ROLE_BIND_USER_INFO',$this->lng->txt(
'ldap_role_bind_user_info'));
292 $this->tpl->setVariable(
'TXT_ROLE_ASSIGNMENTS_INFO',$this->lng->txt(
'ldap_role_assignments_info'));
295 $mapping_data = $this->role_mapping->getMappings();
300 $this->tpl->setVariable(
'TXT_NEW_ASSIGNMENT',$this->lng->txt(
'ldap_new_role_assignment'));
301 $this->tpl->setVariable(
'TXT_URL',$this->lng->txt(
'ldap_server'));
302 $this->tpl->setVariable(
'TXT_DN',$this->lng->txt(
'ldap_group_dn'));
303 $this->tpl->setVariable(
'TXT_MEMBER',$this->lng->txt(
'ldap_group_member'));
304 $this->tpl->setVariable(
'TXT_MEMBER_ISDN',$this->lng->txt(
'ldap_memberisdn'));
305 $this->tpl->setVariable(
'TXT_ROLE',$this->lng->txt(
'ldap_ilias_role'));
306 $this->tpl->setVariable(
'TXT_ROLE_INFO',$this->lng->txt(
'ldap_role_info'));
307 $this->tpl->setVariable(
'TXT_DN_INFO',$this->lng->txt(
'ldap_dn_info'));
308 $this->tpl->setVariable(
'TXT_MEMBER_INFO',$this->lng->txt(
'ldap_member_info'));
309 $this->tpl->setVariable(
'TXT_MEMBERISDN',$this->lng->txt(
'ldap_memberisdn'));
310 $this->tpl->setVariable(
'TXT_INFO',$this->lng->txt(
'ldap_info_text'));
311 $this->tpl->setVariable(
'TXT_INFO_INFO',$this->lng->txt(
'ldap_info_text_info'));
314 $this->tpl->setVariable(
'ROLE_BIND_USER',$this->server->getRoleBindDN());
315 $this->tpl->setVariable(
'ROLE_BIND_PASS',$this->server->getRoleBindPassword());
316 $this->tpl->setVariable(
'CHECK_ROLE_ACTIVE',
ilUtil::formCheckbox($this->server->enabledRoleSynchronization() ?
true :
false,
321 $this->tpl->setVariable(
'URL',$mapping_data[0][
'url'] ? $mapping_data[0][
'url'] : $this->server->getUrl());
322 $this->tpl->setVariable(
'DN',$mapping_data[0][
'dn']);
323 $this->tpl->setVariable(
'ROLE',$mapping_data[0][
'role_name']);
324 $this->tpl->setVariable(
'MEMBER',$mapping_data[0][
'member_attribute']);
326 'mapping[0][memberisdn]',
328 $this->tpl->setVariable(
'MAPPING_INFO',$mapping_data[0][
'info']);
330 $info_type_checked = isset($mapping_data[0][
'info_type']) ? $mapping_data[0][
'info_type'] : 1;
332 $this->tpl->setVariable(
'TXT_MAPPING_INFO_TYPE',$this->lng->txt(
'ldap_mapping_info_type'));
334 'mapping[0][info_type]',
337 unset($mapping_data[0]);
340 if(count($mapping_data))
342 $this->tpl->setCurrentBlock(
'txt_assignments');
343 $this->tpl->setVariable(
'TXT_ASSIGNMENTS',$this->lng->txt(
'ldap_role_group_assignments'));
344 $this->tpl->parseCurrentBlock();
346 $this->tpl->setCurrentBlock(
'delete_btn');
348 $this->tpl->setVariable(
'TXT_DELETE',$this->lng->txt(
'delete'));
349 $this->tpl->parseCurrentBlock();
354 foreach($mapping_data as
$data)
356 $mapping_id = $data[
'mapping_id'];
357 if(in_array($mapping_id,
$_SESSION[
'ldap_mapping_details']))
359 $this->tpl->setCurrentBlock(
'show_mapping_details');
360 $this->tpl->setVariable(
'ASS_GROUP_URL',$this->lng->txt(
'ldap_server_short'));
361 $this->tpl->setVariable(
'ASS_GROUP_DN',$this->lng->txt(
'ldap_group_dn_short'));
362 $this->tpl->setVariable(
'ASS_MEMBER_ATTR',$this->lng->txt(
'ldap_group_member_short'));
363 $this->tpl->setVariable(
'ASS_ROLE',$this->lng->txt(
'ldap_ilias_role_short'));
364 $this->tpl->setVariable(
'ASS_INFO',$this->lng->txt(
'ldap_info_text_short'));
365 $this->tpl->setVariable(
'ROW_ID',$mapping_id);
366 $this->tpl->setVariable(
'ROW_URL',$data[
'url']);
367 $this->tpl->setVariable(
'ROW_ROLE',$data[
'role_name'] ? $data[
'role_name'] : $data[
'role']);
368 $this->tpl->setVariable(
'ROW_DN',$data[
'dn']);
369 $this->tpl->setVariable(
'ROW_MEMBER',$data[
'member_attribute']);
370 $this->tpl->setVariable(
'TXT_ROW_MEMBERISDN',$this->lng->txt(
'ldap_memberisdn'));
372 'mapping['.$mapping_id.
'][memberisdn]',
375 $this->tpl->setVariable(
'TXT_ROW_INFO_TYPE',$this->lng->txt(
'ldap_mapping_info_type'));
377 'mapping['.$mapping_id.
'][info_type]',
379 $this->tpl->parseCurrentBlock();
383 $this->tpl->setCurrentBlock(
'assignments');
386 $this->ctrl->setParameter($this,
'mapping_id',$mapping_id);
387 $this->tpl->setVariable(
'COPY_LINK',$this->ctrl->getLinkTarget($this,
'roleMapping'));
388 $this->tpl->setVariable(
'TXT_COPY',$this->lng->txt(
'copy'));
389 $this->ctrl->clearParameters($this);
392 if(!in_array($mapping_id,
$_SESSION[
'ldap_mapping_details']))
394 $this->ctrl->setParameter($this,
'details_show',$mapping_id);
395 $this->tpl->setVariable(
'DETAILS_LINK',$this->ctrl->getLinkTarget($this,
'roleMapping'));
396 $this->tpl->setVariable(
'TXT_DETAILS',$this->lng->txt(
'show_details'));
397 $this->ctrl->clearParameters($this);
401 $this->ctrl->setParameter($this,
'details_hide',$mapping_id);
402 $this->tpl->setVariable(
'DETAILS_LINK',$this->ctrl->getLinkTarget($this,
'roleMapping'));
403 $this->tpl->setVariable(
'TXT_DETAILS',$this->lng->txt(
'hide_details'));
404 $this->ctrl->clearParameters($this);
406 if(!count(
$_SESSION[
'ldap_mapping_details']))
408 $this->tpl->setVariable(
'WIDTH',
"50%");
411 'mappings[]',$mapping_id));
412 $this->tpl->setVariable(
'TXT_TITLE_TITLE',$this->lng->txt(
'title'));
413 $this->tpl->setVariable(
'TXT_TITLE_ROLE',$this->lng->txt(
'obj_role'));
414 $this->tpl->setVariable(
'TXT_TITLE_GROUP',$this->lng->txt(
'obj_grp'));
415 $this->tpl->setVariable(
'TITLE_GROUP',$this->role_mapping->getMappingInfoString($mapping_id));
417 $this->tpl->setVariable(
'TITLE_ROLE',$data[
'role_name']);
419 $this->tpl->parseCurrentBlock();
423 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
424 $this->tpl->setVariable(
'TXT_REQUIRED_FLD',$this->lng->txt(
'required_field'));
430 if(!count($_POST[
'mappings']))
439 foreach($_POST[
'mappings'] as $mapping_id)
441 $this->role_mapping->delete($mapping_id);
450 unset($_POST[
'mapping_template']);
460 $this->server->enableRoleSynchronization((
int) $_POST[
'role_sync_active']);
463 if($this->server->getServerId())
465 $this->server->update();
469 $_GET[
'ldap_server_id'] = $this->server->create();
473 $this->role_mapping->loadFromPost($_POST[
'mapping']);
474 if(!$this->role_mapping->validate())
480 $this->role_mapping->save();
492 $this->tabs_gui->setSubTabActive(
'ldap_user_mapping');
494 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_user_mapping.html',
'Services/LDAP');
495 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
497 $this->tpl->setVariable(
'TXT_LDAP_MAPPING',$this->lng->txt(
'ldap_mapping_table'));
500 if($_POST[
'mapping_template'])
502 $this->tpl->setCurrentBlock(
'reset');
503 $this->tpl->setVariable(
'TXT_RESET',$this->lng->txt(
'reset'));
504 $this->tpl->parseCurrentBlock();
509 $this->tpl->setCurrentBlock(
'attribute_row');
510 $this->tpl->setVariable(
'TXT_NAME',$translation);
511 $this->tpl->setVariable(
'FIELD_NAME',$mapping.
'_value');
512 $this->tpl->setVariable(
'FIELD_VALUE',$this->mapping->getValue($mapping));
513 $this->tpl->setVariable(
'CHECK_FIELD',
ilUtil::formCheckbox($this->mapping->enabledUpdate($mapping),$mapping.
'_update',1));
514 $this->tpl->setVariable(
'UPDATE_INFO',$this->lng->txt(
'ldap_update_field_info'));
515 $this->tpl->parseCurrentBlock();
520 foreach($this->udf->getDefinitions() as $definition)
522 $this->tpl->setCurrentBlock(
'attribute_row');
523 $this->tpl->setVariable(
'TXT_NAME',$definition[
'field_name']);
524 $this->tpl->setVariable(
'FIELD_NAME',
'udf_'.$definition[
'field_id'].
'_value');
525 $this->tpl->setVariable(
'FIELD_VALUE',$this->mapping->getValue(
'udf_'.$definition[
'field_id']));
526 $this->tpl->setVariable(
'CHECK_FIELD',
ilUtil::formCheckbox($this->mapping->enabledUpdate(
'udf_'.$definition[
'field_id']),
527 'udf_'.$definition[
'field_id'].
'_update',1));
528 $this->tpl->setVariable(
'UPDATE_INFO',$this->lng->txt(
'ldap_update_field_info'));
529 $this->tpl->parseCurrentBlock();
533 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
534 $this->tpl->setVariable(
'TXT_SHOW',$this->lng->txt(
'show'));
539 if(!$_POST[
'mapping_template'])
546 $this->mapping->clearRules();
548 include_once(
'Services/LDAP/classes/class.ilLDAPAttributeMappingUtils.php');
551 $this->mapping->setRule($key,$value,0);
562 $this->mapping->setRule($key,
ilUtil::stripSlashes($_POST[$key.
'_value']),(
int) $_POST[$key.
'_update']);
565 foreach($this->udf->getDefinitions() as $definition)
567 $key =
'udf_'.$definition[
'field_id'];
568 $this->mapping->setRule($key,
ilUtil::stripSlashes($_POST[$key.
'_value']),(
int) $_POST[$key.
'_update']);
571 $this->mapping->save();
575 unset($_POST[
'mapping_template']);
582 $this->tabs_gui->setSubTabActive(
'ldap_settings');
584 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ldap_server_list.html',
'Services/LDAP');
585 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
588 $this->tpl->setVariable(
"TXT_LDAP_SERVER_SETTINGS",$this->lng->txt(
'ldap_configure'));
589 $this->tpl->setVariable(
'TXT_ACTIVE',$this->lng->txt(
'auth_ldap_enable'));
590 $this->tpl->setVariable(
'TXT_SERVER_NAME',$this->lng->txt(
'ldap_server_name'));
591 $this->tpl->setVariable(
'TXT_SERVER_URL',$this->lng->txt(
'ldap_server'));
592 $this->tpl->setVariable(
'TXT_SERVER_VERSION',$this->lng->txt(
'ldap_version'));
593 $this->tpl->setVariable(
'TXT_BASE_DN',$this->lng->txt(
'basedn'));
594 $this->tpl->setVariable(
'TXT_REFERRALS',$this->lng->txt(
'ldap_referrals'));
596 $this->tpl->setVariable(
'TXT_SECURITY_SETTINGS',$this->lng->txt(
'ldap_server_security_settings'));
597 $this->tpl->setVariable(
'TXT_TLS',$this->lng->txt(
'ldap_tls'));
598 $this->tpl->setVariable(
'TXT_BINDING',$this->lng->txt(
'ldap_server_binding'));
599 $this->tpl->setVariable(
'TXT_ANONYMOUS',$this->lng->txt(
'ldap_bind_anonymous'));
600 $this->tpl->setVariable(
'TXT_USER',$this->lng->txt(
'ldap_bind_user'));
601 $this->tpl->setVariable(
'TXT_BIND_DN',$this->lng->txt(
'ldap_server_bind_dn'));
602 $this->tpl->setVariable(
'TXT_BIND_PASSWD',$this->lng->txt(
'ldap_server_bind_pass'));
604 $this->tpl->setVariable(
'TXT_AUTH_SETTINGS',$this->lng->txt(
'ldap_authentication_settings'));
605 $this->tpl->setVariable(
'TXT_USER_ATTRIBUTE',$this->lng->txt(
'ldap_user_attribute'));
606 $this->tpl->setVariable(
'TXT_USER_SCOPE',$this->lng->txt(
'ldap_user_scope'));
607 $this->tpl->setVariable(
'TXT_SEARCH_BASE',$this->lng->txt(
'ldap_user_dn'));
608 $this->tpl->setVariable(
'TXT_FILTER',$this->lng->txt(
'ldap_search_filter'));
609 $this->tpl->setVariable(
'TXT_REQUIRED_FLD',$this->lng->txt(
'required_field'));
612 $this->tpl->setVariable(
'TXT_GROUP_RESTRICTIONS',$this->lng->txt(
'ldap_group_restrictions'));
613 $this->tpl->setVariable(
'TXT_GROUP_DN',$this->lng->txt(
'ldap_group_search_base'));
614 $this->tpl->setVariable(
'TXT_GROUP_SCOPE',$this->lng->txt(
'ldap_group_scope'));
615 $this->tpl->setVariable(
'TXT_GROUP_FILTER',$this->lng->txt(
'ldap_group_filter'));
616 $this->tpl->setVariable(
'TXT_MEMBER',$this->lng->txt(
'ldap_group_member'));
617 $this->tpl->setVariable(
'TXT_MEMBERISDN',$this->lng->txt(
'ldap_memberisdn'));
618 $this->tpl->setVariable(
'TXT_GROUP',$this->lng->txt(
'ldap_group_name'));
619 $this->tpl->setVariable(
'TXT_GROUP_ATTRIBUTE',$this->lng->txt(
'ldap_group_attribute'));
620 $this->tpl->setVariable(
'TXT_GROUP_MEMBERSHIP',$this->lng->txt(
'ldap_group_membership'));
621 $this->tpl->setVariable(
'TXT_OPTIONAL',$this->lng->txt(
'ldap_group_member_optional'));
622 $this->tpl->setVariable(
'TXT_GROUP_USER_FILTER',$this->lng->txt(
'ldap_group_user_filter'));
623 $this->tpl->setVariable(
'TXT_OPTIONAL_INFO',$this->lng->txt(
'ldap_group_optional_info'));
626 $this->tpl->setVariable(
'TXT_USER_SYNC',$this->lng->txt(
'ldap_user_sync'));
627 $this->tpl->setVariable(
'TXT_MOMENT',$this->lng->txt(
'ldap_moment_sync'));
628 $this->tpl->setVariable(
'TXT_LOGIN',$this->lng->txt(
'ldap_sync_login'));
629 $this->tpl->setVariable(
'TXT_CRON',$this->lng->txt(
'ldap_sync_cron'));
630 $this->tpl->setVariable(
'TXT_GLOBAL_ROLE',$this->lng->txt(
'ldap_global_role_assignment'));
632 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
635 $this->tpl->setVariable(
'TXT_SERVER_NAME_INFO',$this->lng->txt(
'ldap_server_name_info'));
636 $this->tpl->setVariable(
'TXT_SERVER_URL_INFO',$this->lng->txt(
'ldap_server_url_info'));
637 $this->tpl->setVariable(
'TXT_SERVER_VERSION_INFO',$this->lng->txt(
'ldap_server_version_info'));
638 $this->tpl->setVariable(
'TXT_REFERRALS_INFO',$this->lng->txt(
'ldap_referrals_info'));
639 $this->tpl->setVariable(
'TXT_SEARCH_BASE_INFO',$this->lng->txt(
'ldap_search_base_info'));
640 $this->tpl->setVariable(
'TXT_FILTER_INFO',$this->lng->txt(
'ldap_filter_info'));
641 $this->tpl->setVariable(
'TXT_GROUP_DN_INFO',$this->lng->txt(
'ldap_group_dn_info'));
642 $this->tpl->setVariable(
'TXT_GROUP_FILTER_INFO',$this->lng->txt(
'ldap_group_filter_info'));
643 $this->tpl->setVariable(
'TXT_MEMBER_INFO',$this->lng->txt(
'ldap_group_member_info'));
644 $this->tpl->setVariable(
'TXT_GROUP_INFO',$this->lng->txt(
'ldap_group_name_info'));
645 $this->tpl->setVariable(
'TXT_GROUP_ATTRIBUTE_INFO',$this->lng->txt(
'ldap_group_attribute_info'));
646 $this->tpl->setVariable(
'TXT_GROUP_SCOPE_INFO',$this->lng->txt(
'ldap_group_scope_info'));
647 $this->tpl->setVariable(
'TXT_USER_SCOPE_INFO',$this->lng->txt(
'ldap_user_scope_info'));
648 $this->tpl->setVariable(
'TXT_USER_SYNC_INFO',$this->lng->txt(
'ldap_user_sync_info'));
649 $this->tpl->setVariable(
'TXT_GLOBAL_ROLE_INFO',$this->lng->txt(
'ldap_global_role_info'));
653 $this->tpl->setVariable(
'CHECK_ACTIVE',
ilUtil::formCheckbox($this->server->isActive() ?
true :
false,
'active',1));
654 $this->tpl->setVariable(
'SERVER_NAME',$this->server->getName());
655 $this->tpl->setVariable(
'SERVER_URL',$this->server->getUrlString());
656 $this->tpl->setVariable(
'SELECT_VERSION',
ilUtil::formSelect($this->server->getVersion(),
657 'version',array(2 => 2,3 => 3),
false,
true));
658 $this->tpl->setVariable(
'BASE_DN',$this->server->getBaseDN());
659 $this->tpl->setVariable(
'CHECK_REFERRALS',
ilUtil::formCheckbox($this->server->isActiveReferrer() ?
true :
false,
'referrals',1));
660 $this->tpl->setVariable(
'CHECK_TLS',
ilUtil::formCheckbox($this->server->isActiveTLS() ?
true :
false,
'tls',1));
666 $this->tpl->setVariable(
'BIND_DN',$this->server->getBindUser());
667 $this->tpl->setVariable(
'BIND_PASS',$this->server->getBindPassword());
669 $this->tpl->setVariable(
'SEARCH_BASE',$this->server->getSearchBase());
670 $this->tpl->setVariable(
'USER_ATTRIBUTE',$this->server->getUserAttribute());
671 $this->tpl->setVariable(
'SELECT_USER_SCOPE',
ilUtil::formSelect($this->server->getUserScope(),
675 $this->tpl->setVariable(
'FILTER',$this->server->getFilter());
676 $this->tpl->setVariable(
'GROUP_DN',$this->server->getGroupDN());
677 $this->tpl->setVariable(
'SELECT_GROUP_SCOPE',
ilUtil::formSelect($this->server->getGroupScope(),
681 $this->tpl->setVariable(
'GROUP_FILTER',$this->server->getGroupFilter());
682 $this->tpl->setVariable(
'GROUP_MEMBER',$this->server->getGroupMember());
683 $this->tpl->setVariable(
'CHECK_MEMBERISDN',
ilUtil::formCheckbox($this->server->enabledGroupMemberIsDN() ? 1 : 0,
'memberisdn',1));
684 $this->tpl->setVariable(
'GROUP',$this->server->getGroupName());
685 $this->tpl->setVariable(
'GROUP_ATTRIBUTE',$this->server->getGroupAttribute());
686 $this->tpl->setVariable(
'GROUP_USER_FILTER',$this->server->getGroupUserFilter());
688 $this->tpl->setVariable(
'CHECK_OPTIONAL',
ilUtil::formCheckbox($this->server->isMembershipOptional() ? 1 : 0,
692 $this->tpl->setVariable(
'CHECK_LOGIN',
ilUtil::formCheckbox($this->server->enabledSyncOnLogin() ?
true :
false,
695 $this->tpl->setVariable(
'CHECK_CRON',
ilUtil::formCheckbox($this->server->enabledSyncPerCron() ?
true :
false,
710 $this->server->toggleActive((
int) $_POST[
'active']);
717 $this->server->setBindingType((
int) $_POST[
'binding_type']);
721 $this->server->setUserScope((
int) $_POST[
'user_scope']);
725 $this->server->setGroupScope((
int) $_POST[
'group_scope']);
728 $this->server->enableGroupMemberIsDN((
int) $_POST[
'memberisdn']);
732 $this->server->toggleMembershipOptional((
int) $_POST[
'group_optional']);
733 $this->server->enableSyncOnLogin((
int) $_POST[
'sync_on_login']);
734 $this->server->enableSyncPerCron((
int) $_POST[
'sync_per_cron']);
735 $this->server->setGlobalRole((
int) $_POST[
'global_role']);
737 if(!$this->server->validate())
745 if($this->server->getServerId())
747 $this->server->update();
751 $_GET[
'ldap_server_id'] = $this->server->create();
756 $this->mapping->setRule(
'global_role',(
int) $_POST[
'global_role'],
false);
757 $this->mapping->save();
773 $this->tabs_gui->addSubTabTarget(
"ldap_settings",
774 $this->ctrl->getLinkTarget($this,
'serverList'),
775 "serverList",get_class($this));
778 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
784 $this->tabs_gui->addSubTabTarget(
"ldap_user_mapping",
785 $this->ctrl->getLinkTarget($this,
'userMapping'),
786 "userMapping",get_class($this));
788 $this->tabs_gui->addSubTabTarget(
'ldap_role_assignments',
789 $this->ctrl->getLinkTarget($this,
'roleAssignments'),
790 "roleAssignments",get_class($this));
792 $this->tabs_gui->addSubTabTarget(
"ldap_role_mapping",
793 $this->ctrl->getLinkTarget($this,
'roleMapping'),
794 "roleMapping",get_class($this));
801 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
802 if(!
$_GET[
'ldap_server_id'])
811 include_once
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php';
817 include_once
'./Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php';
823 global $rbacreview,$ilObjDataCache;
825 include_once(
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php');
832 $select[0] = $this->lng->txt(
'links_select_one');
833 foreach($global_roles as $role_id)
841 'global_role',$select,
false,
true);
852 return array(
'gender' => $this->lng->txt(
'gender'),
853 'firstname' => $this->lng->txt(
'firstname'),
854 'lastname' => $this->lng->txt(
'lastname'),
855 'title' => $this->lng->txt(
'person_title'),
856 'institution' => $this->lng->txt(
'institution'),
857 'department' => $this->lng->txt(
'department'),
858 'street' => $this->lng->txt(
'street'),
859 'city' => $this->lng->txt(
'city'),
860 'zipcode' => $this->lng->txt(
'zipcode'),
861 'country' => $this->lng->txt(
'country'),
862 'phone_office' => $this->lng->txt(
'phone_office'),
863 'phone_home' => $this->lng->txt(
'phone_home'),
864 'phone_mobile' => $this->lng->txt(
'phone_mobile'),
865 'fax' => $this->lng->txt(
'fax'),
866 'email' => $this->lng->txt(
'email'),
867 'hobby' => $this->lng->txt(
'hobby'),
868 'matriculation' => $this->lng->txt(
'matriculation'));
869 #'photo' => $this->lng->txt('photo'));
874 include_once(
"./Services/User/classes/class.ilUserDefinedFields.php");
880 return ilUtil::formSelect($_POST[
'mapping_template'],
'mapping_template',array(0 => $this->lng->txt(
'ldap_mapping_template'),
881 "inetOrgPerson" =>
'inetOrgPerson',
882 "organizationalPerson" =>
'organizationalPerson',
883 "person" =>
'person',
884 "ad_2003" =>
'Active Directory (Win 2003)'),
false,
true);
897 if(!isset(
$_GET[
'mapping_id']))
899 return $a_mapping_data;
902 $mapping_id =
$_GET[
'mapping_id'];
903 $a_mapping_data[0] = $a_mapping_data[$mapping_id];
905 return $a_mapping_data;
916 if(!isset(
$_SESSION[
'ldap_mapping_details']))
918 $_SESSION[
'ldap_mapping_details'] = array();
920 if(isset(
$_GET[
'details_show']))
922 $_SESSION[
'ldap_mapping_details'][
$_GET[
'details_show']] = $_GET[
'details_show'];
924 if(isset(
$_GET[
'details_hide']))
939 global $rbacreview,$ilObjDataCache;
941 $new_mapping = array();
942 $new_mapping = array();
943 foreach($a_mapping_data as $mapping_id =>
$data)
945 $new_mapping[$mapping_id] =
$data;
946 $new_mapping[$mapping_id][
'obj_id'] = $obj_id = $rbacreview->getObjectOfRole(
$data[
'role']);
947 $new_mapping[$mapping_id][
'obj_title'] = $ilObjDataCache->lookupTitle($obj_id);
948 $new_mapping[$mapping_id][
'mapping_id'] = $mapping_id;
964 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
965 include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
968 $this->form->setFormAction($this->ctrl->getFormAction($this));
973 $this->form->setTitle($this->lng->txt(
'ldap_edit_role_ass_rule'));
974 $this->form->addCommandButton(
'updateRoleAssignment',$this->lng->txt(
'save'));
975 $this->form->addCommandButton(
'roleAssignments',$this->lng->txt(
'cancel'));
978 $this->form->setTitle($this->lng->txt(
'ldap_add_role_ass_rule'));
979 $this->form->addCommandButton(
'addRoleAssignment',$this->lng->txt(
'ldap_btn_add_role_ass'));
980 $this->form->addCommandButton(
'roleAssignments',$this->lng->txt(
'cancel'));
987 $role->setRequired(
true);
988 $this->form->addItem($role);
993 $group->setRequired(
true);
1002 $dn->setMaxLength(512);
1003 $dn->
setInfo($this->lng->txt(
'ldap_role_grp_dn_info'));
1004 $radio_group->addSubItem($dn);
1005 $at =
new ilTextInputGUI($this->lng->txt(
'ldap_role_grp_at'),
'at');
1008 $at->setMaxLength(128);
1009 $radio_group->addSubItem($at);
1012 $isdn->setInfo($this->lng->txt(
'ldap_group_member_info'));
1013 $radio_group->addSubItem($isdn);
1014 $radio_group->setInfo($this->lng->txt(
'ldap_role_grp_info'));
1016 $group->addOption($radio_group);
1020 $name =
new ilTextInputGUI($this->lng->txt(
'ldap_role_at_name'),
'name');
1023 $name->setMaxLength(128);
1024 #$name->setInfo($this->lng->txt('ldap_role_at_name_info'));
1028 $val =
new ilTextInputGUI($this->lng->txt(
'ldap_role_at_value'),
'value');
1031 $val->setMaxLength(128);
1032 #$val->setInfo($this->lng->txt('ldap_role_at_value_info'));
1033 $radio_attribute->addSubItem($val);
1034 $radio_attribute->setInfo($this->lng->txt(
'ldap_role_at_info'));
1035 $group->addOption($radio_attribute);
1037 $this->form->addItem($group);