44        $this->ctrl = $this->dic->ctrl();
 
   45        $this->tabs_gui = $this->dic->tabs();
 
   46        $this->lng = $this->dic->language();
 
   47        $this->lng->loadLanguageModule(
'ldap');
 
   49        $this->tpl = $this->dic[
'tpl'];
 
   51        if (
$_GET[
"cmd"] != 
"addServerSettings") {
 
   52            $this->ctrl->saveParameter($this, 
'ldap_server_id');
 
   56        $this->ref_id = $a_auth_ref_id;
 
   64        $next_class = $this->ctrl->getNextClass($this);
 
   65        $cmd = $this->ctrl->getCmd();
 
   67        if (!$this->dic->rbac()->system()->checkAccess(
"visible,read", $this->ref_id) && $cmd != 
"serverList") {
 
   69            $this->ctrl->redirect($this, 
"serverList");
 
   73        switch ($next_class) {
 
   94            $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), 
$ilErr->WARNING);
 
  106        $access = 
$DIC->access();
 
  108        return $access->checkAccess($a_permission, 
'', $this->ref_id);
 
  130        $rbacreview = 
$DIC[
'rbacreview'];
 
  133        $this->tabs_gui->setTabActive(
'role_assignments');
 
  135        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.ldap_role_assignments.html', 
'Services/LDAP');
 
  137        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  139        $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->form->getHTML());
 
  143            include_once(
"./Services/LDAP/classes/class.ilLDAPRoleAssignmentTableGUI.php");
 
  145            $table_gui->setTitle($this->lng->txt(
"ldap_tbl_role_ass"));
 
  146            $table_gui->parse($rules);
 
  147            $table_gui->addMultiCommand(
"confirmDeleteRules", $this->lng->txt(
"delete"));
 
  148            $table_gui->setSelectAllCheckbox(
"rule_id");
 
  149            $this->tpl->setVariable(
'RULES_TBL', $table_gui->getHTML());
 
  161        if (!(
int) 
$_GET[
'rule_id']) {
 
  167        $this->tabs_gui->setTabActive(
'role_assignments');
 
  169        $this->ctrl->saveParameter($this, 
'rule_id', (
int) 
$_GET[
'rule_id']);
 
  170        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  176        $this->tpl->setContent($this->form->getHTML());
 
  188        $rbacreview = 
$DIC[
'rbacreview'];
 
  190        $role_id = $this->role_mapping_rule->getRoleId();
 
  191        if ($rbacreview->isGlobalRole($role_id)) {
 
  192            $val[
'role_name'] = 0;
 
  193            $val[
'role_id'] = $role_id;
 
  195            $val[
'role_name'] = 1;
 
  198        $val[
'add_missing'] = (int) $this->role_mapping_rule->isAddOnUpdateEnabled();
 
  199        $val[
'remove_deprecated'] = (int) $this->role_mapping_rule->isRemoveOnUpdateEnabled();
 
  200        $val[
'type'] = (int) $this->role_mapping_rule->getType();
 
  201        $val[
'dn'] = $this->role_mapping_rule->getDN();
 
  202        $val[
'at'] = $this->role_mapping_rule->getMemberAttribute();
 
  203        $val[
'isdn'] = $this->role_mapping_rule->isMemberAttributeDN();
 
  204        $val[
'name'] = $this->role_mapping_rule->getAttributeName();
 
  205        $val[
'value'] = $this->role_mapping_rule->getAttributeValue();
 
  206        $val[
'plugin_id'] = $this->role_mapping_rule->getPluginId();
 
  208        $this->form->setValuesByArray($val);
 
  222        $ilAccess = 
$DIC[
'ilAccess'];
 
  224        if (!$ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  226            $this->roleAssignment();
 
  230        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  231        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
  239            $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.ldap_role_assignments.html', 
'Services/LDAP');
 
  242            $this->form->setValuesByPost();
 
  243            $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->form->getHTML());
 
  244            #$this->tpl->setVariable('RULES_TBL',$this->getRoleAssignmentTable()); 
  245            $this->tabs_gui->setSubTabActive(
'shib_role_assignment');
 
  252        $this->rule->update();
 
  253        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  269        if (!is_array(
$_POST[
'rule_ids'])) {
 
  275        $this->tabs_gui->setTabActive(
'role_assignments');
 
  277        include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  281        $c_gui->setFormAction($this->ctrl->getFormAction($this, 
"deleteRules"));
 
  282        $c_gui->setHeaderText($this->lng->txt(
"ldap_confirm_del_role_ass"));
 
  283        $c_gui->setCancel($this->lng->txt(
"cancel"), 
"roleAssignments");
 
  284        $c_gui->setConfirm($this->lng->txt(
"confirm"), 
"deleteRules");
 
  287        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  288        foreach (
$_POST[
"rule_ids"] as $rule_id) {
 
  290            $c_gui->addItem(
'rule_ids[]', $rule_id, $rule->conditionToString());
 
  292        $this->tpl->setContent($c_gui->getHTML());
 
  303        if (!is_array(
$_POST[
'rule_ids'])) {
 
  308        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  309        foreach (
$_POST[
"rule_ids"] as $rule_id) {
 
  313        ilUtil::sendSuccess($this->lng->txt(
'ldap_deleted_rule'));
 
  329        $ilAccess = 
$DIC[
'ilAccess'];
 
  331        if (!$ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  333            $this->roleAssignment();
 
  337        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  338        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
  346            $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.ldap_role_assignments.html', 
'Services/LDAP');
 
  349            $this->form->setValuesByPost();
 
  350            $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->form->getHTML());
 
  352            $this->tabs_gui->setSubTabActive(
'shib_role_assignment');
 
  359        $this->rule->create();
 
  360        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  372        if ($this->rule->getRoleId() > 0) {
 
  376        $_SESSION[
'ldap_role_ass'][
'rule_id'] = $_REQUEST[
'rule_id'] ? $_REQUEST[
'rule_id'] : 0;
 
  377        $_SESSION[
'ldap_role_ass'][
'role_search'] = $this->form->getInput(
'role_search');
 
  378        $_SESSION[
'ldap_role_ass'][
'add_on_update'] = $this->form->getInput(
'add_missing');
 
  379        $_SESSION[
'ldap_role_ass'][
'remove_on_update'] = $this->form->getInput(
'remove_deprecated');
 
  380        $_SESSION[
'ldap_role_ass'][
'type'] = $this->form->getInput(
'type');
 
  381        $_SESSION[
'ldap_role_ass'][
'dn'] = $this->form->getInput(
'dn');
 
  382        $_SESSION[
'ldap_role_ass'][
'at'] = $this->form->getInput(
'at');
 
  383        $_SESSION[
'ldap_role_ass'][
'isdn'] = $this->form->getInput(
'isdn');
 
  384        $_SESSION[
'ldap_role_ass'][
'name'] = $this->form->getInput(
'name');
 
  385        $_SESSION[
'ldap_role_ass'][
'value'] = $this->form->getInput(
'value');
 
  386        $_SESSION[
'ldap_role_ass'][
'plugin'] = $this->form->getInput(
'plugin_id');
 
  389        $this->ctrl->saveParameter($this, 
'rule_id');
 
  390        $this->ctrl->redirect($this, 
'showRoleSelection');
 
  402        $this->tabs_gui->setTabActive(
'role_assignment');
 
  403        $this->ctrl->saveParameter($this, 
'rule_id');
 
  405        include_once 
'./Services/Search/classes/class.ilQueryParser.php';
 
  407        $parser->setMinWordLength(1, 
true);
 
  411        include_once 
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
 
  413        $object_search->setFilter(array(
'role'));
 
  414        $res = $object_search->performSearch();
 
  416        $entries = 
$res->getEntries();
 
  418        include_once 
'./Services/AccessControl/classes/class.ilRoleSelectionTableGUI.php';
 
  420        $table->setTitle($this->lng->txt(
'ldap_role_selection'));
 
  421        $table->addMultiCommand(
'saveRoleSelection', $this->lng->txt(
'ldap_choose_role'));
 
  422        #$table->addCommandButton('roleAssignment',$this->lng->txt('cancel')); 
  423        $table->parse($entries);
 
  425        $this->tpl->setContent($table->getHTML());
 
  438        $ilAccess = 
$DIC[
'ilAccess'];
 
  440        if (!$ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  442            $this->roleAssignment();
 
  446        if (!(
int) $_REQUEST[
'role_id']) {
 
  453        $this->rule->setRoleId((
int) $_REQUEST[
'role_id']);
 
  455        if ((
int) $_REQUEST[
'rule_id']) {
 
  456            $this->rule->update();
 
  458            $this->rule->create();
 
  461        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  479        $this->rule->validate();
 
  480        return $ilErr->getMessage();
 
  491            include_once(
"./Services/LDAP/classes/class.ilLDAPRoleAssignmentTableGUI.php");
 
  493            $table_gui->setTitle($this->lng->txt(
"ldap_tbl_role_ass"));
 
  494            $table_gui->parse($rules);
 
  495            $table_gui->addMultiCommand(
"confirmDeleteRules", $this->lng->txt(
"delete"));
 
  496            $table_gui->setSelectAllCheckbox(
"rule_id");
 
  497            return $table_gui->getHTML();
 
  510        if (is_object($this->rule)) {
 
  514        include_once 
'./Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
 
  519            if ($this->form->getInput(
'role_name') == 0) {
 
  520                $this->rule->setRoleId($this->form->getInput(
'role_id'));
 
  521            } elseif ($this->form->getInput(
'role_search')) {
 
  523                include_once 
'./Services/Search/classes/class.ilQueryParser.php';
 
  528                $parser->setMinWordLength(1, 
true);
 
  532                include_once 
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
 
  534                $object_search->setFilter(array(
'role'));
 
  535                $res = $object_search->performSearch();
 
  537                $entries = 
$res->getEntries();
 
  538                if (count($entries) == 1) {
 
  539                    $role = current($entries);
 
  540                    $this->rule->setRoleId($role[
'obj_id']);
 
  541                } elseif (count($entries) > 1) {
 
  542                    $this->rule->setRoleId(-1);
 
  546            $this->rule->setAttributeName($this->form->getInput(
'name'));
 
  547            $this->rule->setAttributeValue($this->form->getInput(
'value'));
 
  548            $this->rule->setDN($this->form->getInput(
'dn'));
 
  549            $this->rule->setMemberAttribute($this->form->getInput(
'at'));
 
  550            $this->rule->setMemberIsDN($this->form->getInput(
'isdn'));
 
  551            $this->rule->enableAddOnUpdate($this->form->getInput(
'add_missing'));
 
  552            $this->rule->enableRemoveOnUpdate($this->form->getInput(
'remove_deprecated'));
 
  553            $this->rule->setPluginId($this->form->getInput(
'plugin_id'));
 
  554            $this->rule->setType($this->form->getInput(
'type'));
 
  555            $this->rule->setServerId($this->
getServer()->getServerId());
 
  561        $this->rule->setServerId($this->
getServer()->getServerId());
 
  562        $this->rule->enableAddOnUpdate((
int) 
$_SESSION[
'ldap_role_ass'][
'add_on_update']);
 
  563        $this->rule->enableRemoveOnUpdate((
int) 
$_SESSION[
'ldap_role_ass'][
'remove_on_update']);
 
  576        if (!count(
$_POST[
'mappings'])) {
 
  584        foreach (
$_POST[
'mappings'] as $mapping_id) {
 
  585            $this->role_mapping->delete($mapping_id);
 
  587        ilUtil::sendSuccess($this->lng->txt(
'ldap_deleted_role_mapping'));
 
  594        if (!
$_POST[
'mapping_template']) {
 
  600        $this->mapping->clearRules();
 
  602        include_once(
'Services/LDAP/classes/class.ilLDAPAttributeMappingUtils.php');
 
  604            $this->mapping->setRule($key, $value, 0);
 
  613        $this->tabs_gui->setTabActive(
'role_mapping');
 
  619        foreach ($this->udf->getDefinitions() as $definition) {
 
  620            $key = 
'udf_' . $definition[
'field_id'];
 
  624        $this->mapping->save();
 
  627        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  628        unset(
$_POST[
'mapping_template']);
 
  636        if (!$this->dic->rbac()->system()->checkAccess(
"visible,read", $this->ref_id) && $cmd != 
"serverList") {
 
  637            $DIC[
'ilErr']->raiseError($this->lng->txt(
'msg_no_perm_read'), 
$DIC[
'ilErr']->WARNING);
 
  641            ilUtil::sendFailure(
'Missing LDAP libraries. Please ensure that the PHP LDAP module is installed on your server.');
 
  644        if ($this->dic->rbac()->system()->checkAccess(
"write", $this->ref_id)) {
 
  645            $DIC->toolbar()->addButton(
 
  646                $this->lng->txt(
"add_ldap_server"),
 
  647                $this->ctrl->getLinkTarget($this, 
"addServerSettings")
 
  651        include_once 
'./Services/LDAP/classes/class.ilLDAPServerTableGUI.php';
 
  656        return $this->tpl->setContent($table->getHTML());
 
  661        $this->form_gui->setValuesByArray(array(
 
  662            'active' => $this->server->isActive(),
 
  663            'ds' => !$this->server->isAuthenticationEnabled(),
 
  664            'server_name' => $this->server->getName(),
 
  665            'server_url' => $this->server->getUrlString(),
 
  666            'version' => $this->server->getVersion(),
 
  667            'base_dn' => $this->server->getBaseDN(),
 
  668            'referrals' => $this->server->isActiveReferrer(),
 
  669            'tls' => $this->server->isActiveTLS(),
 
  670            'binding_type' => $this->server->getBindingType(),
 
  671            'bind_dn' => $this->server->getBindUser(),
 
  672            'bind_pass' => $this->server->getBindPassword(),
 
  673            'bind_pass_retype' => $this->server->getBindPassword(),
 
  674            'search_base' => $this->server->getSearchBase(),
 
  675            'user_scope' => $this->server->getUserScope(),
 
  676            'user_attribute' => $this->server->getUserAttribute(),
 
  677            'filter' => $this->server->getFilter(),
 
  678            'group_dn' => $this->server->getGroupDN(),
 
  679            'group_scope' => $this->server->getGroupScope(),
 
  680            'group_filter' => $this->server->getGroupFilter(),
 
  681            'group_member' => $this->server->getGroupMember(),
 
  682            'memberisdn' => $this->server->enabledGroupMemberIsDN(),
 
  683            'group' => $this->server->getGroupName(),
 
  684            'group_attribute' => $this->server->getGroupAttribute(),
 
  685            'group_optional' => $this->server->isMembershipOptional(),
 
  686            'group_user_filter' => $this->server->getGroupUserFilter(),
 
  687            'sync_on_login' => $this->server->enabledSyncOnLogin(),
 
  688            'sync_per_cron' => $this->server->enabledSyncPerCron(),
 
  690            'migration' => (
int) $this->server->isAccountMigrationEnabled(),
 
  691            "name_filter" => $this->server->getUsernameFilter(),
 
  692            'escape_dn' => $this->server->enabledEscapeDN()
 
  698        include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  701        $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 
'save'));
 
  702        $this->form_gui->setTitle($this->lng->txt(
'ldap_configure'));
 
  705        $active->setValue(1);
 
  706        $this->form_gui->addItem($active);
 
  710        $ds->setInfo($this->lng->txt(
'ldap_as_ds_info'));
 
  711        $this->form_gui->addItem($ds);
 
  713        $servername = 
new ilTextInputGUI($this->lng->txt(
'ldap_server_name'), 
'server_name');
 
  714        $servername->setRequired(
true);
 
  715        $servername->setInfo($this->lng->txt(
'ldap_server_name_info'));
 
  716        $servername->setSize(32);
 
  717        $servername->setMaxLength(32);
 
  718        $this->form_gui->addItem($servername);
 
  721        $namefilter = 
new ilTextInputGUI($this->lng->txt(
'ldap_username_filter'), 
"name_filter");
 
  722        $namefilter->setInfo($this->lng->txt(
"ldap_username_filter_info"));
 
  723        $namefilter->setSize(64);
 
  724        $namefilter->setMaxLength(255);
 
  725        $this->form_gui->addItem($namefilter);
 
  728        $serverurl = 
new ilTextInputGUI($this->lng->txt(
'ldap_server'), 
'server_url');
 
  729        $serverurl->setRequired(
true);
 
  730        $serverurl->setInfo($this->lng->txt(
'ldap_server_url_info'));
 
  731        $serverurl->setSize(64);
 
  732        $serverurl->setMaxLength(255);
 
  733        $this->form_gui->addItem($serverurl);
 
  735        $version = 
new ilSelectInputGUI($this->lng->txt(
'ldap_version'), 
'version');
 
  736        $version->setOptions(array(2 => 2, 3 => 3));
 
  737        $version->setInfo($this->lng->txt(
'ldap_server_version_info'));
 
  738        $this->form_gui->addItem($version);
 
  740        $basedsn = 
new ilTextInputGUI($this->lng->txt(
'basedn'), 
'base_dn');
 
  741        $basedsn->setRequired(
true);
 
  742        $basedsn->setSize(64);
 
  743        $basedsn->setMaxLength(255);
 
  744        $this->form_gui->addItem($basedsn);
 
  747        $referrals->setValue(1);
 
  748        $referrals->setInfo($this->lng->txt(
'ldap_referrals_info'));
 
  749        $this->form_gui->addItem($referrals);
 
  752        $section_security->setTitle($this->lng->txt(
'ldap_server_security_settings'));
 
  753        $this->form_gui->addItem($section_security);
 
  757        $this->form_gui->addItem($tls);
 
  761        $binding->addOption($anonymous);
 
  763        $dn = 
new ilTextInputGUI($this->lng->txt(
'ldap_server_bind_dn'), 
'bind_dn');
 
  765        $dn->setMaxLength(255);
 
  766        $user->addSubItem($dn);
 
  768        $pass->setSkipSyntaxCheck(
true);
 
  770        $pass->setMaxLength(36);
 
  771        $user->addSubItem(
$pass);
 
  772        $binding->addOption($user);
 
  773        $this->form_gui->addItem($binding);
 
  776        $section_auth->setTitle($this->lng->txt(
'ldap_authentication_settings'));
 
  777        $this->form_gui->addItem($section_auth);
 
  779        $search_base = 
new ilTextInputGUI($this->lng->txt(
'ldap_user_dn'), 
'search_base');
 
  780        $search_base->setInfo($this->lng->txt(
'ldap_search_base_info'));
 
  781        $search_base->setSize(64);
 
  782        $search_base->setMaxLength(255);
 
  783        $this->form_gui->addItem($search_base);
 
  785        $user_scope = 
new ilSelectInputGUI($this->lng->txt(
'ldap_user_scope'), 
'user_scope');
 
  786        $user_scope->setOptions(array(
IL_LDAP_SCOPE_ONE => $this->lng->txt(
'ldap_scope_one'),
 
  788        $user_scope->setInfo($this->lng->txt(
'ldap_user_scope_info'));
 
  789        $this->form_gui->addItem($user_scope);
 
  791        $user_attribute = 
new ilTextInputGUI($this->lng->txt(
'ldap_user_attribute'), 
'user_attribute');
 
  792        $user_attribute->setSize(16);
 
  793        $user_attribute->setMaxLength(64);
 
  794        $user_attribute->setRequired(
true);
 
  795        $this->form_gui->addItem($user_attribute);
 
  797        $filter = 
new ilTextInputGUI($this->lng->txt(
'ldap_search_filter'), 
'filter');
 
  798        $filter->setInfo($this->lng->txt(
'ldap_filter_info'));
 
  799        $filter->setSize(64);
 
  800        $filter->setMaxLength(512);
 
  801        $this->form_gui->addItem($filter);
 
  804        $section_restrictions->setTitle($this->lng->txt(
'ldap_group_restrictions'));
 
  805        $this->form_gui->addItem($section_restrictions);
 
  807        $group_dn = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_search_base'), 
'group_dn');
 
  808        $group_dn->setInfo($this->lng->txt(
'ldap_group_dn_info'));
 
  809        $group_dn->setSize(64);
 
  810        $group_dn->setMaxLength(255);
 
  811        $this->form_gui->addItem($group_dn);
 
  813        $group_scope = 
new ilSelectInputGUI($this->lng->txt(
'ldap_group_scope'), 
'group_scope');
 
  814        $group_scope->setOptions(array(
IL_LDAP_SCOPE_ONE => $this->lng->txt(
'ldap_scope_one'),
 
  816        $group_scope->setInfo($this->lng->txt(
'ldap_group_scope_info'));
 
  817        $this->form_gui->addItem($group_scope);
 
  819        $group_filter = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_filter'), 
'group_filter');
 
  820        $group_filter->setInfo($this->lng->txt(
'ldap_group_filter_info'));
 
  821        $group_filter->setSize(64);
 
  822        $group_filter->setMaxLength(255);
 
  823        $this->form_gui->addItem($group_filter);
 
  825        $group_member = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_member'), 
'group_member');
 
  826        $group_member->setInfo($this->lng->txt(
'ldap_group_member_info'));
 
  827        $group_member->setSize(32);
 
  828        $group_member->setMaxLength(255);
 
  829        $this->form_gui->addItem($group_member);
 
  832        $group_member_isdn = 
new ilCheckboxInputGUI($this->lng->txt(
'ldap_memberisdn'), 
'memberisdn');
 
  833        #$group_member_isdn->setInfo($this->lng->txt('ldap_group_member_info')); 
  834        $this->form_gui->addItem($group_member_isdn);
 
  835        #$group_member->addSubItem($group_member_isdn); 
  838        $escapedn->setValue(1);
 
  839        $escapedn->setInfo($this->lng->txt(
'ldap_escapedn_info'));
 
  840        $this->form_gui->addItem($escapedn);
 
  842        $group = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_name'), 
'group');
 
  843        $group->setInfo($this->lng->txt(
'ldap_group_name_info'));
 
  845        $group->setMaxLength(255);
 
  846        $this->form_gui->addItem($group);
 
  848        $group_atrr = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_attribute'), 
'group_attribute');
 
  849        $group_atrr->setInfo($this->lng->txt(
'ldap_group_attribute_info'));
 
  850        $group_atrr->setSize(16);
 
  851        $group_atrr->setMaxLength(64);
 
  852        $this->form_gui->addItem($group_atrr);
 
  854        $group_optional = 
new ilCheckboxInputGUI($this->lng->txt(
'ldap_group_membership'), 
'group_optional');
 
  855        $group_optional->setOptionTitle($this->lng->txt(
'ldap_group_member_optional'));
 
  856        $group_optional->setInfo($this->lng->txt(
'ldap_group_optional_info'));
 
  857        $group_optional->setValue(1);
 
  858        $group_user_filter = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_user_filter'), 
'group_user_filter');
 
  859        $group_user_filter->setSize(64);
 
  860        $group_user_filter->setMaxLength(255);
 
  861        $group_optional->addSubItem($group_user_filter);
 
  862        $this->form_gui->addItem($group_optional);
 
  865        $section_sync->setTitle($this->lng->txt(
'ldap_user_sync'));
 
  866        $this->form_gui->addItem($section_sync);
 
  869        $sync_on_login = 
new ilCheckboxInputGUI($this->lng->txt(
'ldap_sync_login'), 
'sync_on_login');
 
  870        $sync_on_login->setValue(1);
 
  871        $ci_gui->addSubItem($sync_on_login);
 
  872        $sync_per_cron = 
new ilCheckboxInputGUI($this->lng->txt(
'ldap_sync_cron'), 
'sync_per_cron');
 
  873        $sync_per_cron->setValue(1);
 
  874        $ci_gui->addSubItem($sync_per_cron);
 
  875        $ci_gui->setInfo($this->lng->txt(
'ldap_user_sync_info'));
 
  876        $this->form_gui->addItem($ci_gui);
 
  878        $global_role = 
new ilSelectInputGUI($this->lng->txt(
'ldap_global_role_assignment'), 
'global_role');
 
  880        $global_role->setInfo($this->lng->txt(
'ldap_global_role_info'));
 
  881        $this->form_gui->addItem($global_role);
 
  884        $migr->setInfo($this->lng->txt(
'auth_ldap_migration_info'));
 
  886        $this->form_gui->addItem($migr);
 
  889        include_once 
"Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
 
  897        $this->form_gui->addCommandButton(
'save', $this->lng->txt(
'save'));
 
  898        if (
$_GET[
"cmd"] == 
"addServerSettings") {
 
  899            $this->form_gui->addCommandButton(
'serverList', $this->lng->txt(
'cancel'));
 
  913        $this->tabs_gui->setTabActive(
'settings');
 
  916        if ($this->form_gui->checkInput()) {
 
  917            $this->server->toggleActive((
int) $this->form_gui->getInput(
'active'));
 
  918            $this->server->enableAuthentication(!$this->form_gui->getInput(
'ds'));
 
  919            $this->server->setName($this->form_gui->getInput(
'server_name'));
 
  920            $this->server->setUrl($this->form_gui->getInput(
'server_url'));
 
  921            $this->server->setVersion($this->form_gui->getInput(
'version'));
 
  922            $this->server->setBaseDN($this->form_gui->getInput(
'base_dn'));
 
  923            $this->server->toggleReferrer($this->form_gui->getInput(
'referrals'));
 
  924            $this->server->toggleTLS($this->form_gui->getInput(
'tls'));
 
  925            $this->server->setBindingType((
int) $this->form_gui->getInput(
'binding_type'));
 
  926            $this->server->setBindUser($this->form_gui->getInput(
'bind_dn'));
 
  927            $this->server->setBindPassword($this->form_gui->getInput(
'bind_pass'));
 
  928            $this->server->setSearchBase($this->form_gui->getInput(
'search_base'));
 
  929            $this->server->setUserScope($this->form_gui->getInput(
'user_scope'));
 
  930            $this->server->setUserAttribute($this->form_gui->getInput(
'user_attribute'));
 
  931            $this->server->setFilter($this->form_gui->getInput(
'filter'));
 
  932            $this->server->setGroupDN($this->form_gui->getInput(
'group_dn'));
 
  933            $this->server->setGroupScope((
int) $this->form_gui->getInput(
'group_scope'));
 
  934            $this->server->setGroupFilter($this->form_gui->getInput(
'group_filter'));
 
  935            $this->server->setGroupMember($this->form_gui->getInput(
'group_member'));
 
  936            $this->server->enableGroupMemberIsDN((
int) $this->form_gui->getInput(
'memberisdn'));
 
  937            $this->server->setGroupName($this->form_gui->getInput(
'group'));
 
  938            $this->server->setGroupAttribute($this->form_gui->getInput(
'group_attribute'));
 
  939            $this->server->setGroupUserFilter($this->form_gui->getInput(
'group_user_filter'));
 
  940            $this->server->toggleMembershipOptional((
int) $this->form_gui->getInput(
'group_optional'));
 
  941            $this->server->enableSyncOnLogin((
int) $this->form_gui->getInput(
'sync_on_login'));
 
  942            $this->server->enableSyncPerCron((
int) $this->form_gui->getInput(
'sync_per_cron'));
 
  943            $this->server->setGlobalRole((
int) $this->form_gui->getInput(
'global_role'));
 
  944            $this->server->enableAccountMigration((
int) $this->form_gui->getInput(
'migration'));
 
  945            $this->server->setUsernameFilter($this->form_gui->getInput(
"name_filter"));
 
  946            $this->server->enableEscapeDN((
bool) $this->form_gui->getInput(
'escape_dn'));
 
  947            if (!$this->server->validate()) {
 
  949                $this->form_gui->setValuesByPost();
 
  950                return $this->tpl->setContent($this->form_gui->getHtml());
 
  954            if ($this->server->getServerId()) {
 
  955                $this->server->update();
 
  957                $this->server->create();
 
  962            $this->mapping->setRule(
'global_role', (
int) $this->form_gui->getInput(
'global_role'), 
false);
 
  963            $this->mapping->save();
 
  965            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  966            $this->ctrl->redirect($this, 
'serverList');
 
  970        $this->form_gui->setValuesByPost();
 
  971        return $this->tpl->setContent($this->form_gui->getHtml());
 
  983        $this->tabs_gui->clearTargets();
 
  985        $this->tabs_gui->setBackTarget(
 
  986            $this->lng->txt(
"back"),
 
  987            $this->ctrl->getLinkTarget($this, 
'serverList')
 
  994        $this->tabs_gui->addTab(
 
  996            $this->lng->txt(
"ldap_settings"),
 
  997            $this->ctrl->getLinkTarget($this, 
'editServerSettings')
 
 1001        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
 1010        $this->tabs_gui->addTab(
 
 1012            $this->lng->txt(
"ldap_user_mapping"),
 
 1013            $this->ctrl->getLinkTarget($this, 
'userMapping')
 
 1020        $this->tabs_gui->addTab(
 
 1022            $this->lng->txt(
'ldap_role_assignments'),
 
 1023            $this->ctrl->getLinkTarget($this, 
'roleAssignments')
 
 1030        $this->tabs_gui->addTab(
 
 1032            $this->lng->txt(
"ldap_role_mapping"),
 
 1033            $this->ctrl->getLinkTarget($this, 
'roleMapping')
 
 1040        include_once 
'./Services/LDAP/classes/class.ilLDAPServer.php';
 
 1041        if (!$_REQUEST[
'ldap_server_id']) {
 
 1042            $_REQUEST[
'ldap_server_id'] = 0;
 
 1044        $this->server = 
new ilLDAPServer((
int) $_REQUEST[
'ldap_server_id']);
 
 1049        include_once 
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php';
 
 1055        include_once 
'./Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php';
 
 1068        $rbacreview = 
$DIC[
'rbacreview'];
 
 1069        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
 1072            $rbacreview->getGlobalRoles(),
 
 1078        $select[0] = $this->lng->txt(
'links_select_one');
 
 1079        foreach ($global_roles as $role_id) {
 
 1096        $rbacreview = 
$DIC[
'rbacreview'];
 
 1097        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
 1099        include_once(
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php');
 
 1102            $rbacreview->getGlobalRoles(),
 
 1108        $select[0] = $this->lng->txt(
'links_select_one');
 
 1109        foreach ($global_roles as $role_id) {
 
 1129        return array(
'gender' => $this->lng->txt(
'gender'),
 
 1130                'firstname' => $this->lng->txt(
'firstname'),
 
 1131                'lastname' => $this->lng->txt(
'lastname'),
 
 1132                'title' => $this->lng->txt(
'person_title'),
 
 1133                'institution' => $this->lng->txt(
'institution'),
 
 1134                'department' => $this->lng->txt(
'department'),
 
 1135                'street' => $this->lng->txt(
'street'),
 
 1136                'city' => $this->lng->txt(
'city'),
 
 1137                'zipcode' => $this->lng->txt(
'zipcode'),
 
 1138                'country' => $this->lng->txt(
'country'),
 
 1139                'phone_office' => $this->lng->txt(
'phone_office'),
 
 1140                'phone_home' => $this->lng->txt(
'phone_home'),
 
 1141                'phone_mobile' => $this->lng->txt(
'phone_mobile'),
 
 1142                'fax' => $this->lng->txt(
'fax'),
 
 1143                'email' => $this->lng->txt(
'email'),
 
 1144                'hobby' => $this->lng->txt(
'hobby'),
 
 1145                'matriculation' => $this->lng->txt(
'matriculation'));
 
 1146        #'photo'                        => $this->lng->txt('photo')); 
 1151        include_once(
"./Services/User/classes/class.ilUserDefinedFields.php");
 
 1157        return ilUtil::formSelect(
$_POST[
'mapping_template'], 
'mapping_template', array(0 => $this->lng->txt(
'ldap_mapping_template'),
 
 1158                                                    "inetOrgPerson" => 
'inetOrgPerson',
 
 1159                                                    "organizationalPerson" => 
'organizationalPerson',
 
 1160                                                    "person" => 
'person',
 
 1161                                                    "ad_2003" => 
'Active Directory (Win 2003)'), 
false, 
true);
 
 1172        if (!isset(
$_SESSION[
'ldap_mapping_details'])) {
 
 1173            $_SESSION[
'ldap_mapping_details'] = array();
 
 1175        if (isset(
$_GET[
'details_show'])) {
 
 1178        if (isset(
$_GET[
'details_hide'])) {
 
 1193        include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
 
 1194        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
 1197        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1201                $this->form->setTitle($this->lng->txt(
'ldap_edit_role_ass_rule'));
 
 1202                $this->form->addCommandButton(
'updateRoleAssignment', $this->lng->txt(
'save'));
 
 1206                $this->form->setTitle($this->lng->txt(
'ldap_add_role_ass_rule'));
 
 1207                $this->form->addCommandButton(
'addRoleAssignment', $this->lng->txt(
'ldap_btn_add_role_ass'));
 
 1214        $role->setRequired(
true);
 
 1216        $global = 
new ilRadioOption($this->lng->txt(
'ldap_global_role'), 0);
 
 1217        $role->addOption($global);
 
 1221        $global->addSubItem($role_select);
 
 1223        $local = 
new ilRadioOption($this->lng->txt(
'ldap_local_role'), 1);
 
 1224        $role->addOption($local);
 
 1226        include_once 
'./Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php';
 
 1228        $role_search->setSize(40);
 
 1229        $local->addSubItem($role_search);
 
 1231        $role->setInfo($this->lng->txt(
'ldap_role_name_info'));
 
 1232        $this->form->addItem($role);
 
 1236        $update->setValue($this->lng->txt(
'ldap_check_role_assignment'));
 
 1239        $add->setOptionTitle($this->lng->txt(
'ldap_add_missing'));
 
 1240        $update->addSubItem($add);
 
 1243        $remove->setOptionTitle($this->lng->txt(
'ldap_remove_deprecated'));
 
 1244        $update->addSubItem($remove);
 
 1246        $this->form->addItem($update);
 
 1252        #$group->setValue($current_rule->getType()); 
 1253        $group->setRequired(
true);
 
 1258        $dn = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_dn'), 
'dn');
 
 1259        #$dn->setValue($current_rule->getDN()); 
 1261        $dn->setMaxLength(512);
 
 1262        $dn->setInfo($this->lng->txt(
'ldap_role_grp_dn_info'));
 
 1263        $radio_group->addSubItem($dn);
 
 1264        $at = 
new ilTextInputGUI($this->lng->txt(
'ldap_role_grp_at'), 
'at');
 
 1265        #$at->setValue($current_rule->getMemberAttribute()); 
 1267        $at->setMaxLength(128);
 
 1268        $radio_group->addSubItem($at);
 
 1270        #$isdn->setChecked($current_rule->isMemberAttributeDN()); 
 1271        $isdn->setInfo($this->lng->txt(
'ldap_group_member_info'));
 
 1272        $radio_group->addSubItem($isdn);
 
 1273        $radio_group->setInfo($this->lng->txt(
'ldap_role_grp_info'));
 
 1275        $group->addOption($radio_group);
 
 1280        #$name->setValue($current_rule->getAttributeName()); 
 1282        $name->setMaxLength(128);
 
 1283        #$name->setInfo($this->lng->txt('ldap_role_at_name_info')); 
 1284        $radio_attribute->addSubItem(
$name);
 
 1287        $val = 
new ilTextInputGUI($this->lng->txt(
'ldap_role_at_value'), 
'value');
 
 1288        #$val->setValue($current_rule->getAttributeValue()); 
 1290        $val->setMaxLength(128);
 
 1291        #$val->setInfo($this->lng->txt('ldap_role_at_value_info')); 
 1292        $radio_attribute->addSubItem($val);
 
 1293        $radio_attribute->setInfo($this->lng->txt(
'ldap_role_at_info'));
 
 1295        $group->addOption($radio_attribute);
 
 1300        $pl->setInfo($this->lng->txt(
'ldap_plugin_info'));
 
 1301        $pl->setDisabled(!$pl_active);
 
 1303        $id = 
new ilNumberInputGUI($this->lng->txt(
'ldap_plugin_id'), 
'plugin_id');
 
 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        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
 1325        return count($ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE, 
'LDAP', 
'ldaphk')) ? true : 
false;
 
 1334        include_once(
"./Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php");
 
 1349        $ilToolbar = 
$DIC[
'ilToolbar'];
 
 1350        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 1353        $select_form->setPostVar(
"mapping_template");
 
 1355                        "" => $this->lng->txt(
'ldap_mapping_template'),
 
 1356                        "inetOrgPerson" => 
'inetOrgPerson',
 
 1357                        "organizationalPerson" => 
'organizationalPerson',
 
 1358                        "person" => 
'person',
 
 1359                        "ad_2003" => 
'Active Directory (Win 2003)');
 
 1360        $select_form->setOptions($options);
 
 1361        $select_form->setValue(
$_POST[
'mapping_template']);
 
 1363        $ilToolbar->addInputItem($select_form);
 
 1364        $ilToolbar->addFormButton($this->lng->txt(
'show'), 
"chooseMapping");
 
 1365        $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 
"chooseMapping"));
 
 1374        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1376        $propertie_form->setTitle($this->lng->txt(
'ldap_mapping_table'));
 
 1377        $propertie_form->setFormAction($this->ctrl->getFormAction($this, 
'saveMapping'));
 
 1378        $propertie_form->addCommandButton(
'saveMapping', $this->lng->txt(
'save'));
 
 1382            $text_form->setPostVar($mapping . 
"_value");
 
 1383            $text_form->setValue($this->mapping->getValue($mapping));
 
 1384            $text_form->setSize(32);
 
 1385            $text_form->setMaxLength(255);
 
 1386            $propertie_form->addItem($text_form);
 
 1389            $checkbox_form->setPostVar($mapping . 
"_update");
 
 1390            $checkbox_form->setChecked($this->mapping->enabledUpdate($mapping));
 
 1391            $checkbox_form->setOptionTitle($this->lng->txt(
'ldap_update_field_info'));
 
 1392            $propertie_form->addItem($checkbox_form);
 
 1396        foreach ($this->udf->getDefinitions() as $definition) {
 
 1398            $text_form->setPostVar(
'udf_' . $definition[
'field_id'] . 
'_value');
 
 1399            $text_form->setValue($this->mapping->getValue(
'udf_' . $definition[
'field_id']));
 
 1400            $text_form->setSize(32);
 
 1401            $text_form->setMaxLength(255);
 
 1402            $propertie_form->addItem($text_form);
 
 1405            $checkbox_form->setPostVar(
'udf_' . $definition[
'field_id'] . 
'_update');
 
 1406            $checkbox_form->setChecked($this->mapping->enabledUpdate(
'udf_' . $definition[
'field_id']));
 
 1407            $checkbox_form->setOptionTitle($this->lng->txt(
'ldap_update_field_info'));
 
 1408            $propertie_form->addItem($checkbox_form);
 
 1411        return $propertie_form;
 
 1422        $ilToolbar = 
$DIC[
'ilToolbar'];
 
 1424        $this->tabs_gui->setTabActive(
'role_mapping');
 
 1425        $ilToolbar->addButton(
 
 1426            $this->lng->txt(
"ldap_new_role_assignment"),
 
 1427            $this->ctrl->getLinkTarget($this, 
'addRoleMapping')
 
 1429        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1432        include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
 
 1434        $propertie_form->setTitle($this->lng->txt(
'ldap_role_settings'));
 
 1435        $propertie_form->setFormAction($this->ctrl->getFormAction($this, 
"saveSyncronizationSettings"));
 
 1436        $propertie_form->addCommandButton(
"saveSyncronizationSettings", $this->lng->txt(
'save'));
 
 1438        $role_active->setPostVar(
'role_sync_active');
 
 1439        $role_active->setChecked($this->server->enabledRoleSynchronization() ? 
true : 
false);
 
 1440        $propertie_form->addItem($role_active);
 
 1442        $binding->setInfo($this->lng->txt(
'ldap_role_bind_user_info'));
 
 1444        $user->setPostVar(
"role_bind_user");
 
 1445        $user->setValue($this->server->getRoleBindDN());
 
 1447        $user->setMaxLength(255);
 
 1448        $binding->addCombinationItem(0, $user, $this->lng->txt(
'ldap_role_bind_user'));
 
 1450        $pass->setPostVar(
"role_bind_pass");
 
 1451        $pass->setValue($this->server->getRoleBindPassword());
 
 1453        $pass->setMaxLength(36);
 
 1454        $pass->setRetype(
false);
 
 1455        $binding->addCombinationItem(1, 
$pass, $this->lng->txt(
'ldap_role_bind_pass'));
 
 1456        $propertie_form->addItem($binding);
 
 1458        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.ldap_role_mappings.html', 
'Services/LDAP');
 
 1459        $this->tpl->setVariable(
"NEW_ASSIGNMENT_TBL", $propertie_form->getHTML());
 
 1462        include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php');
 
 1464        $mappings = $mapping_instance->getMappings();
 
 1465        if (count($mappings)) {
 
 1466            include_once(
"./Services/LDAP/classes/class.ilLDAPRoleMappingTableGUI.php");
 
 1468            $table_gui->setTitle($this->lng->txt(
'ldap_role_group_assignments'));
 
 1469            $table_gui->setData($mappings);
 
 1470            $this->tpl->setVariable(
"RULES_TBL", $table_gui->getHTML());
 
 1479        include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1484        $propertie_form->setTitle($this->lng->txt(
'ldap_edit_role_assignment'));
 
 1485        $propertie_form->getItemByPostVar(
"url")->setValue($mapping->getURL());
 
 1486        $propertie_form->getItemByPostVar(
"dn")->setValue($mapping->getDN());
 
 1487        $propertie_form->getItemByPostVar(
"member")->setValue($mapping->getMemberAttribute());
 
 1488        $propertie_form->getItemByPostVar(
"memberisdn")->setChecked($mapping->getMemberISDN());
 
 1489        $propertie_form->getItemByPostVar(
"role")->setValue($mapping->getRoleName());
 
 1490        $propertie_form->getItemByPostVar(
"info")->setValue($mapping->getMappingInfo());
 
 1491        $propertie_form->getItemByPostVar(
"info_type")->setChecked($mapping->getMappingInfoType());
 
 1493        $this->tpl->setContent($propertie_form->getHTML());
 
 1506        $rbacreview = 
$DIC[
'rbacreview'];
 
 1509        if ($propertie_form->checkInput() && $rbacreview->roleExists($propertie_form->getInput(
"role"))) {
 
 1510            include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1512            $mapping->setServerId($this->server->getServerId());
 
 1513            $mapping->setURL($propertie_form->getInput(
"url"));
 
 1514            $mapping->setDN($propertie_form->getInput(
"dn"));
 
 1515            $mapping->setMemberAttribute($propertie_form->getInput(
"member"));
 
 1516            $mapping->setMemberISDN($propertie_form->getInput(
"memberisdn"));
 
 1517            $mapping->setRoleByName($propertie_form->getInput(
"role"));
 
 1518            $mapping->setMappingInfo($propertie_form->getInput(
"info"));
 
 1519            $mapping->setMappingInfoType($propertie_form->getInput(
"info_type"));
 
 1522            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1523            $this->ctrl->redirect($this, 
"roleMapping");
 
 1525            if (!$rbacreview->roleExists($propertie_form->getInput(
"role"))) {
 
 1527                        $propertie_form->getInput(
"role"));
 
 1529            $propertie_form->setValuesByPost();
 
 1530            $this->tpl->setContent($propertie_form->getHTML());
 
 1539        if (!is_array(
$_POST[
'mappings'])) {
 
 1541            $this->ctrl->redirect($this, 
"roleMapping");
 
 1545        include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1549        $c_gui->setFormAction($this->ctrl->getFormAction($this, 
"deleteRoleMapping"));
 
 1550        $c_gui->setHeaderText($this->lng->txt(
"ldap_confirm_del_role_ass"));
 
 1551        $c_gui->setCancel($this->lng->txt(
"cancel"), 
"roleMapping");
 
 1552        $c_gui->setConfirm($this->lng->txt(
"confirm"), 
"deleteRoleMapping");
 
 1554        foreach (
$_POST[
'mappings'] as $id) {
 
 1555            include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1558            $txt = $this->lng->txt(
'obj_role') . 
": " . $mapping->getRoleName() . 
", ";
 
 1559            $txt .= $this->lng->txt(
'ldap_group_dn') . 
": " . $mapping->getDN() . 
", ";
 
 1560            $txt .= $this->lng->txt(
'ldap_server_short') . 
" " . $mapping->getURL() . 
", ";
 
 1561            $txt .= $this->lng->txt(
'ldap_group_member_short') . 
" " . $mapping->getMemberAttribute();
 
 1563            $c_gui->addItem(
"mappings[]", $id, 
$txt);
 
 1565        $this->tpl->setContent($c_gui->getHTML());
 
 1572        $this->ctrl->clearParameters($this);
 
 1575        return $this->tpl->setContent($this->form_gui->getHtml());
 
 1583        $this->tabs_gui->setTabActive(
'settings');
 
 1587        return $this->tpl->setContent($this->form_gui->getHtml());
 
 1602        if (!isset(
$_GET[
"ldap_server_id"])) {
 
 1608        include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1612        $c_gui->setFormAction($this->ctrl->getFormAction($this, 
"deleteServerSettings"));
 
 1613        $c_gui->setHeaderText($this->lng->txt(
"ldap_confirm_del_server_settings"));
 
 1614        $c_gui->setCancel($this->lng->txt(
"cancel"), 
"serverList");
 
 1615        $c_gui->setConfirm($this->lng->txt(
"confirm"), 
"deleteServerSettings");
 
 1618        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
 1619        foreach ((array) 
$_GET[
"ldap_server_id"] as $server_id) {
 
 1621            $c_gui->addItem(
'server_ids[]', $server_id, $setting->getName());
 
 1623        $this->tpl->setContent($c_gui->getHTML());
 
 1631        if (!is_array(
$_POST[
"server_ids"])) {
 
 1637        foreach ((array) 
$_POST[
"server_ids"] as $server_id) {
 
 1641        ilUtil::sendSuccess($this->lng->txt(
'deleted'));
 
 1654        $this->tabs_gui->setTabActive(
'user_mapping');
 
 1659        $this->tpl->setContent($propertie_form->getHTML());
 
 1668        $this->server->toggleActive(1);
 
 1669        $this->server->update();
 
 1677        $this->server->toggleActive(0);
 
 1678        $this->server->update();
 
 1692        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1694        $this->tabs_gui->setTabActive(
'role_mapping');
 
 1696        if (isset(
$_GET[
"mapping_id"])) {
 
 1697            $this->ctrl->setParameter($this, 
'mapping_id', 
$_GET[
"mapping_id"]);
 
 1701        $propertie_form->setTitle($this->lng->txt(
'ldap_mapping_table'));
 
 1702        $propertie_form->setFormAction($this->ctrl->getFormAction($this, $command));
 
 1703        $propertie_form->addCommandButton($command, $this->lng->txt(
'save'));
 
 1704        $propertie_form->addCommandButton(
"roleMapping", $this->lng->txt(
'cancel'));
 
 1707        $url->setPostVar(
"url");
 
 1709        $url->setMaxLength(255);
 
 1710        $url->setRequired(
true);
 
 1712        $group_dn = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_dn'));
 
 1713        $group_dn->setPostVar(
"dn");
 
 1714        $group_dn->setSize(50);
 
 1715        $group_dn->setMaxLength(255);
 
 1716        $group_dn->setInfo($this->lng->txt(
'ldap_dn_info'));
 
 1717        $group_dn->setRequired(
true);
 
 1719        $member = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_member'));
 
 1720        $member->setPostVar(
"member");
 
 1721        $member->setSize(32);
 
 1722        $member->setMaxLength(255);
 
 1723        $member->setInfo($this->lng->txt(
'ldap_member_info'));
 
 1724        $member->setRequired(
true);
 
 1727        $member_isdn->setPostVar(
"memberisdn");
 
 1728        $member_isdn->setOptionTitle($this->lng->txt(
'ldap_memberisdn'));
 
 1731        $role->setPostVar(
"role");
 
 1733        $role->setMaxLength(255);
 
 1734        $role->setInfo($this->lng->txt(
'ldap_role_info'));
 
 1735        $role->setRequired(
true);
 
 1738        $info->setPostVar(
"info");
 
 1741        $info->setInfo($this->lng->txt(
'ldap_info_text_info'));
 
 1744        $info_type->setPostVar(
"info_type");
 
 1745        $info_type->setOptionTitle($this->lng->txt(
'ldap_mapping_info_type'));
 
 1747        $propertie_form->addItem(
$url);
 
 1748        $propertie_form->addItem($group_dn);
 
 1749        $propertie_form->addItem($member);
 
 1750        $propertie_form->addItem($member_isdn);
 
 1751        $propertie_form->addItem($role);
 
 1752        $propertie_form->addItem($info);
 
 1753        $propertie_form->addItem($info_type);
 
 1755        return $propertie_form;
 
 1766        $propertie_form->getItemByPostVar(
"url")->setValue($this->server->getUrl());
 
 1768        if (isset(
$_GET[
"mapping_id"])) {
 
 1769            include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1773            $propertie_form->getItemByPostVar(
"url")->setValue($mapping->getURL());
 
 1774            $propertie_form->getItemByPostVar(
"dn")->setValue($mapping->getDN());
 
 1775            $propertie_form->getItemByPostVar(
"member")->setValue($mapping->getMemberAttribute());
 
 1776            $propertie_form->getItemByPostVar(
"memberisdn")->setChecked($mapping->getMemberISDN());
 
 1777            $propertie_form->getItemByPostVar(
"role")->setValue($mapping->getRoleName());
 
 1778            $propertie_form->getItemByPostVar(
"info")->setValue($mapping->getMappingInfo());
 
 1779            $propertie_form->getItemByPostVar(
"info_type")->setChecked($mapping->getMappingInfoType());
 
 1782        $this->tpl->setContent($propertie_form->getHTML());
 
 1794        $rbacreview = 
$DIC[
'rbacreview'];
 
 1797        if ($propertie_form->checkInput() && $rbacreview->roleExists($propertie_form->getInput(
"role"))) {
 
 1798            include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1800            $mapping->setServerId($this->server->getServerId());
 
 1801            $mapping->setURL($propertie_form->getInput(
"url"));
 
 1802            $mapping->setDN($propertie_form->getInput(
"dn"));
 
 1803            $mapping->setMemberAttribute($propertie_form->getInput(
"member"));
 
 1804            $mapping->setMemberISDN($propertie_form->getInput(
"memberisdn"));
 
 1805            $mapping->setRoleByName($propertie_form->getInput(
"role"));
 
 1806            $mapping->setMappingInfo($propertie_form->getInput(
"info"));
 
 1807            $mapping->setMappingInfoType($propertie_form->getInput(
"info_type"));
 
 1810            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1811            $this->ctrl->redirect($this, 
"roleMapping");
 
 1813            if (!$rbacreview->roleExists($propertie_form->getInput(
"role"))) {
 
 1815                        $propertie_form->getInput(
"role"));
 
 1817            $propertie_form->setValuesByPost();
 
 1818            $this->tpl->setContent($propertie_form->getHTML());
 
 1829        $this->server->enableRoleSynchronization((
int) 
$_POST[
'role_sync_active']);
 
 1832        if ($this->server->getServerId()) {
 
 1833            $this->server->update();
 
 1835        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1836        $this->ctrl->redirect($this, 
"roleMapping");
 
An exception for terminatinating execution or to throw for unit testing.
const IL_LDAP_BIND_ANONYMOUS
Confirmation screen class.
static _getMappingRulesByClass($a_class)
Get mapping rule by objectClass.
static _lookupGlobalRole($a_server_id)
Lookup global role assignment.
static _getInstanceByServerId($a_server_id)
Get instance of class.
static _getRules($a_server_id)
Get all rules.
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
static _getInstanceByServerId($a_server_id)
Get instance of class.
static _getServerList()
Get list of all configured servers.
static checkLDAPLib()
Check if ldap module is installed.
setSubTabs()
Set sub tabs for ldap section.
editRoleMapping()
Edit Assigments for role mapping.
checkRoleAssignmentInput($a_rule_id=0)
Check role assignment input.
prepareRoleSelect($a_as_select=true)
Used for old style table.
userMapping()
Ldap User Mapping.
saveRoleSelection()
Save role selection.
userMappingToolbar()
Create Toolbar @global ilToolbarGUI $ilToolbar.
loadRoleAssignmentRule($a_rule_id, $a_from_form=true)
Load input from form.
editRoleAssignment()
Edit role assignment.
__construct($a_auth_ref_id)
roleAssignments()
Edit role assignments.
initUserMappingForm()
Create Property Form GUI for User Mapping.
addRoleAutoCompleteObject()
Add Member for autoComplete.
saveSyncronizationSettings()
save Syncronization Settings on Role Mapping screen
confirmDeleteRoleMapping()
confirm delete role mappings
prepareGlobalRoleSelection($a_as_select=true)
New implementation for InputForm.
roleMapping()
Role Mapping Tab @global ilToolbarGUI $ilToolbar.
hasActiveRoleAssignmentPlugins()
Check if the plugin is active.
getServer()
Get server settings.
confirmDeleteRules()
Confirm delete rules.
checkAccessBool($a_permission)
confirmDeleteServerSettings()
Confirm delete rules.
createRoleMapping()
Check add screen input and save to db @global ilRbacReview $rbacreview.
setValuesByArray()
set values of form array
showRoleSelection()
show role selection
loadMappingDetails()
Load info about hide/show details.
checkAccess($a_permission)
updateRoleAssignment()
update role assignment
addRoleAssignment()
add new role assignment
addRoleMapping()
Add Assigments for role mapping.
getRoleAssignmentTable()
Show active role assignments.
initFormRoleAssignments($a_mode)
Init form table for new role assignments.
deleteRules()
delete role assignment rule
updateRoleMapping()
Check edit screen input and save to db @global ilRbacReview $rbacreview.
initRoleMappingForm($command)
init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
This class represents a non editable value in a property form.
static _lookupTitle($a_id)
lookup object title
This class represents an option in a radio group.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static _getInstance()
Get instance.
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
foreach($_POST as $key=> $value) $res