45        $ilTabs = 
$DIC[
'ilTabs'];
 
   48        $this->tabs_gui = $ilTabs;
 
   50        $this->lng->loadLanguageModule(
'ldap');
 
   54        if (
$_GET[
"cmd"] != 
"addServerSettings") {
 
   55            $this->ctrl->saveParameter($this, 
'ldap_server_id');
 
   59        $this->ref_id = $a_auth_ref_id;
 
   69        $ilAccess = 
$DIC[
'ilAccess'];
 
   70        $ilias = 
$DIC[
'ilias'];
 
   74        $next_class = $this->ctrl->getNextClass($this);
 
   75        $cmd = $this->ctrl->getCmd();
 
   77        if (!$ilAccess->checkAccess(
'write', 
'', $this->ref_id) && $cmd != 
"serverList") {
 
   79            $ilCtrl->redirect($this, 
"serverList");
 
   83        switch ($next_class) {
 
  113        $rbacreview = 
$DIC[
'rbacreview'];
 
  116        $this->tabs_gui->setTabActive(
'role_assignments');
 
  118        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.ldap_role_assignments.html', 
'Services/LDAP');
 
  120        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  122        $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->form->getHTML());
 
  126            include_once(
"./Services/LDAP/classes/class.ilLDAPRoleAssignmentTableGUI.php");
 
  128            $table_gui->setTitle($this->lng->txt(
"ldap_tbl_role_ass"));
 
  129            $table_gui->parse($rules);
 
  130            $table_gui->addMultiCommand(
"confirmDeleteRules", $this->lng->txt(
"delete"));
 
  131            $table_gui->setSelectAllCheckbox(
"rule_id");
 
  132            $this->tpl->setVariable(
'RULES_TBL', $table_gui->getHTML());
 
  144        if (!(
int) 
$_GET[
'rule_id']) {
 
  150        $this->tabs_gui->setTabActive(
'role_assignments');
 
  152        $this->ctrl->saveParameter($this, 
'rule_id', (
int) 
$_GET[
'rule_id']);
 
  153        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  159        $this->tpl->setContent($this->form->getHTML());
 
  171        $rbacreview = 
$DIC[
'rbacreview'];
 
  173        $role_id = $this->role_mapping_rule->getRoleId();
 
  174        if ($rbacreview->isGlobalRole($role_id)) {
 
  175            $val[
'role_name'] = 0;
 
  176            $val[
'role_id'] = $role_id;
 
  178            $val[
'role_name'] = 1;
 
  181        $val[
'add_missing'] = (int) $this->role_mapping_rule->isAddOnUpdateEnabled();
 
  182        $val[
'remove_deprecated'] = (int) $this->role_mapping_rule->isRemoveOnUpdateEnabled();
 
  183        $val[
'type'] = (int) $this->role_mapping_rule->getType();
 
  184        $val[
'dn'] = $this->role_mapping_rule->getDN();
 
  185        $val[
'at'] = $this->role_mapping_rule->getMemberAttribute();
 
  186        $val[
'isdn'] = $this->role_mapping_rule->isMemberAttributeDN();
 
  187        $val[
'name'] = $this->role_mapping_rule->getAttributeName();
 
  188        $val[
'value'] = $this->role_mapping_rule->getAttributeValue();
 
  189        $val[
'plugin_id'] = $this->role_mapping_rule->getPluginId();
 
  191        $this->form->setValuesByArray($val);
 
  205        $ilAccess = 
$DIC[
'ilAccess'];
 
  207        if (!$ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  209            $this->roleAssignment();
 
  213        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  214        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
  222            $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.ldap_role_assignments.html', 
'Services/LDAP');
 
  225            $this->form->setValuesByPost();
 
  226            $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->form->getHTML());
 
  227            #$this->tpl->setVariable('RULES_TBL',$this->getRoleAssignmentTable()); 
  228            $this->tabs_gui->setSubTabActive(
'shib_role_assignment');
 
  235        $this->rule->update();
 
  236        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  250        if (!is_array(
$_POST[
'rule_ids'])) {
 
  256        $this->tabs_gui->setTabActive(
'role_assignments');
 
  258        include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  262        $c_gui->setFormAction($this->ctrl->getFormAction($this, 
"deleteRules"));
 
  263        $c_gui->setHeaderText($this->lng->txt(
"ldap_confirm_del_role_ass"));
 
  264        $c_gui->setCancel($this->lng->txt(
"cancel"), 
"roleAssignments");
 
  265        $c_gui->setConfirm($this->lng->txt(
"confirm"), 
"deleteRules");
 
  268        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  269        foreach (
$_POST[
"rule_ids"] as $rule_id) {
 
  271            $c_gui->addItem(
'rule_ids[]', $rule_id, 
$rule->conditionToString());
 
  273        $this->tpl->setContent($c_gui->getHTML());
 
  284        if (!is_array(
$_POST[
'rule_ids'])) {
 
  289        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  290        foreach (
$_POST[
"rule_ids"] as $rule_id) {
 
  294        ilUtil::sendSuccess($this->lng->txt(
'ldap_deleted_rule'));
 
  310        $ilAccess = 
$DIC[
'ilAccess'];
 
  312        if (!$ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  314            $this->roleAssignment();
 
  318        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
  319        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
  327            $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.ldap_role_assignments.html', 
'Services/LDAP');
 
  330            $this->form->setValuesByPost();
 
  331            $this->tpl->setVariable(
'NEW_ASSIGNMENT_TBL', $this->form->getHTML());
 
  333            $this->tabs_gui->setSubTabActive(
'shib_role_assignment');
 
  340        $this->rule->create();
 
  341        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  353        if ($this->rule->getRoleId() > 0) {
 
  357        $_SESSION[
'ldap_role_ass'][
'rule_id'] = $_REQUEST[
'rule_id'] ? $_REQUEST[
'rule_id'] : 0;
 
  358        $_SESSION[
'ldap_role_ass'][
'role_search'] = $this->form->getInput(
'role_search');
 
  359        $_SESSION[
'ldap_role_ass'][
'add_on_update'] = $this->form->getInput(
'add_missing');
 
  360        $_SESSION[
'ldap_role_ass'][
'remove_on_update'] = $this->form->getInput(
'remove_deprecated');
 
  361        $_SESSION[
'ldap_role_ass'][
'type'] = $this->form->getInput(
'type');
 
  362        $_SESSION[
'ldap_role_ass'][
'dn'] = $this->form->getInput(
'dn');
 
  363        $_SESSION[
'ldap_role_ass'][
'at'] = $this->form->getInput(
'at');
 
  364        $_SESSION[
'ldap_role_ass'][
'isdn'] = $this->form->getInput(
'isdn');
 
  365        $_SESSION[
'ldap_role_ass'][
'name'] = $this->form->getInput(
'name');
 
  366        $_SESSION[
'ldap_role_ass'][
'value'] = $this->form->getInput(
'value');
 
  367        $_SESSION[
'ldap_role_ass'][
'plugin'] = $this->form->getInput(
'plugin_id');
 
  370        $this->ctrl->saveParameter($this, 
'rule_id');
 
  371        $this->ctrl->redirect($this, 
'showRoleSelection');
 
  383        $this->tabs_gui->setTabActive(
'role_assignment');
 
  384        $this->ctrl->saveParameter($this, 
'rule_id');
 
  386        include_once 
'./Services/Search/classes/class.ilQueryParser.php';
 
  388        $parser->setMinWordLength(1, 
true);
 
  392        include_once 
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
 
  394        $object_search->setFilter(array(
'role'));
 
  395        $res = $object_search->performSearch();
 
  397        $entries = 
$res->getEntries();
 
  399        include_once 
'./Services/AccessControl/classes/class.ilRoleSelectionTableGUI.php';
 
  401        $table->setTitle($this->lng->txt(
'ldap_role_selection'));
 
  402        $table->addMultiCommand(
'saveRoleSelection', $this->lng->txt(
'ldap_choose_role'));
 
  403        #$table->addCommandButton('roleAssignment',$this->lng->txt('cancel')); 
  406        $this->tpl->setContent(
$table->getHTML());
 
  419        $ilAccess = 
$DIC[
'ilAccess'];
 
  421        if (!$ilAccess->checkAccess(
'write', 
'', $this->ref_id)) {
 
  423            $this->roleAssignment();
 
  427        if (!(
int) $_REQUEST[
'role_id']) {
 
  434        $this->rule->setRoleId((
int) $_REQUEST[
'role_id']);
 
  436        if ((
int) $_REQUEST[
'rule_id']) {
 
  437            $this->rule->update();
 
  439            $this->rule->create();
 
  442        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  460        $this->rule->validate();
 
  461        return $ilErr->getMessage();
 
  472            include_once(
"./Services/LDAP/classes/class.ilLDAPRoleAssignmentTableGUI.php");
 
  474            $table_gui->setTitle($this->lng->txt(
"ldap_tbl_role_ass"));
 
  475            $table_gui->parse($rules);
 
  476            $table_gui->addMultiCommand(
"confirmDeleteRules", $this->lng->txt(
"delete"));
 
  477            $table_gui->setSelectAllCheckbox(
"rule_id");
 
  478            return $table_gui->getHTML();
 
  491        if (is_object($this->rule)) {
 
  495        include_once 
'./Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
 
  500            if ($this->form->getInput(
'role_name') == 0) {
 
  501                $this->rule->setRoleId($this->form->getInput(
'role_id'));
 
  502            } elseif ($this->form->getInput(
'role_search')) {
 
  504                include_once 
'./Services/Search/classes/class.ilQueryParser.php';
 
  509                $parser->setMinWordLength(1, 
true);
 
  513                include_once 
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
 
  515                $object_search->setFilter(array(
'role'));
 
  516                $res = $object_search->performSearch();
 
  518                $entries = 
$res->getEntries();
 
  519                if (count($entries) == 1) {
 
  520                    $role = current($entries);
 
  521                    $this->rule->setRoleId($role[
'obj_id']);
 
  522                } elseif (count($entries) > 1) {
 
  523                    $this->rule->setRoleId(-1);
 
  527            $this->rule->setAttributeName($this->form->getInput(
'name'));
 
  528            $this->rule->setAttributeValue($this->form->getInput(
'value'));
 
  529            $this->rule->setDN($this->form->getInput(
'dn'));
 
  530            $this->rule->setMemberAttribute($this->form->getInput(
'at'));
 
  531            $this->rule->setMemberIsDN($this->form->getInput(
'isdn'));
 
  532            $this->rule->enableAddOnUpdate($this->form->getInput(
'add_missing'));
 
  533            $this->rule->enableRemoveOnUpdate($this->form->getInput(
'remove_deprecated'));
 
  534            $this->rule->setPluginId($this->form->getInput(
'plugin_id'));
 
  535            $this->rule->setType($this->form->getInput(
'type'));
 
  536            $this->rule->setServerId($this->
getServer()->getServerId());
 
  542        $this->rule->setServerId($this->
getServer()->getServerId());
 
  543        $this->rule->enableAddOnUpdate((
int) 
$_SESSION[
'ldap_role_ass'][
'add_on_update']);
 
  544        $this->rule->enableRemoveOnUpdate((
int) 
$_SESSION[
'ldap_role_ass'][
'remove_on_update']);
 
  557        if (!count(
$_POST[
'mappings'])) {
 
  565        foreach (
$_POST[
'mappings'] as $mapping_id) {
 
  566            $this->role_mapping->delete($mapping_id);
 
  568        ilUtil::sendSuccess($this->lng->txt(
'ldap_deleted_role_mapping'));
 
  575        if (!
$_POST[
'mapping_template']) {
 
  581        $this->mapping->clearRules();
 
  583        include_once(
'Services/LDAP/classes/class.ilLDAPAttributeMappingUtils.php');
 
  585            $this->mapping->setRule(
$key, $value, 0);
 
  594        $this->tabs_gui->setTabActive(
'role_mapping');
 
  600        foreach ($this->udf->getDefinitions() as $definition) {
 
  601            $key = 
'udf_' . $definition[
'field_id'];
 
  605        $this->mapping->save();
 
  608        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
 
  609        unset(
$_POST[
'mapping_template']);
 
  617        $ilAccess = 
$DIC[
'ilAccess'];
 
  619        $ilToolbar = 
$DIC[
'ilToolbar'];
 
  621        if (!$ilAccess->checkAccess(
'read', 
'', $this->ref_id) && $cmd != 
"serverList") {
 
  622            $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'), 
$ilErr->WARNING);
 
  626            ilUtil::sendFailure(
'Missing LDAP libraries. Please ensure that the PHP LDAP module is installed on your server.');
 
  629        $ilToolbar->addButton(
 
  630            $this->lng->txt(
"add_ldap_server"),
 
  631            $this->ctrl->getLinkTarget($this, 
"addServerSettings")
 
  634        include_once 
'./Services/LDAP/classes/class.ilLDAPServerTableGUI.php';
 
  639        return $this->tpl->setContent(
$table->getHTML());
 
  644        $this->form_gui->setValuesByArray(array(
 
  645            'active' => $this->server->isActive(),
 
  646            'ds' => !$this->server->isAuthenticationEnabled(),
 
  647            'server_name' => $this->server->getName(),
 
  648            'server_url' => $this->server->getUrlString(),
 
  649            'version' => $this->server->getVersion(),
 
  650            'base_dn' => $this->server->getBaseDN(),
 
  651            'referrals' => $this->server->isActiveReferrer(),
 
  652            'tls' => $this->server->isActiveTLS(),
 
  653            'binding_type' => $this->server->getBindingType(),
 
  654            'bind_dn' => $this->server->getBindUser(),
 
  655            'bind_pass' => $this->server->getBindPassword(),
 
  656            'bind_pass_retype' => $this->server->getBindPassword(),
 
  657            'search_base' => $this->server->getSearchBase(),
 
  658            'user_scope' => $this->server->getUserScope(),
 
  659            'user_attribute' => $this->server->getUserAttribute(),
 
  660            'filter' => $this->server->getFilter(),
 
  661            'group_dn' => $this->server->getGroupDN(),
 
  662            'group_scope' => $this->server->getGroupScope(),
 
  663            'group_filter' => $this->server->getGroupFilter(),
 
  664            'group_member' => $this->server->getGroupMember(),
 
  665            'memberisdn' => $this->server->enabledGroupMemberIsDN(),
 
  666            'group' => $this->server->getGroupName(),
 
  667            'group_attribute' => $this->server->getGroupAttribute(),
 
  668            'group_optional' => $this->server->isMembershipOptional(),
 
  669            'group_user_filter' => $this->server->getGroupUserFilter(),
 
  670            'sync_on_login' => $this->server->enabledSyncOnLogin(),
 
  671            'sync_per_cron' => $this->server->enabledSyncPerCron(),
 
  673            'migration' => (
int) $this->server->isAccountMigrationEnabled(),
 
  674            "name_filter" => $this->server->getUsernameFilter(),
 
  675            'escape_dn' => $this->server->enabledEscapeDN()
 
  681        include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  684        $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 
'save'));
 
  685        $this->form_gui->setTitle($this->lng->txt(
'ldap_configure'));
 
  688        $active->setValue(1);
 
  689        $this->form_gui->addItem($active);
 
  693        $ds->setInfo($this->lng->txt(
'ldap_as_ds_info'));
 
  694        $this->form_gui->addItem($ds);
 
  696        $servername = 
new ilTextInputGUI($this->lng->txt(
'ldap_server_name'), 
'server_name');
 
  697        $servername->setRequired(
true);
 
  698        $servername->setInfo($this->lng->txt(
'ldap_server_name_info'));
 
  699        $servername->setSize(32);
 
  700        $servername->setMaxLength(32);
 
  701        $this->form_gui->addItem($servername);
 
  704        $namefilter = 
new ilTextInputGUI($this->lng->txt(
'ldap_username_filter'), 
"name_filter");
 
  705        $namefilter->setInfo($this->lng->txt(
"ldap_username_filter_info"));
 
  706        $namefilter->setSize(64);
 
  707        $namefilter->setMaxLength(255);
 
  708        $this->form_gui->addItem($namefilter);
 
  711        $serverurl = 
new ilTextInputGUI($this->lng->txt(
'ldap_server'), 
'server_url');
 
  712        $serverurl->setRequired(
true);
 
  713        $serverurl->setInfo($this->lng->txt(
'ldap_server_url_info'));
 
  714        $serverurl->setSize(64);
 
  715        $serverurl->setMaxLength(255);
 
  716        $this->form_gui->addItem($serverurl);
 
  719        $version->setOptions(array(2 => 2, 3 => 3));
 
  720        $version->setInfo($this->lng->txt(
'ldap_server_version_info'));
 
  723        $basedsn = 
new ilTextInputGUI($this->lng->txt(
'basedn'), 
'base_dn');
 
  724        $basedsn->setRequired(
true);
 
  725        $basedsn->setSize(64);
 
  726        $basedsn->setMaxLength(255);
 
  727        $this->form_gui->addItem($basedsn);
 
  730        $referrals->setValue(1);
 
  731        $referrals->setInfo($this->lng->txt(
'ldap_referrals_info'));
 
  732        $this->form_gui->addItem($referrals);
 
  735        $section_security->setTitle($this->lng->txt(
'ldap_server_security_settings'));
 
  736        $this->form_gui->addItem($section_security);
 
  740        $this->form_gui->addItem($tls);
 
  746        $dn = 
new ilTextInputGUI($this->lng->txt(
'ldap_server_bind_dn'), 
'bind_dn');
 
  748        $dn->setMaxLength(255);
 
  749        $user->addSubItem($dn);
 
  751        $pass->setSkipSyntaxCheck(
true);
 
  753        $pass->setMaxLength(36);
 
  759        $section_auth->setTitle($this->lng->txt(
'ldap_authentication_settings'));
 
  760        $this->form_gui->addItem($section_auth);
 
  762        $search_base = 
new ilTextInputGUI($this->lng->txt(
'ldap_user_dn'), 
'search_base');
 
  763        $search_base->setInfo($this->lng->txt(
'ldap_search_base_info'));
 
  764        $search_base->setSize(64);
 
  765        $search_base->setMaxLength(255);
 
  766        $this->form_gui->addItem($search_base);
 
  768        $user_scope = 
new ilSelectInputGUI($this->lng->txt(
'ldap_user_scope'), 
'user_scope');
 
  769        $user_scope->setOptions(array(
IL_LDAP_SCOPE_ONE => $this->lng->txt(
'ldap_scope_one'),
 
  771        $user_scope->setInfo($this->lng->txt(
'ldap_user_scope_info'));
 
  772        $this->form_gui->addItem($user_scope);
 
  774        $user_attribute = 
new ilTextInputGUI($this->lng->txt(
'ldap_user_attribute'), 
'user_attribute');
 
  775        $user_attribute->setSize(16);
 
  776        $user_attribute->setMaxLength(64);
 
  777        $user_attribute->setRequired(
true);
 
  778        $this->form_gui->addItem($user_attribute);
 
  780        $filter = 
new ilTextInputGUI($this->lng->txt(
'ldap_search_filter'), 
'filter');
 
  781        $filter->setInfo($this->lng->txt(
'ldap_filter_info'));
 
  782        $filter->setSize(64);
 
  783        $filter->setMaxLength(512);
 
  784        $this->form_gui->addItem($filter);
 
  787        $section_restrictions->setTitle($this->lng->txt(
'ldap_group_restrictions'));
 
  788        $this->form_gui->addItem($section_restrictions);
 
  790        $group_dn = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_search_base'), 
'group_dn');
 
  791        $group_dn->setInfo($this->lng->txt(
'ldap_group_dn_info'));
 
  792        $group_dn->setSize(64);
 
  793        $group_dn->setMaxLength(255);
 
  794        $this->form_gui->addItem($group_dn);
 
  796        $group_scope = 
new ilSelectInputGUI($this->lng->txt(
'ldap_group_scope'), 
'group_scope');
 
  797        $group_scope->setOptions(array(
IL_LDAP_SCOPE_ONE => $this->lng->txt(
'ldap_scope_one'),
 
  799        $group_scope->setInfo($this->lng->txt(
'ldap_group_scope_info'));
 
  800        $this->form_gui->addItem($group_scope);
 
  802        $group_filter = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_filter'), 
'group_filter');
 
  803        $group_filter->setInfo($this->lng->txt(
'ldap_group_filter_info'));
 
  804        $group_filter->setSize(64);
 
  805        $group_filter->setMaxLength(255);
 
  806        $this->form_gui->addItem($group_filter);
 
  808        $group_member = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_member'), 
'group_member');
 
  809        $group_member->setInfo($this->lng->txt(
'ldap_group_member_info'));
 
  810        $group_member->setSize(32);
 
  811        $group_member->setMaxLength(255);
 
  812        $this->form_gui->addItem($group_member);
 
  815        $group_member_isdn = 
new ilCheckboxInputGUI($this->lng->txt(
'ldap_memberisdn'), 
'memberisdn');
 
  816        #$group_member_isdn->setInfo($this->lng->txt('ldap_group_member_info')); 
  817        $this->form_gui->addItem($group_member_isdn);
 
  818        #$group_member->addSubItem($group_member_isdn); 
  821        $escapedn->setValue(1);
 
  822        $escapedn->setInfo($this->lng->txt(
'ldap_escapedn_info'));
 
  823        $this->form_gui->addItem($escapedn);
 
  825        $group = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_name'), 
'group');
 
  826        $group->setInfo($this->lng->txt(
'ldap_group_name_info'));
 
  828        $group->setMaxLength(255);
 
  829        $this->form_gui->addItem($group);
 
  831        $group_atrr = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_attribute'), 
'group_attribute');
 
  832        $group_atrr->setInfo($this->lng->txt(
'ldap_group_attribute_info'));
 
  833        $group_atrr->setSize(16);
 
  834        $group_atrr->setMaxLength(64);
 
  835        $this->form_gui->addItem($group_atrr);
 
  837        $group_optional = 
new ilCheckboxInputGUI($this->lng->txt(
'ldap_group_membership'), 
'group_optional');
 
  838        $group_optional->setOptionTitle($this->lng->txt(
'ldap_group_member_optional'));
 
  839        $group_optional->setInfo($this->lng->txt(
'ldap_group_optional_info'));
 
  840        $group_optional->setValue(1);
 
  841        $group_user_filter = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_user_filter'), 
'group_user_filter');
 
  842        $group_user_filter->setSize(64);
 
  843        $group_user_filter->setMaxLength(255);
 
  844        $group_optional->addSubItem($group_user_filter);
 
  845        $this->form_gui->addItem($group_optional);
 
  848        $section_sync->setTitle($this->lng->txt(
'ldap_user_sync'));
 
  849        $this->form_gui->addItem($section_sync);
 
  852        $sync_on_login = 
new ilCheckboxInputGUI($this->lng->txt(
'ldap_sync_login'), 
'sync_on_login');
 
  853        $sync_on_login->setValue(1);
 
  854        $ci_gui->addSubItem($sync_on_login);
 
  855        $sync_per_cron = 
new ilCheckboxInputGUI($this->lng->txt(
'ldap_sync_cron'), 
'sync_per_cron');
 
  856        $sync_per_cron->setValue(1);
 
  857        $ci_gui->addSubItem($sync_per_cron);
 
  858        $ci_gui->setInfo($this->lng->txt(
'ldap_user_sync_info'));
 
  859        $this->form_gui->addItem($ci_gui);
 
  861        $global_role = 
new ilSelectInputGUI($this->lng->txt(
'ldap_global_role_assignment'), 
'global_role');
 
  863        $global_role->setInfo($this->lng->txt(
'ldap_global_role_info'));
 
  864        $this->form_gui->addItem($global_role);
 
  867        $migr->setInfo($this->lng->txt(
'auth_ldap_migration_info'));
 
  869        $this->form_gui->addItem($migr);
 
  872        include_once 
"Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
 
  880        $this->form_gui->addCommandButton(
'save', $this->lng->txt(
'save'));
 
  881        if (
$_GET[
"cmd"] == 
"addServerSettings") {
 
  882            $this->form_gui->addCommandButton(
'serverList', $this->lng->txt(
'cancel'));
 
  896        $this->tabs_gui->setTabActive(
'settings');
 
  899        if ($this->form_gui->checkInput()) {
 
  900            $this->server->toggleActive((
int) $this->form_gui->getInput(
'active'));
 
  901            $this->server->enableAuthentication(!$this->form_gui->getInput(
'ds'));
 
  902            $this->server->setName($this->form_gui->getInput(
'server_name'));
 
  903            $this->server->setUrl($this->form_gui->getInput(
'server_url'));
 
  904            $this->server->setVersion($this->form_gui->getInput(
'version'));
 
  905            $this->server->setBaseDN($this->form_gui->getInput(
'base_dn'));
 
  906            $this->server->toggleReferrer($this->form_gui->getInput(
'referrals'));
 
  907            $this->server->toggleTLS($this->form_gui->getInput(
'tls'));
 
  908            $this->server->setBindingType((
int) $this->form_gui->getInput(
'binding_type'));
 
  909            $this->server->setBindUser($this->form_gui->getInput(
'bind_dn'));
 
  910            $this->server->setBindPassword($this->form_gui->getInput(
'bind_pass'));
 
  911            $this->server->setSearchBase($this->form_gui->getInput(
'search_base'));
 
  912            $this->server->setUserScope($this->form_gui->getInput(
'user_scope'));
 
  913            $this->server->setUserAttribute($this->form_gui->getInput(
'user_attribute'));
 
  914            $this->server->setFilter($this->form_gui->getInput(
'filter'));
 
  915            $this->server->setGroupDN($this->form_gui->getInput(
'group_dn'));
 
  916            $this->server->setGroupScope((
int) $this->form_gui->getInput(
'group_scope'));
 
  917            $this->server->setGroupFilter($this->form_gui->getInput(
'group_filter'));
 
  918            $this->server->setGroupMember($this->form_gui->getInput(
'group_member'));
 
  919            $this->server->enableGroupMemberIsDN((
int) $this->form_gui->getInput(
'memberisdn'));
 
  920            $this->server->setGroupName($this->form_gui->getInput(
'group'));
 
  921            $this->server->setGroupAttribute($this->form_gui->getInput(
'group_attribute'));
 
  922            $this->server->setGroupUserFilter($this->form_gui->getInput(
'group_user_filter'));
 
  923            $this->server->toggleMembershipOptional((
int) $this->form_gui->getInput(
'group_optional'));
 
  924            $this->server->enableSyncOnLogin((
int) $this->form_gui->getInput(
'sync_on_login'));
 
  925            $this->server->enableSyncPerCron((
int) $this->form_gui->getInput(
'sync_per_cron'));
 
  926            $this->server->setGlobalRole((
int) $this->form_gui->getInput(
'global_role'));
 
  927            $this->server->enableAccountMigration((
int) $this->form_gui->getInput(
'migration'));
 
  928            $this->server->setUsernameFilter($this->form_gui->getInput(
"name_filter"));
 
  929            $this->server->enableEscapeDN((
bool) $this->form_gui->getInput(
'escape_dn'));
 
  930            if (!$this->server->validate()) {
 
  932                $this->form_gui->setValuesByPost();
 
  933                return $this->tpl->setContent($this->form_gui->getHtml());
 
  937            if ($this->server->getServerId()) {
 
  938                $this->server->update();
 
  940                $this->server->create();
 
  945            $this->mapping->setRule(
'global_role', (
int) $this->form_gui->getInput(
'global_role'), 
false);
 
  946            $this->mapping->save();
 
  948            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
  949            $this->ctrl->redirect($this, 
'serverList');
 
  953        $this->form_gui->setValuesByPost();
 
  954        return $this->tpl->setContent($this->form_gui->getHtml());
 
  966        $this->tabs_gui->clearTargets();
 
  968        $this->tabs_gui->setBackTarget(
 
  969            $this->lng->txt(
"back"),
 
  970            $this->ctrl->getLinkTarget($this, 
'serverList')
 
  977        $this->tabs_gui->addTab(
 
  979            $this->lng->txt(
"ldap_settings"),
 
  980            $this->ctrl->getLinkTarget($this, 
'editServerSettings')
 
  984        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
  993        $this->tabs_gui->addTab(
 
  995            $this->lng->txt(
"ldap_user_mapping"),
 
  996            $this->ctrl->getLinkTarget($this, 
'userMapping')
 
 1003        $this->tabs_gui->addTab(
 
 1005            $this->lng->txt(
'ldap_role_assignments'),
 
 1006            $this->ctrl->getLinkTarget($this, 
'roleAssignments')
 
 1013        $this->tabs_gui->addTab(
 
 1015            $this->lng->txt(
"ldap_role_mapping"),
 
 1016            $this->ctrl->getLinkTarget($this, 
'roleMapping')
 
 1023        include_once 
'./Services/LDAP/classes/class.ilLDAPServer.php';
 
 1024        if (!$_REQUEST[
'ldap_server_id']) {
 
 1025            $_REQUEST[
'ldap_server_id'] = 0;
 
 1027        $this->server = 
new ilLDAPServer((
int) $_REQUEST[
'ldap_server_id']);
 
 1032        include_once 
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php';
 
 1038        include_once 
'./Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php';
 
 1051        $rbacreview = 
$DIC[
'rbacreview'];
 
 1052        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
 1055            $rbacreview->getGlobalRoles(),
 
 1061        $select[0] = $this->lng->txt(
'links_select_one');
 
 1062        foreach ($global_roles as $role_id) {
 
 1079        $rbacreview = 
$DIC[
'rbacreview'];
 
 1080        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
 1082        include_once(
'./Services/LDAP/classes/class.ilLDAPAttributeMapping.php');
 
 1085            $rbacreview->getGlobalRoles(),
 
 1091        $select[0] = $this->lng->txt(
'links_select_one');
 
 1092        foreach ($global_roles as $role_id) {
 
 1112        return array(
'gender' => $this->lng->txt(
'gender'),
 
 1113                'firstname' => $this->lng->txt(
'firstname'),
 
 1114                'lastname' => $this->lng->txt(
'lastname'),
 
 1115                'title' => $this->lng->txt(
'person_title'),
 
 1116                'institution' => $this->lng->txt(
'institution'),
 
 1117                'department' => $this->lng->txt(
'department'),
 
 1118                'street' => $this->lng->txt(
'street'),
 
 1119                'city' => $this->lng->txt(
'city'),
 
 1120                'zipcode' => $this->lng->txt(
'zipcode'),
 
 1121                'country' => $this->lng->txt(
'country'),
 
 1122                'phone_office' => $this->lng->txt(
'phone_office'),
 
 1123                'phone_home' => $this->lng->txt(
'phone_home'),
 
 1124                'phone_mobile' => $this->lng->txt(
'phone_mobile'),
 
 1125                'fax' => $this->lng->txt(
'fax'),
 
 1126                'email' => $this->lng->txt(
'email'),
 
 1127                'hobby' => $this->lng->txt(
'hobby'),
 
 1128                'matriculation' => $this->lng->txt(
'matriculation'));
 
 1129        #'photo'                        => $this->lng->txt('photo')); 
 1134        include_once(
"./Services/User/classes/class.ilUserDefinedFields.php");
 
 1140        return ilUtil::formSelect(
$_POST[
'mapping_template'], 
'mapping_template', array(0 => $this->lng->txt(
'ldap_mapping_template'),
 
 1141                                                    "inetOrgPerson" => 
'inetOrgPerson',
 
 1142                                                    "organizationalPerson" => 
'organizationalPerson',
 
 1143                                                    "person" => 
'person',
 
 1144                                                    "ad_2003" => 
'Active Directory (Win 2003)'), 
false, 
true);
 
 1155        if (!isset(
$_SESSION[
'ldap_mapping_details'])) {
 
 1156            $_SESSION[
'ldap_mapping_details'] = array();
 
 1158        if (isset(
$_GET[
'details_show'])) {
 
 1161        if (isset(
$_GET[
'details_hide'])) {
 
 1176        include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
 
 1177        include_once(
'Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
 
 1180        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
 1184                $this->form->setTitle($this->lng->txt(
'ldap_edit_role_ass_rule'));
 
 1185                $this->form->addCommandButton(
'updateRoleAssignment', $this->lng->txt(
'save'));
 
 1189                $this->form->setTitle($this->lng->txt(
'ldap_add_role_ass_rule'));
 
 1190                $this->form->addCommandButton(
'addRoleAssignment', $this->lng->txt(
'ldap_btn_add_role_ass'));
 
 1197        $role->setRequired(
true);
 
 1199        $global = 
new ilRadioOption($this->lng->txt(
'ldap_global_role'), 0);
 
 1200        $role->addOption($global);
 
 1204        $global->addSubItem($role_select);
 
 1206        $local = 
new ilRadioOption($this->lng->txt(
'ldap_local_role'), 1);
 
 1207        $role->addOption($local);
 
 1209        include_once 
'./Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php';
 
 1211        $role_search->setSize(40);
 
 1212        $local->addSubItem($role_search);
 
 1214        $role->setInfo($this->lng->txt(
'ldap_role_name_info'));
 
 1215        $this->form->addItem($role);
 
 1219        $update->setValue($this->lng->txt(
'ldap_check_role_assignment'));
 
 1222        $add->setOptionTitle($this->lng->txt(
'ldap_add_missing'));
 
 1223        $update->addSubItem($add);
 
 1226        $remove->setOptionTitle($this->lng->txt(
'ldap_remove_deprecated'));
 
 1227        $update->addSubItem($remove);
 
 1229        $this->form->addItem($update);
 
 1235        #$group->setValue($current_rule->getType()); 
 1236        $group->setRequired(
true);
 
 1241        $dn = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_dn'), 
'dn');
 
 1242        #$dn->setValue($current_rule->getDN()); 
 1244        $dn->setMaxLength(512);
 
 1245        $dn->setInfo($this->lng->txt(
'ldap_role_grp_dn_info'));
 
 1246        $radio_group->addSubItem($dn);
 
 1247        $at = 
new ilTextInputGUI($this->lng->txt(
'ldap_role_grp_at'), 
'at');
 
 1248        #$at->setValue($current_rule->getMemberAttribute()); 
 1250        $at->setMaxLength(128);
 
 1251        $radio_group->addSubItem($at);
 
 1253        #$isdn->setChecked($current_rule->isMemberAttributeDN()); 
 1254        $isdn->setInfo($this->lng->txt(
'ldap_group_member_info'));
 
 1255        $radio_group->addSubItem($isdn);
 
 1256        $radio_group->setInfo($this->lng->txt(
'ldap_role_grp_info'));
 
 1258        $group->addOption($radio_group);
 
 1263        #$name->setValue($current_rule->getAttributeName()); 
 1265        $name->setMaxLength(128);
 
 1266        #$name->setInfo($this->lng->txt('ldap_role_at_name_info')); 
 1267        $radio_attribute->addSubItem(
$name);
 
 1270        $val = 
new ilTextInputGUI($this->lng->txt(
'ldap_role_at_value'), 
'value');
 
 1271        #$val->setValue($current_rule->getAttributeValue()); 
 1273        $val->setMaxLength(128);
 
 1274        #$val->setInfo($this->lng->txt('ldap_role_at_value_info')); 
 1275        $radio_attribute->addSubItem($val);
 
 1276        $radio_attribute->setInfo($this->lng->txt(
'ldap_role_at_info'));
 
 1278        $group->addOption($radio_attribute);
 
 1283        $pl->setInfo($this->lng->txt(
'ldap_plugin_info'));
 
 1284        $pl->setDisabled(!$pl_active);
 
 1287        $id->setDisabled(!$pl_active);
 
 1289        $id->setMaxLength(3);
 
 1290        $id->setMaxValue(999);
 
 1291        $id->setMinValue(1);
 
 1292        $pl->addSubItem(
$id);
 
 1294        $group->addOption($pl);
 
 1295        $this->form->addItem($group);
 
 1306        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
 1308        return count($ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE, 
'LDAP', 
'ldaphk')) ? true : 
false;
 
 1317        include_once(
"./Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php");
 
 1332        $ilToolbar = 
$DIC[
'ilToolbar'];
 
 1333        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 1336        $select_form->setPostVar(
"mapping_template");
 
 1338                        "" => $this->lng->txt(
'ldap_mapping_template'),
 
 1339                        "inetOrgPerson" => 
'inetOrgPerson',
 
 1340                        "organizationalPerson" => 
'organizationalPerson',
 
 1341                        "person" => 
'person',
 
 1342                        "ad_2003" => 
'Active Directory (Win 2003)');
 
 1343        $select_form->setOptions(
$options);
 
 1344        $select_form->setValue(
$_POST[
'mapping_template']);
 
 1346        $ilToolbar->addInputItem($select_form);
 
 1347        $ilToolbar->addFormButton($this->lng->txt(
'show'), 
"chooseMapping");
 
 1348        $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 
"chooseMapping"));
 
 1357        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1359        $propertie_form->setTitle($this->lng->txt(
'ldap_mapping_table'));
 
 1360        $propertie_form->setFormAction($this->ctrl->getFormAction($this, 
'saveMapping'));
 
 1361        $propertie_form->addCommandButton(
'saveMapping', $this->lng->txt(
'save'));
 
 1365            $text_form->setPostVar($mapping . 
"_value");
 
 1366            $text_form->setValue($this->mapping->getValue($mapping));
 
 1367            $text_form->setSize(32);
 
 1368            $text_form->setMaxLength(255);
 
 1369            $propertie_form->addItem($text_form);
 
 1372            $checkbox_form->setPostVar($mapping . 
"_update");
 
 1373            $checkbox_form->setChecked($this->mapping->enabledUpdate($mapping));
 
 1374            $checkbox_form->setOptionTitle($this->lng->txt(
'ldap_update_field_info'));
 
 1375            $propertie_form->addItem($checkbox_form);
 
 1379        foreach ($this->udf->getDefinitions() as $definition) {
 
 1381            $text_form->setPostVar(
'udf_' . $definition[
'field_id'] . 
'_value');
 
 1382            $text_form->setValue($this->mapping->getValue(
'udf_' . $definition[
'field_id']));
 
 1383            $text_form->setSize(32);
 
 1384            $text_form->setMaxLength(255);
 
 1385            $propertie_form->addItem($text_form);
 
 1388            $checkbox_form->setPostVar(
'udf_' . $definition[
'field_id'] . 
'_update');
 
 1389            $checkbox_form->setChecked($this->mapping->enabledUpdate(
'udf_' . $definition[
'field_id']));
 
 1390            $checkbox_form->setOptionTitle($this->lng->txt(
'ldap_update_field_info'));
 
 1391            $propertie_form->addItem($checkbox_form);
 
 1394        return $propertie_form;
 
 1405        $ilToolbar = 
$DIC[
'ilToolbar'];
 
 1407        $this->tabs_gui->setTabActive(
'role_mapping');
 
 1408        $ilToolbar->addButton(
 
 1409            $this->lng->txt(
"ldap_new_role_assignment"),
 
 1410            $this->ctrl->getLinkTarget($this, 
'addRoleMapping')
 
 1412        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1415        include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
 
 1417        $propertie_form->setTitle($this->lng->txt(
'ldap_role_settings'));
 
 1418        $propertie_form->setFormAction($this->ctrl->getFormAction($this, 
"saveSyncronizationSettings"));
 
 1419        $propertie_form->addCommandButton(
"saveSyncronizationSettings", $this->lng->txt(
'save'));
 
 1421        $role_active->setPostVar(
'role_sync_active');
 
 1422        $role_active->setChecked($this->server->enabledRoleSynchronization() ? 
true : 
false);
 
 1423        $propertie_form->addItem($role_active);
 
 1425        $binding->setInfo($this->lng->txt(
'ldap_role_bind_user_info'));
 
 1427        $user->setPostVar(
"role_bind_user");
 
 1428        $user->setValue($this->server->getRoleBindDN());
 
 1430        $user->setMaxLength(255);
 
 1431        $binding->addCombinationItem(0, 
$user, $this->lng->txt(
'ldap_role_bind_user'));
 
 1433        $pass->setPostVar(
"role_bind_pass");
 
 1434        $pass->setValue($this->server->getRoleBindPassword());
 
 1436        $pass->setMaxLength(36);
 
 1437        $pass->setRetype(
false);
 
 1438        $binding->addCombinationItem(1, 
$pass, $this->lng->txt(
'ldap_role_bind_pass'));
 
 1439        $propertie_form->addItem(
$binding);
 
 1441        $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.ldap_role_mappings.html', 
'Services/LDAP');
 
 1442        $this->tpl->setVariable(
"NEW_ASSIGNMENT_TBL", $propertie_form->getHTML());
 
 1445        include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php');
 
 1447        $mappings = $mapping_instance->getMappings();
 
 1448        if (count($mappings)) {
 
 1449            include_once(
"./Services/LDAP/classes/class.ilLDAPRoleMappingTableGUI.php");
 
 1451            $table_gui->setTitle($this->lng->txt(
'ldap_role_group_assignments'));
 
 1452            $table_gui->setData($mappings);
 
 1453            $this->tpl->setVariable(
"RULES_TBL", $table_gui->getHTML());
 
 1462        include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1467        $propertie_form->setTitle($this->lng->txt(
'ldap_edit_role_assignment'));
 
 1468        $propertie_form->getItemByPostVar(
"url")->setValue($mapping->getURL());
 
 1469        $propertie_form->getItemByPostVar(
"dn")->setValue($mapping->getDN());
 
 1470        $propertie_form->getItemByPostVar(
"member")->setValue($mapping->getMemberAttribute());
 
 1471        $propertie_form->getItemByPostVar(
"memberisdn")->setChecked($mapping->getMemberISDN());
 
 1472        $propertie_form->getItemByPostVar(
"role")->setValue($mapping->getRoleName());
 
 1473        $propertie_form->getItemByPostVar(
"info")->setValue($mapping->getMappingInfo());
 
 1474        $propertie_form->getItemByPostVar(
"info_type")->setChecked($mapping->getMappingInfoType());
 
 1476        $this->tpl->setContent($propertie_form->getHTML());
 
 1489        $rbacreview = 
$DIC[
'rbacreview'];
 
 1492        if ($propertie_form->checkInput() && $rbacreview->roleExists($propertie_form->getInput(
"role"))) {
 
 1493            include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1495            $mapping->setServerId($this->server->getServerId());
 
 1496            $mapping->setURL($propertie_form->getInput(
"url"));
 
 1497            $mapping->setDN($propertie_form->getInput(
"dn"));
 
 1498            $mapping->setMemberAttribute($propertie_form->getInput(
"member"));
 
 1499            $mapping->setMemberISDN($propertie_form->getInput(
"memberisdn"));
 
 1500            $mapping->setRoleByName($propertie_form->getInput(
"role"));
 
 1501            $mapping->setMappingInfo($propertie_form->getInput(
"info"));
 
 1502            $mapping->setMappingInfoType($propertie_form->getInput(
"info_type"));
 
 1505            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1506            $this->ctrl->redirect($this, 
"roleMapping");
 
 1508            if (!$rbacreview->roleExists($propertie_form->getInput(
"role"))) {
 
 1510                        $propertie_form->getInput(
"role"));
 
 1512            $propertie_form->setValuesByPost();
 
 1513            $this->tpl->setContent($propertie_form->getHTML());
 
 1522        if (!is_array(
$_POST[
'mappings'])) {
 
 1524            $this->ctrl->redirect($this, 
"roleMapping");
 
 1528        include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1532        $c_gui->setFormAction($this->ctrl->getFormAction($this, 
"deleteRoleMapping"));
 
 1533        $c_gui->setHeaderText($this->lng->txt(
"ldap_confirm_del_role_ass"));
 
 1534        $c_gui->setCancel($this->lng->txt(
"cancel"), 
"roleMapping");
 
 1535        $c_gui->setConfirm($this->lng->txt(
"confirm"), 
"deleteRoleMapping");
 
 1538            include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1541            $txt = $this->lng->txt(
'obj_role') . 
": " . $mapping->getRoleName() . 
", ";
 
 1542            $txt .= $this->lng->txt(
'ldap_group_dn') . 
": " . $mapping->getDN() . 
", ";
 
 1543            $txt .= $this->lng->txt(
'ldap_server_short') . 
" " . $mapping->getURL() . 
", ";
 
 1544            $txt .= $this->lng->txt(
'ldap_group_member_short') . 
" " . $mapping->getMemberAttribute();
 
 1546            $c_gui->addItem(
"mappings[]", 
$id, 
$txt);
 
 1548        $this->tpl->setContent($c_gui->getHTML());
 
 1553        $this->ctrl->clearParameters($this);
 
 1556        return $this->tpl->setContent($this->form_gui->getHtml());
 
 1562        $this->tabs_gui->setTabActive(
'settings');
 
 1566        return $this->tpl->setContent($this->form_gui->getHtml());
 
 1579        if (!isset(
$_GET[
"ldap_server_id"])) {
 
 1585        include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 1589        $c_gui->setFormAction($this->ctrl->getFormAction($this, 
"deleteServerSettings"));
 
 1590        $c_gui->setHeaderText($this->lng->txt(
"ldap_confirm_del_server_settings"));
 
 1591        $c_gui->setCancel($this->lng->txt(
"cancel"), 
"serverList");
 
 1592        $c_gui->setConfirm($this->lng->txt(
"confirm"), 
"deleteServerSettings");
 
 1595        include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
 
 1596        foreach ((array) 
$_GET[
"ldap_server_id"] as $server_id) {
 
 1598            $c_gui->addItem(
'server_ids[]', $server_id, $setting->getName());
 
 1600        $this->tpl->setContent($c_gui->getHTML());
 
 1608        if (!is_array(
$_POST[
"server_ids"])) {
 
 1614        foreach ((array) 
$_POST[
"server_ids"] as $server_id) {
 
 1618        ilUtil::sendSuccess($this->lng->txt(
'deleted'));
 
 1631        $this->tabs_gui->setTabActive(
'user_mapping');
 
 1636        $this->tpl->setContent($propertie_form->getHTML());
 
 1643        $this->server->toggleActive(1);
 
 1644        $this->server->update();
 
 1650        $this->server->toggleActive(0);
 
 1651        $this->server->update();
 
 1665        include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1667        $this->tabs_gui->setTabActive(
'role_mapping');
 
 1669        if (isset(
$_GET[
"mapping_id"])) {
 
 1670            $this->ctrl->setParameter($this, 
'mapping_id', 
$_GET[
"mapping_id"]);
 
 1674        $propertie_form->setTitle($this->lng->txt(
'ldap_mapping_table'));
 
 1675        $propertie_form->setFormAction($this->ctrl->getFormAction($this, $command));
 
 1676        $propertie_form->addCommandButton($command, $this->lng->txt(
'save'));
 
 1677        $propertie_form->addCommandButton(
"roleMapping", $this->lng->txt(
'cancel'));
 
 1680        $url->setPostVar(
"url");
 
 1682        $url->setMaxLength(255);
 
 1683        $url->setRequired(
true);
 
 1685        $group_dn = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_dn'));
 
 1686        $group_dn->setPostVar(
"dn");
 
 1687        $group_dn->setSize(50);
 
 1688        $group_dn->setMaxLength(255);
 
 1689        $group_dn->setInfo($this->lng->txt(
'ldap_dn_info'));
 
 1690        $group_dn->setRequired(
true);
 
 1692        $member = 
new ilTextInputGUI($this->lng->txt(
'ldap_group_member'));
 
 1693        $member->setPostVar(
"member");
 
 1694        $member->setSize(32);
 
 1695        $member->setMaxLength(255);
 
 1696        $member->setInfo($this->lng->txt(
'ldap_member_info'));
 
 1697        $member->setRequired(
true);
 
 1700        $member_isdn->setPostVar(
"memberisdn");
 
 1701        $member_isdn->setOptionTitle($this->lng->txt(
'ldap_memberisdn'));
 
 1704        $role->setPostVar(
"role");
 
 1706        $role->setMaxLength(255);
 
 1707        $role->setInfo($this->lng->txt(
'ldap_role_info'));
 
 1708        $role->setRequired(
true);
 
 1711        $info->setPostVar(
"info");
 
 1714        $info->setInfo($this->lng->txt(
'ldap_info_text_info'));
 
 1717        $info_type->setPostVar(
"info_type");
 
 1718        $info_type->setOptionTitle($this->lng->txt(
'ldap_mapping_info_type'));
 
 1720        $propertie_form->addItem(
$url);
 
 1721        $propertie_form->addItem($group_dn);
 
 1722        $propertie_form->addItem($member);
 
 1723        $propertie_form->addItem($member_isdn);
 
 1724        $propertie_form->addItem($role);
 
 1725        $propertie_form->addItem(
$info);
 
 1726        $propertie_form->addItem($info_type);
 
 1728        return $propertie_form;
 
 1739        $propertie_form->getItemByPostVar(
"url")->setValue($this->server->getUrl());
 
 1741        if (isset(
$_GET[
"mapping_id"])) {
 
 1742            include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1746            $propertie_form->getItemByPostVar(
"url")->setValue($mapping->getURL());
 
 1747            $propertie_form->getItemByPostVar(
"dn")->setValue($mapping->getDN());
 
 1748            $propertie_form->getItemByPostVar(
"member")->setValue($mapping->getMemberAttribute());
 
 1749            $propertie_form->getItemByPostVar(
"memberisdn")->setChecked($mapping->getMemberISDN());
 
 1750            $propertie_form->getItemByPostVar(
"role")->setValue($mapping->getRoleName());
 
 1751            $propertie_form->getItemByPostVar(
"info")->setValue($mapping->getMappingInfo());
 
 1752            $propertie_form->getItemByPostVar(
"info_type")->setChecked($mapping->getMappingInfoType());
 
 1755        $this->tpl->setContent($propertie_form->getHTML());
 
 1767        $rbacreview = 
$DIC[
'rbacreview'];
 
 1770        if ($propertie_form->checkInput() && $rbacreview->roleExists($propertie_form->getInput(
"role"))) {
 
 1771            include_once(
'Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
 
 1773            $mapping->setServerId($this->server->getServerId());
 
 1774            $mapping->setURL($propertie_form->getInput(
"url"));
 
 1775            $mapping->setDN($propertie_form->getInput(
"dn"));
 
 1776            $mapping->setMemberAttribute($propertie_form->getInput(
"member"));
 
 1777            $mapping->setMemberISDN($propertie_form->getInput(
"memberisdn"));
 
 1778            $mapping->setRoleByName($propertie_form->getInput(
"role"));
 
 1779            $mapping->setMappingInfo($propertie_form->getInput(
"info"));
 
 1780            $mapping->setMappingInfoType($propertie_form->getInput(
"info_type"));
 
 1783            ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1784            $this->ctrl->redirect($this, 
"roleMapping");
 
 1786            if (!$rbacreview->roleExists($propertie_form->getInput(
"role"))) {
 
 1788                        $propertie_form->getInput(
"role"));
 
 1790            $propertie_form->setValuesByPost();
 
 1791            $this->tpl->setContent($propertie_form->getHTML());
 
 1802        $this->server->enableRoleSynchronization((
int) 
$_POST[
'role_sync_active']);
 
 1805        if ($this->server->getServerId()) {
 
 1806            $this->server->update();
 
 1808        ilUtil::sendSuccess($this->lng->txt(
'settings_saved'), 
true);
 
 1809        $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.
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.
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.
if(!array_key_exists('StateId', $_REQUEST)) $id
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
if(empty($password)) $table
foreach($_POST as $key=> $value) $res