ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLDAPSettingsGUI Class Reference
+ Collaboration diagram for ilLDAPSettingsGUI:

Public Member Functions

 __construct (int $a_auth_ref_id)
 
 executeCommand ()
 
 getServer ()
 Get server settings. More...
 
 roleAssignments ()
 Edit role assignments. More...
 
 editRoleAssignment ()
 Edit role assignment. More...
 
 updateRoleAssignment ()
 update role assignment More...
 
 confirmDeleteRules ()
 Confirm delete rules. More...
 
 deleteRules ()
 delete role assignment rule More...
 
 addRoleAssignment ()
 add new role assignment More...
 
 deleteRoleMapping ()
 
 chooseMapping ()
 
 saveMapping ()
 
 serverList ()
 
 setServerFormValues ()
 
 save ()
 
 addRoleAutoCompleteObject ()
 Add Member for autoComplete. More...
 
 roleMapping ()
 Role Mapping Tab. More...
 
 editRoleMapping ()
 Edit Assigments for role mapping. More...
 
 createRoleMapping ()
 Check add screen input and save to db. More...
 
 confirmDeleteRoleMapping ()
 confirm delete role mappings More...
 
 addServerSettings ()
 
 editServerSettings ()
 
 confirmDeleteServerSettings ()
 Confirm delete rules. More...
 
 deleteServerSettings ()
 
 userMapping ()
 Ldap User Mapping. More...
 
 activateServer ()
 
 deactivateServer ()
 
 addRoleMapping ()
 Add Assigments for role mapping. More...
 
 updateRoleMapping ()
 Check edit screen input and save to db. More...
 
 saveSyncronizationSettings ()
 save Syncronization Settings on Role Mapping screen More...
 

Protected Member Functions

 showRoleSelection ()
 show role selection More...
 
 saveRoleSelection ()
 Save role selection. More...
 
 getRoleAssignmentTable ()
 Show active role assignments. More...
 
 initFormRoleAssignments (string $a_mode)
 Init form table for new role assignments. More...
 

Private Member Functions

 checkAccess (string $a_permission)
 
 getAttributeMappingKeys ()
 Get all possible attribute keys for mapping ldap attribute to ilias user attributes. More...
 
 setValuesByArray ()
 set values of form array More...
 
 roleSelectionRequired ()
 
 checkRoleAssignmentInput (int $a_rule_id=0)
 Check role assignment input. More...
 
 loadRoleAssignmentRule (int $a_rule_id, bool $load_from_form=true)
 Load input from form. More...
 
 initForm ()
 
 setSubTabs ()
 Set sub tabs for ldap section. More...
 
 initServer ()
 
 initAttributeMapping ()
 
 initRoleMapping ()
 
 prepareGlobalRoleSelection ()
 New implementation for InputForm. More...
 
 getMappingFields ()
 
 initUserDefinedFields ()
 
 prepareMappingSelect ()
 
 userMappingToolbar ()
 Create Toolbar. More...
 
 initUserMappingForm ()
 Create Property Form GUI for User Mapping. More...
 
 initRoleMappingForm (string $command)
 init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile More...
 

Private Attributes

int $ref_id
 
ilLDAPServer $server
 
ilLDAPAttributeMapping $mapping
 
ilPropertyFormGUI $form_gui = null
 
ilPropertyFormGUI $form = null
 
ilCtrl $ctrl
 
ilTabsGUI $tabs_gui
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilErrorHandling $ilErr
 
ilAccessHandler $ilAccess
 
ilRbacReview $rbacReview
 
ilRbacSystem $rbacSystem
 
ilToolbarGUI $toolbar
 
ilGlobalTemplateInterface $main_tpl
 
ilComponentRepository $component_repository
 
ilUserDefinedFields $udf
 
ilLDAPRoleAssignmentRule $role_mapping_rule = null
 
ilLDAPRoleAssignmentRule $rule = null
 
ilLDAPRoleGroupMappingSettings $role_mapping = null
 
array $rule_ids = null
 
int $rule_id = null
 
int $role_id = null
 
array $mappings = null
 
string $mapping_template = null
 
int $ldap_server_id = null
 
array $server_ids = null
 
int $mapping_id = null
 
string $role_bind_user = null
 
string $role_bind_pass = null
 
bool $role_sync_active = false
 
array $attribute_mappings = []
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 24 of file class.ilLDAPSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLDAPSettingsGUI::__construct ( int  $a_auth_ref_id)
Exceptions
ilCtrlException

Definition at line 68 of file class.ilLDAPSettingsGUI.php.

References $DIC, ILIAS\LTI\ToolProvider\$key, ILIAS\Repository\$refinery, ILIAS\Repository\ctrl(), getAttributeMappingKeys(), initServer(), ILIAS\Repository\lng(), ilUtil\stripSlashes(), and ILIAS\Repository\toolbar().

69  {
70  global $DIC;
71 
72  $this->ctrl = $DIC->ctrl();
73  $this->tabs_gui = $DIC->tabs();
74  $this->lng = $DIC->language();
75  $this->lng->loadLanguageModule('ldap');
76  $this->ilErr = $DIC['ilErr'];
77  $this->ilAccess = $DIC->access();
78  $this->component_repository = $DIC["component.repository"];
79  $this->rbacReview = $DIC->rbac()->review();
80  $this->rbacSystem = $DIC->rbac()->system();
81  $this->toolbar = $DIC->toolbar();
82  $this->main_tpl = $DIC->ui()->mainTemplate();
83 
84  $this->tpl = $DIC->ui()->mainTemplate();
85 
86  if ($this->ctrl->getCmd() !== "addServerSettings") {
87  $this->ctrl->saveParameter($this, 'ldap_server_id');
88  }
89 
90  $http_wrapper = $DIC->http()->wrapper();
91  $is_post_request = $DIC->http()->request()->getMethod() === "POST";
92  $refinery = $DIC->refinery();
93  if ($http_wrapper->query()->has("rule_id")) {
94  $this->rule_id = $http_wrapper->query()->retrieve(
95  "rule_id",
96  $refinery->kindlyTo()->int()
97  );
98  }
99  if ($http_wrapper->query()->has("ldap_server_id")) {
100  $this->ldap_server_id = $http_wrapper->query()->retrieve(
101  "ldap_server_id",
102  $refinery->kindlyTo()->int()
103  );
104  }
105  if ($http_wrapper->query()->has("mapping_id")) {
106  $this->mapping_id = $http_wrapper->query()->retrieve(
107  "mapping_id",
108  $refinery->kindlyTo()->int()
109  );
110  }
111  if ($is_post_request) {
112  if ($http_wrapper->post()->has('rule_ids')) {
113  $this->rule_ids = $http_wrapper->post()->retrieve(
114  'rule_ids',
115  $refinery->kindlyTo()->listOf($refinery->kindlyTo()->int())
116  );
117  }
118  if ($http_wrapper->post()->has('role_id')) {
119  $this->role_id = $http_wrapper->post()->retrieve(
120  'role_id',
121  $refinery->kindlyTo()->int()
122  );
123  }
124  if ($http_wrapper->post()->has('mappings')) {
125  $this->mappings = $http_wrapper->post()->retrieve(
126  'mappings',
127  $refinery->kindlyTo()->listOf($refinery->kindlyTo()->int())
128  );
129  }
130  if ($http_wrapper->post()->has('server_ids')) {
131  $this->server_ids = $http_wrapper->post()->retrieve(
132  'server_ids',
133  $refinery->kindlyTo()->listOf($refinery->kindlyTo()->int())
134  );
135  }
136  if ($http_wrapper->post()->has('mapping_template')) {
137  $this->mapping_template = $http_wrapper->post()->retrieve(
138  'mapping_template',
139  $refinery->kindlyTo()->string()
140  );
141  }
142  if ($http_wrapper->post()->has('role_bind_user')) {
143  $this->role_bind_user = ilUtil::stripSlashes($http_wrapper->post()->retrieve(
144  'role_bind_user',
145  $refinery->kindlyTo()->string()
146  ));
147  }
148  if ($http_wrapper->post()->has('role_bind_pass')) {
149  $this->role_bind_pass = ilUtil::stripSlashes($http_wrapper->post()->retrieve(
150  'role_bind_pass',
151  $refinery->kindlyTo()->string()
152  ));
153  }
154  if ($http_wrapper->post()->has('role_sync_active')) {
155  $this->role_sync_active = $http_wrapper->post()->retrieve(
156  'role_sync_active',
157  $refinery->kindlyTo()->bool()
158  );
159  }
160  foreach ($this->getAttributeMappingKeys() as $key) {
161  if ($http_wrapper->post()->has($key . '_value')) {
162  $this->attribute_mappings[$key] = [ilUtil::stripSlashes($http_wrapper->post()->retrieve(
163  $key . '_value',
164  $refinery->kindlyTo()->string()
165  )), $http_wrapper->post()->has($key . '_update')];
166  } else {
167  $this->attribute_mappings[$key] = ["", false];
168  }
169  }
170  }
171 
172  $this->ref_id = $a_auth_ref_id;
173 
174 
175  $this->initServer();
176  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
global $DIC
Definition: feed.php:28
string $key
Consumer key/client ID value.
Definition: System.php:193
getAttributeMappingKeys()
Get all possible attribute keys for mapping ldap attribute to ilias user attributes.
Refinery Factory $refinery
+ Here is the call graph for this function:

Member Function Documentation

◆ activateServer()

ilLDAPSettingsGUI::activateServer ( )

Definition at line 1580 of file class.ilLDAPSettingsGUI.php.

References checkAccess(), and serverList().

1580  : void
1581  {
1582  $this->checkAccess("write");
1583 
1584  $this->server->toggleActive(true);
1585  $this->server->update();
1586  $this->serverList();
1587  }
checkAccess(string $a_permission)
+ Here is the call graph for this function:

◆ addRoleAssignment()

ilLDAPSettingsGUI::addRoleAssignment ( )

add new role assignment

Definition at line 400 of file class.ilLDAPSettingsGUI.php.

References checkRoleAssignmentInput(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), getRoleAssignmentTable(), initFormRoleAssignments(), ILIAS\Repository\lng(), roleAssignments(), roleSelectionRequired(), and setSubTabs().

400  : bool
401  {
402  if (!$this->ilAccess->checkAccess('write', '', $this->ref_id)) {
403  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
404  $this->roleAssignments();
405  return false;
406  }
407  $this->setSubTabs();
408  $this->initFormRoleAssignments('create');
409  $formWithoutErrors = $this->form->checkInput();
410  $roleErrorMessage = $this->checkRoleAssignmentInput();
411  if (!$formWithoutErrors || $roleErrorMessage !== '') {
412  if ($roleErrorMessage !== '') {
413  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt($roleErrorMessage));
414  }
415 
416  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ldap_role_assignments.html', 'Services/LDAP');
417 
418  // DONE: wrap this
419  $this->form->setValuesByPost();
420  $this->tpl->setVariable('NEW_ASSIGNMENT_TBL', $this->form->getHTML());
421  $this->tpl->setVariable('RULES_TBL', $this->getRoleAssignmentTable());
422  $this->tabs_gui->activateSubTab('role_assignments');
423  return true;
424  }
425 
426  if ($this->roleSelectionRequired()) {
427  $this->ctrl->redirect($this, 'showRoleSelection');
428  } else {
429  $this->rule->create();
430  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
431  $this->ctrl->redirect($this, 'roleAssignments');
432  }
433  return true;
434  }
checkRoleAssignmentInput(int $a_rule_id=0)
Check role assignment input.
initFormRoleAssignments(string $a_mode)
Init form table for new role assignments.
setSubTabs()
Set sub tabs for ldap section.
roleAssignments()
Edit role assignments.
form( $class_path, string $cmd)
getRoleAssignmentTable()
Show active role assignments.
+ Here is the call graph for this function:

◆ addRoleAutoCompleteObject()

ilLDAPSettingsGUI::addRoleAutoCompleteObject ( )

Add Member for autoComplete.

Definition at line 1268 of file class.ilLDAPSettingsGUI.php.

References ilRoleAutoCompleteInputGUI\echoAutoCompleteList().

1268  : void
1269  {
1271  }
static echoAutoCompleteList()
Static asynchronous default auto complete function.
+ Here is the call graph for this function:

◆ addRoleMapping()

ilLDAPSettingsGUI::addRoleMapping ( )

Add Assigments for role mapping.

Definition at line 1677 of file class.ilLDAPSettingsGUI.php.

References initRoleMappingForm(), and ilLDAPAttributeMapping\read().

1677  : void
1678  {
1679  $propertie_form = $this->initRoleMappingForm("createRoleMapping");
1680  if ($propertie_form->getItemByPostVar("url")) {
1681  $propertie_form->getItemByPostVar("url")->setValue($this->server->getUrl());
1682  }
1683  if ($this->mapping_id) {
1684  $mapping = new ilLDAPRoleGroupMappingSetting($this->mapping_id);
1685  $mapping->read();
1686  if ($propertie_form->getItemByPostVar("url")) {
1687  $propertie_form->getItemByPostVar("url")->setValue($mapping->getURL());
1688  }
1689  if ($propertie_form->getItemByPostVar("dn")) {
1690  $propertie_form->getItemByPostVar("dn")->setValue($mapping->getDN());
1691  }
1692  if ($propertie_form->getItemByPostVar("member")) {
1693  $propertie_form->getItemByPostVar("member")->setValue($mapping->getMemberAttribute());
1694  }
1695  if ($propertie_form->getItemByPostVar("memberisdn")) {
1696  $propertie_form->getItemByPostVar("memberisdn")->setChecked($mapping->getMemberISDN());
1697  }
1698  if ($propertie_form->getItemByPostVar("role")) {
1699  $propertie_form->getItemByPostVar("role")->setValue($mapping->getRoleName());
1700  }
1701  if ($propertie_form->getItemByPostVar("info")) {
1702  $propertie_form->getItemByPostVar("info")->setValue($mapping->getMappingInfo());
1703  }
1704  if ($propertie_form->getItemByPostVar("info_type")) {
1705  $propertie_form->getItemByPostVar("info_type")->setChecked($mapping->getMappingInfoType());
1706  }
1707  }
1708 
1709  $this->tpl->setContent($propertie_form->getHTML());
1710  }
ilLDAPAttributeMapping $mapping
read()
Read mapping settings from db.
initRoleMappingForm(string $command)
init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
+ Here is the call graph for this function:

◆ addServerSettings()

ilLDAPSettingsGUI::addServerSettings ( )

Definition at line 1492 of file class.ilLDAPSettingsGUI.php.

References checkAccess(), ILIAS\Repository\ctrl(), and initForm().

1492  : void
1493  {
1494  $this->checkAccess("write");
1495 
1496  $this->ctrl->clearParameters($this);
1497 
1498  $this->initForm();
1499  $this->tpl->setContent($this->form_gui->getHTML());
1500  }
checkAccess(string $a_permission)
+ Here is the call graph for this function:

◆ checkAccess()

ilLDAPSettingsGUI::checkAccess ( string  $a_permission)
private

Definition at line 201 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\lng().

Referenced by activateServer(), addServerSettings(), confirmDeleteRules(), confirmDeleteServerSettings(), deactivateServer(), and editServerSettings().

201  : void
202  {
203  if (!$this->ilAccess->checkAccess($a_permission, '', $this->ref_id)) {
204  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->WARNING);
205  }
206  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkRoleAssignmentInput()

ilLDAPSettingsGUI::checkRoleAssignmentInput ( int  $a_rule_id = 0)
private

Check role assignment input.

Definition at line 526 of file class.ilLDAPSettingsGUI.php.

References loadRoleAssignmentRule().

Referenced by addRoleAssignment(), and updateRoleAssignment().

526  : string
527  {
528  $this->loadRoleAssignmentRule($a_rule_id);
529  $this->rule->validate();
530  return $this->ilErr->getMessage();
531  }
loadRoleAssignmentRule(int $a_rule_id, bool $load_from_form=true)
Load input from form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ chooseMapping()

ilLDAPSettingsGUI::chooseMapping ( )

Definition at line 633 of file class.ilLDAPSettingsGUI.php.

References ILIAS\LTI\ToolProvider\$key, ilLDAPAttributeMappingUtils\_getMappingRulesByClass(), initAttributeMapping(), and userMapping().

633  : void
634  {
635  if (!$this->mapping_template) {
636  $this->userMapping();
637  return;
638  }
639 
640  $this->initAttributeMapping();
641  $this->mapping->clearRules();
642 
643  foreach (ilLDAPAttributeMappingUtils::_getMappingRulesByClass($this->mapping_template) as $key => $value) {
644  $this->mapping->setRule($key, $value, false);
645  }
646  $this->userMapping();
647  }
static _getMappingRulesByClass(string $a_class)
Get mapping rule by objectClass.
string $key
Consumer key/client ID value.
Definition: System.php:193
userMapping()
Ldap User Mapping.
+ Here is the call graph for this function:

◆ confirmDeleteRoleMapping()

ilLDAPSettingsGUI::confirmDeleteRoleMapping ( )

confirm delete role mappings

Definition at line 1463 of file class.ilLDAPSettingsGUI.php.

References $id, $txt, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilLDAPAttributeMapping\read().

1463  : void
1464  {
1465  if (!$this->mappings) {
1466  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1467  $this->ctrl->redirect($this, "roleMapping");
1468  return;
1469  }
1470 
1471  $c_gui = new ilConfirmationGUI();
1472 
1473  // set confirm/cancel commands
1474  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteRoleMapping"));
1475  $c_gui->setHeaderText($this->lng->txt("ldap_confirm_del_role_ass"));
1476  $c_gui->setCancel($this->lng->txt("cancel"), "roleMapping");
1477  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteRoleMapping");
1478 
1479  foreach ($this->mappings as $id) {
1481  $mapping->read();
1482  $txt = $this->lng->txt('obj_role') . ": " . $mapping->getRoleName() . ", ";
1483  $txt .= $this->lng->txt('ldap_group_dn') . ": " . $mapping->getDN() . ", ";
1484  $txt .= $this->lng->txt('ldap_server_short') . " " . $mapping->getURL() . ", ";
1485  $txt .= $this->lng->txt('ldap_group_member_short') . " " . $mapping->getMemberAttribute();
1486 
1487  $c_gui->addItem("mappings[]", (string) $id, $txt);
1488  }
1489  $this->tpl->setContent($c_gui->getHTML());
1490  }
ilLDAPAttributeMapping $mapping
$txt
Definition: error.php:13
read()
Read mapping settings from db.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ confirmDeleteRules()

ilLDAPSettingsGUI::confirmDeleteRules ( )

Confirm delete rules.

Exceptions
ilCtrlException

Definition at line 351 of file class.ilLDAPSettingsGUI.php.

References ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), checkAccess(), ilLDAPRoleAssignmentRule\conditionToString(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), roleAssignments(), and setSubTabs().

351  : void
352  {
353  $this->checkAccess("write");
354 
355  if (!$this->rule_ids) {
356  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
357  $this->roleAssignments();
358  return;
359  }
360  $this->setSubTabs();
361  $this->tabs_gui->activateTab('role_assignments');
362 
363  $c_gui = new ilConfirmationGUI();
364 
365  // set confirm/cancel commands
366  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteRules"));
367  $c_gui->setHeaderText($this->lng->txt("ldap_confirm_del_role_ass"));
368  $c_gui->setCancel($this->lng->txt("cancel"), "roleAssignments");
369  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteRules");
370 
371  // add items to delete
372  foreach ($this->rule_ids as $rule_id) {
374  $c_gui->addItem('rule_ids[]', (string) $rule_id, $rule->conditionToString());
375  }
376  $this->tpl->setContent($c_gui->getHTML());
377  }
setSubTabs()
Set sub tabs for ldap section.
checkAccess(string $a_permission)
roleAssignments()
Edit role assignments.
static _getInstanceByRuleId(int $a_rule_id)
ilLDAPRoleAssignmentRule $rule
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ confirmDeleteServerSettings()

ilLDAPSettingsGUI::confirmDeleteServerSettings ( )

Confirm delete rules.

Definition at line 1518 of file class.ilLDAPSettingsGUI.php.

References checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and serverList().

1518  : void
1519  {
1520  $this->checkAccess("write");
1521 
1522  if (!$this->ldap_server_id) {
1523  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1524  $this->serverList();
1525  return;
1526  }
1527 
1528  $c_gui = new ilConfirmationGUI();
1529 
1530  // set confirm/cancel commands
1531  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteServerSettings"));
1532  $c_gui->setHeaderText($this->lng->txt("ldap_confirm_del_server_settings"));
1533  $c_gui->setCancel($this->lng->txt("cancel"), "serverList");
1534  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteServerSettings");
1535 
1536  // add items to delete
1537  $setting = new ilLDAPServer($this->ldap_server_id);
1538  $c_gui->addItem('server_ids[]', (string) $setting->getServerId(), $setting->getName());
1539 
1540  $this->tpl->setContent($c_gui->getHTML());
1541  }
checkAccess(string $a_permission)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ createRoleMapping()

ilLDAPSettingsGUI::createRoleMapping ( )

Check add screen input and save to db.

Definition at line 1432 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\ctrl(), initRoleMappingForm(), ILIAS\Repository\lng(), and ilLDAPAttributeMapping\save().

1432  : void
1433  {
1434  $propertie_form = $this->initRoleMappingForm("createRoleMapping");
1435 
1436  if ($propertie_form->checkInput() && $this->rbacReview->roleExists($propertie_form->getInput("role"))) {
1438  $mapping->setServerId($this->server->getServerId());
1439  $mapping->setURL($propertie_form->getInput("url"));
1440  $mapping->setDN($propertie_form->getInput("dn"));
1441  $mapping->setMemberAttribute($propertie_form->getInput("member"));
1442  $mapping->setMemberISDN((bool) $propertie_form->getInput("memberisdn"));
1443  $mapping->setRoleByName($propertie_form->getInput("role"));
1444  $mapping->setMappingInfo($propertie_form->getInput("info"));
1445  $mapping->setMappingInfoType((bool) $propertie_form->getInput("info_type"));
1446  $mapping->save();
1447 
1448  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1449  $this->ctrl->redirect($this, "roleMapping");
1450  } else {
1451  if (!$this->rbacReview->roleExists($propertie_form->getInput("role"))) {
1452  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("ldap_role_not_exists") . " " .
1453  $propertie_form->getInput("role"));
1454  }
1455  $propertie_form->setValuesByPost();
1456  $this->tpl->setContent($propertie_form->getHTML());
1457  }
1458  }
ilLDAPAttributeMapping $mapping
save()
Save mapping rules to db.
initRoleMappingForm(string $command)
init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
+ Here is the call graph for this function:

◆ deactivateServer()

ilLDAPSettingsGUI::deactivateServer ( )

Definition at line 1589 of file class.ilLDAPSettingsGUI.php.

References checkAccess(), and serverList().

1589  : void
1590  {
1591  $this->checkAccess("write");
1592 
1593  $this->server->toggleActive(false);
1594  $this->server->update();
1595  $this->serverList();
1596  }
checkAccess(string $a_permission)
+ Here is the call graph for this function:

◆ deleteRoleMapping()

ilLDAPSettingsGUI::deleteRoleMapping ( )

Definition at line 615 of file class.ilLDAPSettingsGUI.php.

References initRoleMapping(), ILIAS\Repository\lng(), and roleMapping().

615  : bool
616  {
617  if (!$this->mappings) {
618  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
619  $this->roleMapping();
620  return false;
621  }
622 
623  $this->initRoleMapping();
624 
625  foreach ($this->mappings as $mapping_id) {
626  $this->role_mapping->delete($mapping_id);
627  }
628  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('ldap_deleted_role_mapping'));
629  $this->roleMapping();
630  return true;
631  }
roleMapping()
Role Mapping Tab.
+ Here is the call graph for this function:

◆ deleteRules()

ilLDAPSettingsGUI::deleteRules ( )

delete role assignment rule

Definition at line 382 of file class.ilLDAPSettingsGUI.php.

References ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ILIAS\Repository\ctrl(), ilLDAPRoleAssignmentRule\delete(), ILIAS\Repository\lng(), and roleAssignments().

382  : void
383  {
384  if (!$this->rule_ids) {
385  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_once'));
386  $this->roleAssignments();
387  return;
388  }
389  foreach ($this->rule_ids as $rule_id) {
391  $rule->delete();
392  }
393  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('ldap_deleted_rule'));
394  $this->ctrl->redirect($this, 'roleAssignments');
395  }
roleAssignments()
Edit role assignments.
static _getInstanceByRuleId(int $a_rule_id)
ilLDAPRoleAssignmentRule $rule
+ Here is the call graph for this function:

◆ deleteServerSettings()

ilLDAPSettingsGUI::deleteServerSettings ( )

Definition at line 1546 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and serverList().

1546  : void
1547  {
1548  if (!$this->server_ids) {
1549  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
1550  $this->serverList();
1551  return;
1552  }
1553 
1554  foreach ($this->server_ids as $server_id) {
1555  $setting = new ilLDAPServer($server_id);
1556  $setting->delete();
1557  }
1558  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('deleted'));
1559  $this->ctrl->redirect($this, "serverlist");
1560  }
+ Here is the call graph for this function:

◆ editRoleAssignment()

ilLDAPSettingsGUI::editRoleAssignment ( )

Edit role assignment.

Exceptions
ilCtrlException

Definition at line 262 of file class.ilLDAPSettingsGUI.php.

References ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), initFormRoleAssignments(), ILIAS\Repository\lng(), roleAssignments(), setSubTabs(), and setValuesByArray().

262  : void
263  {
264  if (!$this->rule_id) {
265  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
266  $this->roleAssignments();
267  return;
268  }
269  $this->setSubTabs();
270  $this->tabs_gui->activateTab('role_assignments');
271 
272  $this->ctrl->saveParameter($this, 'rule_id');
274  'edit'
275  );
276  $this->role_mapping_rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId($this->rule_id);
277  $this->setValuesByArray();
278  $this->tpl->setContent($this->form->getHTML());
279  }
initFormRoleAssignments(string $a_mode)
Init form table for new role assignments.
setSubTabs()
Set sub tabs for ldap section.
setValuesByArray()
set values of form array
roleAssignments()
Edit role assignments.
form( $class_path, string $cmd)
static _getInstanceByRuleId(int $a_rule_id)
+ Here is the call graph for this function:

◆ editRoleMapping()

ilLDAPSettingsGUI::editRoleMapping ( )

Edit Assigments for role mapping.

Definition at line 1395 of file class.ilLDAPSettingsGUI.php.

References initRoleMappingForm(), ILIAS\Repository\lng(), and ilLDAPAttributeMapping\read().

1395  : void
1396  {
1397  $mapping = new ilLDAPRoleGroupMappingSetting($this->mapping_id);
1398  $mapping->read();
1399 
1400  $propertie_form = $this->initRoleMappingForm("updateRoleMapping");
1401  $propertie_form->setTitle($this->lng->txt('ldap_edit_role_assignment'));
1402  if ($propertie_form->getItemByPostVar("url")) {
1403  $propertie_form->getItemByPostVar("url")->setValue($mapping->getURL());
1404  }
1405  if ($propertie_form->getItemByPostVar("dn")) {
1406  $propertie_form->getItemByPostVar("dn")->setValue($mapping->getDN());
1407  }
1408  if ($propertie_form->getItemByPostVar("member")) {
1409  $propertie_form->getItemByPostVar("member")->setValue($mapping->getMemberAttribute());
1410  }
1411  if ($propertie_form->getItemByPostVar("memberisdn")) {
1412  $propertie_form->getItemByPostVar("memberisdn")->setChecked($mapping->getMemberISDN());
1413  }
1414  if ($propertie_form->getItemByPostVar("role")) {
1415  $propertie_form->getItemByPostVar("role")->setValue($mapping->getRoleName());
1416  }
1417  if ($propertie_form->getItemByPostVar("info")) {
1418  $propertie_form->getItemByPostVar("info")->setValue($mapping->getMappingInfo());
1419  }
1420  if ($propertie_form->getItemByPostVar("info_type")) {
1421  $propertie_form->getItemByPostVar("info_type")->setChecked($mapping->getMappingInfoType());
1422  }
1423 
1424  $this->tpl->setContent($propertie_form->getHTML());
1425  }
ilLDAPAttributeMapping $mapping
read()
Read mapping settings from db.
initRoleMappingForm(string $command)
init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
+ Here is the call graph for this function:

◆ editServerSettings()

ilLDAPSettingsGUI::editServerSettings ( )

Definition at line 1502 of file class.ilLDAPSettingsGUI.php.

References checkAccess(), initForm(), setServerFormValues(), and setSubTabs().

1502  : void
1503  {
1504  $this->checkAccess("write");
1505 
1506  $this->setSubTabs();
1507  $this->tabs_gui->setTabActive('settings');
1508 
1509  $this->initForm();
1510  $this->setServerFormValues();
1511  $this->tpl->setContent($this->form_gui->getHTML());
1512  }
setSubTabs()
Set sub tabs for ldap section.
checkAccess(string $a_permission)
+ Here is the call graph for this function:

◆ executeCommand()

ilLDAPSettingsGUI::executeCommand ( )
Exceptions
ilCtrlException

Definition at line 181 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

181  : bool
182  {
183  $next_class = $this->ctrl->getNextClass($this);
184  $cmd = $this->ctrl->getCmd();
185 
186  if ($cmd !== "serverList" && !$this->rbacSystem->checkAccess("visible,read", $this->ref_id)) {
187  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_write'), true);
188  $this->ctrl->redirect($this, "serverList");
189  }
190  switch ($next_class) {
191  default:
192  if (!$cmd) {
193  $cmd = "serverList";
194  }
195  $this->$cmd();
196  break;
197  }
198  return true;
199  }
+ Here is the call graph for this function:

◆ getAttributeMappingKeys()

ilLDAPSettingsGUI::getAttributeMappingKeys ( )
private

Get all possible attribute keys for mapping ldap attribute to ilias user attributes.

Returns
string[]

Definition at line 212 of file class.ilLDAPSettingsGUI.php.

References ILIAS\LTI\ToolProvider\$key, $keys, ilUserDefinedFields\_getInstance(), and getMappingFields().

Referenced by __construct().

212  : array
213  {
214  $keys = [];
215  foreach (array_keys($this->getMappingFields()) as $key) {
216  $keys[] = $key;
217  }
218  foreach (ilUserDefinedFields::_getInstance()->getDefinitions() as $definition) {
219  $keys[] = 'udf_' . $definition['field_id'];
220  }
221  return $keys;
222  }
$keys
Definition: metadata.php:204
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMappingFields()

ilLDAPSettingsGUI::getMappingFields ( )
private

Definition at line 1093 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\lng().

Referenced by getAttributeMappingKeys(), initUserMappingForm(), and saveMapping().

1093  : array
1094  {
1095  return array('gender' => $this->lng->txt('gender'),
1096  'firstname' => $this->lng->txt('firstname'),
1097  'lastname' => $this->lng->txt('lastname'),
1098  'title' => $this->lng->txt('person_title'),
1099  'institution' => $this->lng->txt('institution'),
1100  'department' => $this->lng->txt('department'),
1101  'street' => $this->lng->txt('street'),
1102  'city' => $this->lng->txt('city'),
1103  'zipcode' => $this->lng->txt('zipcode'),
1104  'country' => $this->lng->txt('country'),
1105  'phone_office' => $this->lng->txt('phone_office'),
1106  'phone_home' => $this->lng->txt('phone_home'),
1107  'phone_mobile' => $this->lng->txt('phone_mobile'),
1108  'fax' => $this->lng->txt('fax'),
1109  'email' => $this->lng->txt('email'),
1110  'second_email' => $this->lng->txt('second_email'),
1111  'hobby' => $this->lng->txt('hobby'),
1112  'matriculation' => $this->lng->txt('matriculation'));
1113  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRoleAssignmentTable()

ilLDAPSettingsGUI::getRoleAssignmentTable ( )
protected

Show active role assignments.

Definition at line 536 of file class.ilLDAPSettingsGUI.php.

References ilLDAPRoleAssignmentRule\_getRules(), and ILIAS\Repository\lng().

Referenced by addRoleAssignment().

536  : string
537  {
538  if (count($rules = ilLDAPRoleAssignmentRule::_getRules($this->server->getServerId()))) {
539  $table_gui = new ilLDAPRoleAssignmentTableGUI($this, 'roleAssignments');
540  $table_gui->setTitle($this->lng->txt("ldap_tbl_role_ass"));
541  $table_gui->parse($rules);
542  $table_gui->addMultiCommand("confirmDeleteRules", $this->lng->txt("delete"));
543  $table_gui->setSelectAllCheckbox("rule_id");
544  return $table_gui->getHTML();
545  }
546  return '';
547  }
static _getRules($a_server_id)
Get all rules.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getServer()

ilLDAPSettingsGUI::getServer ( )

Get server settings.

Definition at line 228 of file class.ilLDAPSettingsGUI.php.

References $server.

Referenced by initAttributeMapping(), initRoleMapping(), loadRoleAssignmentRule(), and roleSelectionRequired().

228  : ilLDAPServer
229  {
230  return $this->server;
231  }
+ Here is the caller graph for this function:

◆ initAttributeMapping()

ilLDAPSettingsGUI::initAttributeMapping ( )
private

Definition at line 1064 of file class.ilLDAPSettingsGUI.php.

References ilLDAPAttributeMapping\_getInstanceByServerId(), and getServer().

Referenced by chooseMapping(), save(), saveMapping(), and userMapping().

1064  : void
1065  {
1066  $this->mapping = ilLDAPAttributeMapping::_getInstanceByServerId($this->getServer()->getServerId());
1067  }
getServer()
Get server settings.
static _getInstanceByServerId(int $a_server_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilLDAPSettingsGUI::initForm ( )
private

Definition at line 736 of file class.ilLDAPSettingsGUI.php.

References $version, ilAdministrationSettingsFormHandler\addFieldsToForm(), ilSubEnabledFormPropertyGUI\addSubItem(), ILIAS\Repository\ctrl(), ilAdministrationSettingsFormHandler\FORM_LDAP, ilAdministrationSettingsFormHandler\getSettingsGUIInstance(), ilLDAPServer\LDAP_BIND_ANONYMOUS, ilLDAPServer\LDAP_BIND_USER, ilLDAPServer\LDAP_SCOPE_ONE, ilLDAPServer\LDAP_SCOPE_SUB, ILIAS\Repository\lng(), prepareGlobalRoleSelection(), ilFormPropertyGUI\setInfo(), ilCheckboxInputGUI\setOptionTitle(), ilPasswordInputGUI\setSkipSyntaxCheck(), and ilCheckboxInputGUI\setValue().

Referenced by addServerSettings(), editServerSettings(), and save().

736  : void
737  {
738  $this->form_gui = new ilPropertyFormGUI();
739  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
740  $this->form_gui->setTitle($this->lng->txt('ldap_configure'));
741 
742  $active = new ilCheckboxInputGUI($this->lng->txt('auth_ldap_enable'), 'active');
743  $active->setValue("1");
744  $this->form_gui->addItem($active);
745 
746  $ds = new ilCheckboxInputGUI($this->lng->txt('ldap_as_ds'), 'ds');
747  $ds->setValue("1");
748  $ds->setInfo($this->lng->txt('ldap_as_ds_info'));
749  $this->form_gui->addItem($ds);
750 
751  $servername = new ilTextInputGUI($this->lng->txt('ldap_server_name'), 'server_name');
752  $servername->setRequired(true);
753  $servername->setInfo($this->lng->txt('ldap_server_name_info'));
754  $servername->setSize(32);
755  $servername->setMaxLength(32);
756  $this->form_gui->addItem($servername);
757 
758  // start Patch Name Filter
759  $namefilter = new ilTextInputGUI($this->lng->txt('ldap_username_filter'), "name_filter");//ADD LANG VAR
760  $namefilter->setInfo($this->lng->txt("ldap_username_filter_info"));
761  $namefilter->setSize(64);
762  $namefilter->setMaxLength(255);
763  $this->form_gui->addItem($namefilter);
764  // end Patch Name Filter
765 
766  $serverurl = new ilTextInputGUI($this->lng->txt('ldap_server'), 'server_url');
767  $serverurl->setRequired(true);
768  $serverurl->setInfo($this->lng->txt('ldap_server_url_info'));
769  $serverurl->setSize(64);
770  $serverurl->setMaxLength(255);
771  $this->form_gui->addItem($serverurl);
772 
773  $version = new ilSelectInputGUI($this->lng->txt('ldap_version'), 'version');
774  $version->setOptions(array(2 => 2, 3 => 3));
775  $version->setInfo($this->lng->txt('ldap_server_version_info'));
776  $this->form_gui->addItem($version);
777 
778  $basedsn = new ilTextInputGUI($this->lng->txt('basedn'), 'base_dn');
779  $basedsn->setRequired(true);
780  $basedsn->setSize(64);
781  $basedsn->setMaxLength(255);
782  $this->form_gui->addItem($basedsn);
783 
784  $referrals = new ilCheckboxInputGUI($this->lng->txt('ldap_referrals'), 'referrals');
785  $referrals->setValue("1");
786  $referrals->setInfo($this->lng->txt('ldap_referrals_info'));
787  $this->form_gui->addItem($referrals);
788 
789  $section_security = new ilFormSectionHeaderGUI();
790  $section_security->setTitle($this->lng->txt('ldap_server_security_settings'));
791  $this->form_gui->addItem($section_security);
792 
793  $tls = new ilCheckboxInputGUI($this->lng->txt('ldap_tls'), 'tls');
794  $tls->setValue("1");
795  $this->form_gui->addItem($tls);
796 
797  $binding = new ilRadioGroupInputGUI($this->lng->txt('ldap_server_binding'), 'binding_type');
798  $anonymous = new ilRadioOption($this->lng->txt('ldap_bind_anonymous'), (string) ilLDAPServer::LDAP_BIND_ANONYMOUS);
799  $binding->addOption($anonymous);
800  $user = new ilRadioOption($this->lng->txt('ldap_bind_user'), (string) ilLDAPServer::LDAP_BIND_USER);
801  $dn = new ilTextInputGUI($this->lng->txt('ldap_server_bind_dn'), 'bind_dn');
802  $dn->setSize(64);
803  $dn->setMaxLength(255);
804  $user->addSubItem($dn);
805  $pass = new ilPasswordInputGUI($this->lng->txt('ldap_server_bind_pass'), 'bind_pass');
806  $pass->setSkipSyntaxCheck(true);
807  $pass->setSize(12);
808  $pass->setMaxLength(100);
809  $user->addSubItem($pass);
810  $binding->addOption($user);
811  $this->form_gui->addItem($binding);
812 
813  $section_auth = new ilFormSectionHeaderGUI();
814  $section_auth->setTitle($this->lng->txt('ldap_authentication_settings'));
815  $this->form_gui->addItem($section_auth);
816 
817  $search_base = new ilTextInputGUI($this->lng->txt('ldap_user_dn'), 'search_base');
818  $search_base->setInfo($this->lng->txt('ldap_search_base_info'));
819  $search_base->setSize(64);
820  $search_base->setMaxLength(255);
821  $this->form_gui->addItem($search_base);
822 
823  $user_scope = new ilSelectInputGUI($this->lng->txt('ldap_user_scope'), 'user_scope');
824  $user_scope->setOptions(array(ilLDAPServer::LDAP_SCOPE_ONE => $this->lng->txt('ldap_scope_one'),
825  ilLDAPServer::LDAP_SCOPE_SUB => $this->lng->txt('ldap_scope_sub')));
826  $user_scope->setInfo($this->lng->txt('ldap_user_scope_info'));
827  $this->form_gui->addItem($user_scope);
828 
829  $user_attribute = new ilTextInputGUI($this->lng->txt('ldap_user_attribute'), 'user_attribute');
830  $user_attribute->setSize(16);
831  $user_attribute->setMaxLength(64);
832  $user_attribute->setRequired(true);
833  $this->form_gui->addItem($user_attribute);
834 
835  $filter = new ilTextInputGUI($this->lng->txt('ldap_search_filter'), 'filter');
836  $filter->setInfo($this->lng->txt('ldap_filter_info'));
837  $filter->setSize(64);
838  $filter->setMaxLength(512);
839  $this->form_gui->addItem($filter);
840 
841  $section_restrictions = new ilFormSectionHeaderGUI();
842  $section_restrictions->setTitle($this->lng->txt('ldap_group_restrictions'));
843  $this->form_gui->addItem($section_restrictions);
844 
845  $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_search_base'), 'group_dn');
846  $group_dn->setInfo($this->lng->txt('ldap_group_dn_info'));
847  $group_dn->setSize(64);
848  $group_dn->setMaxLength(255);
849  $this->form_gui->addItem($group_dn);
850 
851  $group_scope = new ilSelectInputGUI($this->lng->txt('ldap_group_scope'), 'group_scope');
852  $group_scope->setOptions(array(ilLDAPServer::LDAP_SCOPE_ONE => $this->lng->txt('ldap_scope_one'),
853  ilLDAPServer::LDAP_SCOPE_SUB => $this->lng->txt('ldap_scope_sub')));
854  $group_scope->setInfo($this->lng->txt('ldap_group_scope_info'));
855  $this->form_gui->addItem($group_scope);
856 
857  $group_filter = new ilTextInputGUI($this->lng->txt('ldap_group_filter'), 'group_filter');
858  $group_filter->setInfo($this->lng->txt('ldap_group_filter_info'));
859  $group_filter->setSize(64);
860  $group_filter->setMaxLength(255);
861  $this->form_gui->addItem($group_filter);
862 
863  $group_member = new ilTextInputGUI($this->lng->txt('ldap_group_member'), 'group_member');
864  $group_member->setInfo($this->lng->txt('ldap_group_member_info'));
865  $group_member->setSize(32);
866  $group_member->setMaxLength(255);
867  $this->form_gui->addItem($group_member);
868 
869 
870  $group_member_isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_memberisdn'), 'memberisdn');
871  #$group_member_isdn->setInfo($this->lng->txt('ldap_group_member_info'));
872  $this->form_gui->addItem($group_member_isdn);
873  #$group_member->addSubItem($group_member_isdn);
874 
875  $escapedn = new ilCheckboxInputGUI($this->lng->txt('ldap_escapedn'), 'escape_dn');
876  $escapedn->setValue("1");
877  $escapedn->setInfo($this->lng->txt('ldap_escapedn_info'));
878  $this->form_gui->addItem($escapedn);
879 
880  $group = new ilTextInputGUI($this->lng->txt('ldap_group_name'), 'group');
881  $group->setInfo($this->lng->txt('ldap_group_name_info'));
882  $group->setSize(32);
883  $group->setMaxLength(255);
884  $this->form_gui->addItem($group);
885 
886  $group_atrr = new ilTextInputGUI($this->lng->txt('ldap_group_attribute'), 'group_attribute');
887  $group_atrr->setInfo($this->lng->txt('ldap_group_attribute_info'));
888  $group_atrr->setSize(16);
889  $group_atrr->setMaxLength(64);
890  $this->form_gui->addItem($group_atrr);
891 
892  $group_optional = new ilCheckboxInputGUI($this->lng->txt('ldap_group_membership'), 'group_optional');
893  $group_optional->setOptionTitle($this->lng->txt('ldap_group_member_optional'));
894  $group_optional->setInfo($this->lng->txt('ldap_group_optional_info'));
895  $group_optional->setValue("1");
896  $group_user_filter = new ilTextInputGUI($this->lng->txt('ldap_group_user_filter'), 'group_user_filter');
897  $group_user_filter->setSize(64);
898  $group_user_filter->setMaxLength(255);
899  $group_optional->addSubItem($group_user_filter);
900  $this->form_gui->addItem($group_optional);
901 
902  $section_sync = new ilFormSectionHeaderGUI();
903  $section_sync->setTitle($this->lng->txt('ldap_user_sync'));
904  $this->form_gui->addItem($section_sync);
905 
906  $ci_gui = new ilCustomInputGUI($this->lng->txt('ldap_moment_sync'));
907  $sync_on_login = new ilCheckboxInputGUI($this->lng->txt('ldap_sync_login'), 'sync_on_login');
908  $sync_on_login->setValue("1");
909  $ci_gui->addSubItem($sync_on_login);
910  $sync_per_cron = new ilCheckboxInputGUI($this->lng->txt('ldap_sync_cron'), 'sync_per_cron');
911  $sync_per_cron->setValue("1");
912  $ci_gui->addSubItem($sync_per_cron);
913  $ci_gui->setInfo($this->lng->txt('ldap_user_sync_info'));
914  $this->form_gui->addItem($ci_gui);
915 
916  $global_role = new ilSelectInputGUI($this->lng->txt('ldap_global_role_assignment'), 'global_role');
917  $global_role->setOptions($this->prepareGlobalRoleSelection());
918  $global_role->setInfo($this->lng->txt('ldap_global_role_info'));
919  $this->form_gui->addItem($global_role);
920 
921  $migr = new ilCheckboxInputGUI($this->lng->txt('auth_ldap_migration'), 'migration');
922  $migr->setInfo($this->lng->txt('auth_ldap_migration_info'));
923  $migr->setValue("1");
924  $this->form_gui->addItem($migr);
925 
928  $this->form_gui,
930  );
931 
932  $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
933  if ($this->ctrl->getCmd() === "addServerSettings") {
934  $this->form_gui->addCommandButton('serverList', $this->lng->txt('cancel'));
935  }
936  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prepareGlobalRoleSelection()
New implementation for InputForm.
This class represents a checkbox property in a property form.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
setOptionTitle(string $a_optiontitle)
$version
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormRoleAssignments()

ilLDAPSettingsGUI::initFormRoleAssignments ( string  $a_mode)
protected

Init form table for new role assignments.

Parameters
stringmode edit | create

Definition at line 1141 of file class.ilLDAPSettingsGUI.php.

References $id, $name, $update, ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ILIAS\Repository\lng(), prepareGlobalRoleSelection(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilLDAPRoleAssignmentRule\TYPE_ATTRIBUTE, and ilLDAPRoleAssignmentRule\TYPE_GROUP.

Referenced by addRoleAssignment(), editRoleAssignment(), roleAssignments(), and updateRoleAssignment().

1141  : void
1142  {
1143  $this->form = new ilPropertyFormGUI();
1144  $this->form->setFormAction($this->ctrl->getFormAction($this));
1145 
1146  switch ($a_mode) {
1147  case 'edit':
1148  $this->form->setTitle($this->lng->txt('ldap_edit_role_ass_rule'));
1149  $this->form->addCommandButton('updateRoleAssignment', $this->lng->txt('save'));
1150  //$this->form->addCommandButton('roleAssignments',$this->lng->txt('cancel'));
1151  break;
1152  case 'create':
1153  $this->form->setTitle($this->lng->txt('ldap_add_role_ass_rule'));
1154  $this->form->addCommandButton('addRoleAssignment', $this->lng->txt('ldap_btn_add_role_ass'));
1155  //$this->form->addCommandButton('roleAssignments',$this->lng->txt('cancel'));
1156  break;
1157  }
1158 
1159  // Role Selection
1160  $role = new ilRadioGroupInputGUI($this->lng->txt('ldap_ilias_role'), 'role_name');
1161  $role->setRequired(true);
1162 
1163  $global = new ilRadioOption($this->lng->txt('ldap_global_role'), "0");
1164 
1165  $role->addOption($global);
1166 
1167  $role_select = new ilSelectInputGUI('', 'role_id');
1168  $role_select->setOptions($this->prepareGlobalRoleSelection());
1169  $global->addSubItem($role_select);
1170 
1171  $local = new ilRadioOption($this->lng->txt('ldap_local_role'), "1");
1172 
1173  $role->addOption($local);
1174 
1175  $role_search = new ilRoleAutoCompleteInputGUI('', 'role_search', $this, 'addRoleAutoCompleteObject');
1176  $role_search->setSize(40);
1177  $local->addSubItem($role_search);
1178 
1179  $role->setInfo($this->lng->txt('ldap_role_name_info'));
1180  $this->form->addItem($role);
1181 
1182  // Update options
1183  $update = new ilNonEditableValueGUI($this->lng->txt('ldap_update_roles'), 'update_roles');
1184  $update->setValue($this->lng->txt('ldap_check_role_assignment'));
1185 
1186  $add = new ilCheckboxInputGUI('', 'add_missing');
1187  $add->setOptionTitle($this->lng->txt('ldap_add_missing'));
1188  $update->addSubItem($add);
1189 
1190  $remove = new ilCheckboxInputGUI('', 'remove_deprecated');
1191  $remove->setOptionTitle($this->lng->txt('ldap_remove_deprecated'));
1192  $update->addSubItem($remove);
1193 
1194  $this->form->addItem($update);
1195 
1196 
1197 
1198  // Assignment Type
1199  $group = new ilRadioGroupInputGUI($this->lng->txt('ldap_assignment_type'), 'type');
1200  #$group->setValue($current_rule->getType());
1201  $group->setRequired(true);
1202 
1203  // Option by group
1204  $radio_group = new ilRadioOption($this->lng->txt('ldap_role_by_group'), (string) ilLDAPRoleAssignmentRule::TYPE_GROUP);
1205 
1206  $dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'), 'dn');
1207  #$dn->setValue($current_rule->getDN());
1208  $dn->setSize(32);
1209  $dn->setMaxLength(512);
1210  $dn->setInfo($this->lng->txt('ldap_role_grp_dn_info'));
1211  $radio_group->addSubItem($dn);
1212  $at = new ilTextInputGUI($this->lng->txt('ldap_role_grp_at'), 'at');
1213  #$at->setValue($current_rule->getMemberAttribute());
1214  $at->setSize(16);
1215  $at->setMaxLength(128);
1216  $radio_group->addSubItem($at);
1217  $isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_role_grp_isdn'), 'isdn');
1218  #$isdn->setChecked($current_rule->isMemberAttributeDN());
1219  $isdn->setInfo($this->lng->txt('ldap_group_member_info'));
1220  $radio_group->addSubItem($isdn);
1221  $radio_group->setInfo($this->lng->txt('ldap_role_grp_info'));
1222 
1223  $group->addOption($radio_group);
1224 
1225  // Option by Attribute
1226  $radio_attribute = new ilRadioOption($this->lng->txt('ldap_role_by_attribute'), (string) ilLDAPRoleAssignmentRule::TYPE_ATTRIBUTE);
1227  $name = new ilTextInputGUI($this->lng->txt('ldap_role_at_name'), 'name');
1228  #$name->setValue($current_rule->getAttributeName());
1229  $name->setSize(32);
1230  $name->setMaxLength(128);
1231  #$name->setInfo($this->lng->txt('ldap_role_at_name_info'));
1232  $radio_attribute->addSubItem($name);
1233 
1234  // Radio Attribute
1235  $val = new ilTextInputGUI($this->lng->txt('ldap_role_at_value'), 'value');
1236  #$val->setValue($current_rule->getAttributeValue());
1237  $val->setSize(32);
1238  $val->setMaxLength(128);
1239  #$val->setInfo($this->lng->txt('ldap_role_at_value_info'));
1240  $radio_attribute->addSubItem($val);
1241  $radio_attribute->setInfo($this->lng->txt('ldap_role_at_info'));
1242 
1243  $group->addOption($radio_attribute);
1244 
1245  // Option by Plugin
1246  $pl_active = $this->component_repository->getPluginSlotById("ldaphk")->hasActivePlugins();
1247  $pl = new ilRadioOption($this->lng->txt('ldap_plugin'), "3");
1248 
1249  $pl->setInfo($this->lng->txt('ldap_plugin_info'));
1250  $pl->setDisabled(!$pl_active);
1251 
1252  $id = new ilNumberInputGUI($this->lng->txt('ldap_plugin_id'), 'plugin_id');
1253  $id->setDisabled(!$pl_active);
1254  $id->setSize(3);
1255  $id->setMaxLength(3);
1256  $id->setMaxValue(999);
1257  $id->setMinValue(1);
1258  $pl->addSubItem($id);
1259 
1260  $group->addOption($pl);
1261  $this->form->addItem($group);
1262  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInfo(string $a_info)
prepareGlobalRoleSelection()
New implementation for InputForm.
This class represents a checkbox property in a property form.
$update
Definition: imgupload.php:92
if($format !==null) $name
Definition: metadata.php:247
This class represents a property in a property form.
This class represents a number property in a property form.
setRequired(bool $a_required)
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRoleMapping()

ilLDAPSettingsGUI::initRoleMapping ( )
private

Definition at line 1069 of file class.ilLDAPSettingsGUI.php.

References ilLDAPRoleGroupMappingSettings\_getInstanceByServerId(), and getServer().

Referenced by deleteRoleMapping().

1069  : void
1070  {
1071  $this->role_mapping = ilLDAPRoleGroupMappingSettings::_getInstanceByServerId($this->getServer()->getServerId());
1072  }
getServer()
Get server settings.
static _getInstanceByServerId(int $a_server_id)
Get instance of class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRoleMappingForm()

ilLDAPSettingsGUI::initRoleMappingForm ( string  $command)
private

init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile

Parameters
string$commandcommand methode

Definition at line 1605 of file class.ilLDAPSettingsGUI.php.

References $url, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFormPropertyGUI\setPostVar(), and setSubTabs().

Referenced by addRoleMapping(), createRoleMapping(), editRoleMapping(), and updateRoleMapping().

1606  {
1607  $this->setSubTabs();
1608  $this->tabs_gui->activateTab('role_mapping');
1609 
1610  if ($this->mapping_id) {
1611  $this->ctrl->setParameter($this, 'mapping_id', $this->mapping_id);
1612  }
1613 
1614  $propertie_form = new ilPropertyFormGUI();
1615  $propertie_form->setTitle($this->lng->txt('ldap_mapping_table'));
1616  $propertie_form->setFormAction($this->ctrl->getFormAction($this, $command));
1617  $propertie_form->addCommandButton($command, $this->lng->txt('save'));
1618  $propertie_form->addCommandButton("roleMapping", $this->lng->txt('cancel'));
1619 
1620  $url = new ilTextInputGUI($this->lng->txt('ldap_server'));
1621  $url->setPostVar("url");
1622  $url->setSize(50);
1623  $url->setMaxLength(255);
1624  $url->setRequired(true);
1625 
1626  $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'));
1627  $group_dn->setPostVar("dn");
1628  $group_dn->setSize(50);
1629  $group_dn->setMaxLength(255);
1630  $group_dn->setInfo($this->lng->txt('ldap_dn_info'));
1631  $group_dn->setRequired(true);
1632 
1633  $member = new ilTextInputGUI($this->lng->txt('ldap_group_member'));
1634  $member->setPostVar("member");
1635  $member->setSize(32);
1636  $member->setMaxLength(255);
1637  $member->setInfo($this->lng->txt('ldap_member_info'));
1638  $member->setRequired(true);
1639 
1640  $member_isdn = new ilCheckboxInputGUI("");
1641  $member_isdn->setPostVar("memberisdn");
1642  $member_isdn->setOptionTitle($this->lng->txt('ldap_memberisdn'));
1643 
1644  $role = new ilTextInputGUI($this->lng->txt('ldap_ilias_role'));
1645  $role->setPostVar("role");
1646  $role->setSize(32);
1647  $role->setMaxLength(255);
1648  $role->setInfo($this->lng->txt('ldap_role_info'));
1649  $role->setRequired(true);
1650 
1651  $info = new ilTextAreaInputGUI($this->lng->txt('ldap_info_text'));
1652  $info->setPostVar("info");
1653  $info->setCols(50);
1654  $info->setRows(3);
1655  $info->setInfo($this->lng->txt('ldap_info_text_info'));
1656 
1657  $info_type = new ilCheckboxInputGUI("");
1658  $info_type->setPostVar("info_type");
1659  $info_type->setOptionTitle($this->lng->txt('ldap_mapping_info_type'));
1660 
1661  $propertie_form->addItem($url);
1662  $propertie_form->addItem($group_dn);
1663  $propertie_form->addItem($member);
1664  $propertie_form->addItem($member_isdn);
1665  $propertie_form->addItem($role);
1666  $propertie_form->addItem($info);
1667  $propertie_form->addItem($info_type);
1668 
1669  return $propertie_form;
1670  }
This class represents a checkbox property in a property form.
setSubTabs()
Set sub tabs for ldap section.
setPostVar(string $a_postvar)
This class represents a text area property in a property form.
$url
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initServer()

ilLDAPSettingsGUI::initServer ( )
private

Definition at line 1053 of file class.ilLDAPSettingsGUI.php.

References $ldap_server_id.

Referenced by __construct().

1053  : void
1054  {
1055  $server_id = 0;
1056  if ($this->ldap_server_id) {
1057  $server_id = $this->ldap_server_id;
1058  }
1059 
1060 
1061  $this->server = new ilLDAPServer($server_id);
1062  }
+ Here is the caller graph for this function:

◆ initUserDefinedFields()

ilLDAPSettingsGUI::initUserDefinedFields ( )
private

Definition at line 1115 of file class.ilLDAPSettingsGUI.php.

References ilUserDefinedFields\_getInstance().

Referenced by initUserMappingForm(), and saveMapping().

1115  : void
1116  {
1117  $this->udf = ilUserDefinedFields::_getInstance();
1118  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initUserMappingForm()

ilLDAPSettingsGUI::initUserMappingForm ( )
private

Create Property Form GUI for User Mapping.

Definition at line 1297 of file class.ilLDAPSettingsGUI.php.

References $lang, ILIAS\Repository\ctrl(), getMappingFields(), initUserDefinedFields(), and ILIAS\Repository\lng().

Referenced by userMapping().

1298  {
1299  $propertie_form = new ilPropertyFormGUI();
1300  $propertie_form->setTitle($this->lng->txt('ldap_mapping_table'));
1301  $propertie_form->setFormAction($this->ctrl->getFormAction($this, 'saveMapping'));
1302  $propertie_form->addCommandButton('saveMapping', $this->lng->txt('save'));
1303 
1304  foreach ($this->getMappingFields() as $mapping => $lang) {
1305  $text_form = new ilTextInputGUI($lang);
1306  $text_form->setPostVar($mapping . "_value");
1307  $text_form->setValue($this->mapping->getValue($mapping));
1308  $text_form->setSize(32);
1309  $text_form->setMaxLength(255);
1310  $propertie_form->addItem($text_form);
1311 
1312  $checkbox_form = new ilCheckboxInputGUI("");
1313  $checkbox_form->setPostVar($mapping . "_update");
1314  $checkbox_form->setChecked($this->mapping->enabledUpdate($mapping));
1315  $checkbox_form->setOptionTitle($this->lng->txt('ldap_update_field_info'));
1316  $propertie_form->addItem($checkbox_form);
1317  }
1318 
1319  $this->initUserDefinedFields();
1320  foreach ($this->udf->getDefinitions() as $definition) {
1321  $text_form = new ilTextInputGUI($definition['field_name']);
1322  $text_form->setPostVar('udf_' . $definition['field_id'] . '_value');
1323  $text_form->setValue($this->mapping->getValue('udf_' . $definition['field_id']));
1324  $text_form->setSize(32);
1325  $text_form->setMaxLength(255);
1326  $propertie_form->addItem($text_form);
1327 
1328  $checkbox_form = new ilCheckboxInputGUI("");
1329  $checkbox_form->setPostVar('udf_' . $definition['field_id'] . '_update');
1330  $checkbox_form->setChecked($this->mapping->enabledUpdate('udf_' . $definition['field_id']));
1331  $checkbox_form->setOptionTitle($this->lng->txt('ldap_update_field_info'));
1332  $propertie_form->addItem($checkbox_form);
1333  }
1334 
1335  return $propertie_form;
1336  }
This class represents a checkbox property in a property form.
ilLDAPAttributeMapping $mapping
$lang
Definition: xapiexit.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRoleAssignmentRule()

ilLDAPSettingsGUI::loadRoleAssignmentRule ( int  $a_rule_id,
bool  $load_from_form = true 
)
private

Load input from form.

Definition at line 553 of file class.ilLDAPSettingsGUI.php.

References $res, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ILIAS\Repository\form(), ilSession\get(), getServer(), ilQueryParser\QP_COMBINATION_AND, ilQueryParser\setMinWordLength(), ilUtil\stripSlashes(), and ilLDAPRoleAssignmentRule\TYPE_ATTRIBUTE.

Referenced by checkRoleAssignmentInput(), and saveRoleSelection().

553  : void
554  {
555  if (is_object($this->rule)) {
556  return;
557  }
558 
559  $this->rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId($a_rule_id);
560 
561  if ($load_from_form) {
562  if ($this->form->getInput('role_name') === '0') {
563  $this->rule->setRoleId((int) $this->form->getInput('role_id'));
564  } elseif ($this->form->getInput('role_search')) {
565  $parser = new ilQueryParser('"' . $this->form->getInput('role_search') . '"');
566 
567  // TODO: Handle minWordLength
568  $parser->setMinWordLength(1);
569  $parser->setCombination(ilQueryParser::QP_COMBINATION_AND);
570  $parser->parse();
571 
572  $object_search = new ilLikeObjectSearch($parser);
573  $object_search->setFilter(array('role'));
574  $res = $object_search->performSearch();
575 
576  $entries = $res->getEntries();
577  if (count($entries) === 1) {
578  $role = current($entries);
579  $this->rule->setRoleId($role['obj_id']);
580  } elseif (count($entries) > 1) {
581  $this->rule->setRoleId(-1);
582  }
583  }
584 
585  $this->rule->setAttributeName($this->form->getInput('name'));
586  $this->rule->setAttributeValue($this->form->getInput('value'));
587  $this->rule->setDN($this->form->getInput('dn'));
588  $this->rule->setMemberAttribute($this->form->getInput('at'));
589  $this->rule->setMemberIsDN((bool) $this->form->getInput('isdn'));
590  $this->rule->enableAddOnUpdate((bool) $this->form->getInput('add_missing'));
591  $this->rule->enableRemoveOnUpdate((bool) $this->form->getInput('remove_deprecated'));
592  $this->rule->setPluginId((int) $this->form->getInput('plugin_id'));
593  $this->rule->setType((int) $this->form->getInput('type'));
594  $this->rule->setServerId($this->getServer()->getServerId());
595  return;
596  }
597 
598  // LOAD from session
599  $this->rule->setServerId($this->getServer()->getServerId());
600  $rule = unserialize(ilSession::get('ldap_role_ass'), ["allowed_classes" => false]);
601 
602  $this->rule->enableAddOnUpdate((bool) ($rule['add_on_update'] ?? false));
603  $this->rule->enableRemoveOnUpdate((bool) ($rule['remove_on_update'] ?? false));
604  $this->rule->setType((int) ilUtil::stripSlashes(
606  ));
607  $this->rule->setDN(ilUtil::stripSlashes($rule['dn'] ?? ''));
608  $this->rule->setMemberAttribute(ilUtil::stripSlashes($rule['at'] ?? ''));
609  $this->rule->setMemberIsDN((bool) (ilUtil::stripSlashes($rule['isdn'] ?? false)));
610  $this->rule->setAttributeName(ilUtil::stripSlashes($rule['name'] ?? ''));
611  $this->rule->setAttributeValue(ilUtil::stripSlashes($rule['value'] ?? ''));
612  $this->rule->setPluginId((int) ilUtil::stripSlashes($rule['plugin'] ?? '0'));
613  }
static get(string $a_var)
$res
Definition: ltiservices.php:69
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getServer()
Get server settings.
setMinWordLength(int $a_length)
form( $class_path, string $cmd)
static _getInstanceByRuleId(int $a_rule_id)
ilLDAPRoleAssignmentRule $rule
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareGlobalRoleSelection()

ilLDAPSettingsGUI::prepareGlobalRoleSelection ( )
private

New implementation for InputForm.

Definition at line 1077 of file class.ilLDAPSettingsGUI.php.

References $role_id, ilObject\_lookupTitle(), ilUtil\_sortIds(), and ILIAS\Repository\lng().

Referenced by initForm(), and initFormRoleAssignments().

1077  : array
1078  {
1079  $global_roles = ilUtil::_sortIds(
1080  $this->rbacReview->getGlobalRoles(),
1081  'object_data',
1082  'title',
1083  'obj_id'
1084  );
1085 
1086  $select[0] = $this->lng->txt('links_select_one');
1087  foreach ($global_roles as $role_id) {
1088  $select[$role_id] = ilObject::_lookupTitle((int) $role_id);
1089  }
1090  return $select;
1091  }
static _lookupTitle(int $obj_id)
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareMappingSelect()

ilLDAPSettingsGUI::prepareMappingSelect ( )
private

Definition at line 1120 of file class.ilLDAPSettingsGUI.php.

References ilLegacyFormElementsUtil\formSelect(), and ILIAS\Repository\lng().

1120  : string
1121  {
1123  $this->mapping_template,
1124  'mapping_template',
1125  [0 => $this->lng->txt('ldap_mapping_template'),
1126  "inetOrgPerson" => 'inetOrgPerson',
1127  "organizationalPerson" => 'organizationalPerson',
1128  "person" => 'person',
1129  "ad_2003" => 'Active Directory (Win 2003)'
1130  ],
1131  false,
1132  true
1133  );
1134  }
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
+ Here is the call graph for this function:

◆ roleAssignments()

ilLDAPSettingsGUI::roleAssignments ( )

Edit role assignments.

Definition at line 236 of file class.ilLDAPSettingsGUI.php.

References ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ilLDAPRoleAssignmentRule\_getRules(), ILIAS\Repository\form(), initFormRoleAssignments(), ILIAS\Repository\lng(), and setSubTabs().

Referenced by addRoleAssignment(), confirmDeleteRules(), deleteRules(), editRoleAssignment(), saveRoleSelection(), and updateRoleAssignment().

236  : void
237  {
238  $this->setSubTabs();
239  $this->tabs_gui->activateTab('role_assignments');
240 
241  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ldap_role_assignments.html', 'Services/LDAP');
242 
243  $this->initFormRoleAssignments('create');
244  $this->role_mapping_rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId(0);
245  $this->tpl->setVariable('NEW_ASSIGNMENT_TBL', $this->form->getHTML());
246 
247 
248  if (count($rules = ilLDAPRoleAssignmentRule::_getRules($this->server->getServerId()))) {
249  $table_gui = new ilLDAPRoleAssignmentTableGUI($this, 'roleAssignments');
250  $table_gui->setTitle($this->lng->txt("ldap_tbl_role_ass"));
251  $table_gui->parse($rules);
252  $table_gui->addMultiCommand("confirmDeleteRules", $this->lng->txt("delete"));
253  $table_gui->setSelectAllCheckbox("rule_id");
254  $this->tpl->setVariable('RULES_TBL', $table_gui->getHTML());
255  }
256  }
initFormRoleAssignments(string $a_mode)
Init form table for new role assignments.
setSubTabs()
Set sub tabs for ldap section.
static _getRules($a_server_id)
Get all rules.
form( $class_path, string $cmd)
static _getInstanceByRuleId(int $a_rule_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roleMapping()

ilLDAPSettingsGUI::roleMapping ( )

Role Mapping Tab.

Definition at line 1341 of file class.ilLDAPSettingsGUI.php.

References ilLDAPRoleGroupMappingSettings\_getInstanceByServerId(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setPostVar(), setSubTabs(), ilTable2GUI\setTitle(), and ILIAS\Repository\toolbar().

Referenced by deleteRoleMapping().

1341  : void
1342  {
1343  $this->setSubTabs();
1344  $this->tabs_gui->setTabActive('role_mapping');
1345  $this->toolbar->addButton(
1346  $this->lng->txt("ldap_new_role_assignment"),
1347  $this->ctrl->getLinkTarget($this, 'addRoleMapping')
1348  );
1349 
1350  //Set propertyform for synchronization settings
1351  $propertie_form = new ilPropertyFormGUI();
1352  $propertie_form->setTitle($this->lng->txt('ldap_role_settings'));
1353  $propertie_form->setFormAction($this->ctrl->getFormAction($this, "saveSyncronizationSettings"));
1354  $propertie_form->addCommandButton("saveSyncronizationSettings", $this->lng->txt('save'));
1355  $role_active = new ilCheckboxInputGUI($this->lng->txt('ldap_role_active'));
1356  $role_active->setPostVar('role_sync_active');
1357  $role_active->setChecked($this->server->enabledRoleSynchronization());
1358  $propertie_form->addItem($role_active);
1359  $binding = new ilCombinationInputGUI($this->lng->txt('ldap_server_binding'));
1360  $binding->setInfo($this->lng->txt('ldap_role_bind_user_info'));
1361  $user = new ilTextInputGUI("");
1362  $user->setPostVar("role_bind_user");
1363  $user->setValue($this->server->getRoleBindDN());
1364  $user->setSize(50);
1365  $user->setMaxLength(255);
1366  $binding->addCombinationItem("0", $user, $this->lng->txt('ldap_role_bind_user'));
1367 
1368  $pass = new ilPasswordInputGUI("");
1369  $pass->setPostVar("role_bind_pass");
1370  $pass->setValue($this->server->getRoleBindPassword());
1371  $pass->setSize(12);
1372  $pass->setMaxLength(100);
1373  $pass->setRetype(false);
1374  $binding->addCombinationItem("1", $pass, $this->lng->txt('ldap_role_bind_pass'));
1375 
1376  $propertie_form->addItem($binding);
1377 
1378  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ldap_role_mappings.html', 'Services/LDAP');
1379  $this->tpl->setVariable("NEW_ASSIGNMENT_TBL", $propertie_form->getHTML());
1380 
1381  //Set Group Assignments Table if mappings exist
1382  $mapping_instance = ilLDAPRoleGroupMappingSettings::_getInstanceByServerId($this->server->getServerId());
1383  $mappings = $mapping_instance->getMappings();
1384  if (count($mappings)) {
1385  $table_gui = new ilLDAPRoleMappingTableGUI($this, $this->server->getServerId());
1386  $table_gui->setTitle($this->lng->txt('ldap_role_group_assignments'));
1387  $table_gui->setData($mappings);
1388  $this->tpl->setVariable("RULES_TBL", $table_gui->getHTML());
1389  }
1390  }
This class represents a checkbox property in a property form.
setSubTabs()
Set sub tabs for ldap section.
setPostVar(string $a_postvar)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstanceByServerId(int $a_server_id)
Get instance of class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roleSelectionRequired()

ilLDAPSettingsGUI::roleSelectionRequired ( )
private

Definition at line 436 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\form(), getServer(), and ilSession\set().

Referenced by addRoleAssignment(), and updateRoleAssignment().

436  : bool
437  {
438  if ($this->rule->getRoleId() > 0) {
439  return false;
440  }
441  $rule = [];
442  $rule['server_id'] = $this->getServer()->getServerId();
443  $rule['rule_id'] = $this->rule_id ?: 0;
444  $rule['role_search'] = $this->form->getInput('role_search');
445  $rule['add_on_update'] = $this->form->getInput('add_missing');
446  $rule['remove_on_update'] = $this->form->getInput('remove_deprecated');
447  $rule['type'] = $this->form->getInput('type');
448  $rule['dn'] = $this->form->getInput('dn');
449  $rule['at'] = $this->form->getInput('at');
450  $rule['isdn'] = $this->form->getInput('isdn');
451  $rule['name'] = $this->form->getInput('name');
452  $rule['value'] = $this->form->getInput('value');
453  $rule['plugin'] = $this->form->getInput('plugin_id');
454  ilSession::set("ldap_role_ass", serialize($rule));
455  $this->ctrl->saveParameter($this, 'rule_id');
456  return true;
457  }
getServer()
Get server settings.
form( $class_path, string $cmd)
ilLDAPRoleAssignmentRule $rule
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilLDAPSettingsGUI::save ( )

Definition at line 941 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\ctrl(), initAttributeMapping(), initForm(), ILIAS\Repository\lng(), and setSubTabs().

941  : bool
942  {
943  $this->setSubTabs();
944  $this->tabs_gui->setTabActive('settings');
945 
946  $this->initForm();
947  if ($this->form_gui->checkInput()) {
948  $this->server->toggleActive((bool) $this->form_gui->getInput('active'));
949  $this->server->enableAuthentication(!(bool) $this->form_gui->getInput('ds'));
950  $this->server->setName($this->form_gui->getInput('server_name'));
951  $this->server->setUrl($this->form_gui->getInput('server_url'));
952  $this->server->setVersion((int) $this->form_gui->getInput('version'));
953  $this->server->setBaseDN($this->form_gui->getInput('base_dn'));
954  $this->server->toggleReferrer((bool) $this->form_gui->getInput('referrals'));
955  $this->server->toggleTLS((bool) $this->form_gui->getInput('tls'));
956  $this->server->setBindingType((int) $this->form_gui->getInput('binding_type'));
957  $this->server->setBindUser($this->form_gui->getInput('bind_dn'));
958  $this->server->setBindPassword($this->form_gui->getInput('bind_pass'));
959  $this->server->setSearchBase($this->form_gui->getInput('search_base'));
960  $this->server->setUserScope((int) $this->form_gui->getInput('user_scope'));
961  $this->server->setUserAttribute($this->form_gui->getInput('user_attribute'));
962  $this->server->setFilter($this->form_gui->getInput('filter'));
963  $this->server->setGroupDN($this->form_gui->getInput('group_dn'));
964  $this->server->setGroupScope((int) $this->form_gui->getInput('group_scope'));
965  $this->server->setGroupFilter($this->form_gui->getInput('group_filter'));
966  $this->server->setGroupMember($this->form_gui->getInput('group_member'));
967  $this->server->enableGroupMemberIsDN((bool) $this->form_gui->getInput('memberisdn'));
968  $this->server->setGroupName($this->form_gui->getInput('group'));
969  $this->server->setGroupAttribute($this->form_gui->getInput('group_attribute'));
970  $this->server->setGroupUserFilter($this->form_gui->getInput('group_user_filter'));
971  $this->server->toggleMembershipOptional((bool) $this->form_gui->getInput('group_optional'));
972  $this->server->enableSyncOnLogin((bool) $this->form_gui->getInput('sync_on_login'));
973  $this->server->enableSyncPerCron((bool) $this->form_gui->getInput('sync_per_cron'));
974  $this->server->setGlobalRole((int) $this->form_gui->getInput('global_role'));
975  $this->server->enableAccountMigration((bool) $this->form_gui->getInput('migration'));
976  $this->server->setUsernameFilter($this->form_gui->getInput("name_filter"));
977  $this->server->enableEscapeDN((bool) $this->form_gui->getInput('escape_dn'));
978  if (!$this->server->validate()) {
979  $this->main_tpl->setOnScreenMessage('failure', $this->ilErr->getMessage());
980  $this->form_gui->setValuesByPost();
981  $this->tpl->setContent($this->form_gui->getHTML());
982  return false;
983  }
984 
985  // Update or create
986  if ($this->server->getServerId()) {
987  $this->server->update();
988  } else {
989  $this->server->create();
990  }
991 
992  // Now server_id exists => update LDAP attribute mapping
993  $this->initAttributeMapping();
994  $this->mapping->setRule('global_role', (string) $this->form_gui->getInput('global_role'), false);
995  $this->mapping->save();
996 
997  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
998  $this->ctrl->redirect($this, 'serverList');
999  return true;
1000  }
1001 
1002  $this->form_gui->setValuesByPost();
1003  $this->tpl->setContent($this->form_gui->getHTML());
1004  return true;
1005  }
setSubTabs()
Set sub tabs for ldap section.
+ Here is the call graph for this function:

◆ saveMapping()

ilLDAPSettingsGUI::saveMapping ( )

Definition at line 649 of file class.ilLDAPSettingsGUI.php.

References ILIAS\LTI\ToolProvider\$key, getMappingFields(), initAttributeMapping(), initUserDefinedFields(), ILIAS\Repository\lng(), and userMapping().

649  : void
650  {
651  $this->initAttributeMapping();
652  $this->tabs_gui->activateTab('role_mapping');
653 
654  foreach (array_keys($this->getMappingFields()) as $key) {
655  $this->mapping->setRule(
656  $key,
657  $this->attribute_mappings[$key][0],
658  $this->attribute_mappings[$key][1]
659  );
660  }
661  $this->initUserDefinedFields();
662  foreach ($this->udf->getDefinitions() as $definition) {
663  $key = 'udf_' . $definition['field_id'];
664  $this->mapping->setRule(
665  $key,
666  $this->attribute_mappings[$key][0],
667  $this->attribute_mappings[$key][1]
668  );
669  }
670 
671  $this->mapping->save();
672  $this->userMapping();
673 
674  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
675  }
string $key
Consumer key/client ID value.
Definition: System.php:193
userMapping()
Ldap User Mapping.
+ Here is the call graph for this function:

◆ saveRoleSelection()

ilLDAPSettingsGUI::saveRoleSelection ( )
protected

Save role selection.

Returns

Definition at line 494 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\lng(), loadRoleAssignmentRule(), roleAssignments(), and showRoleSelection().

494  : bool
495  {
496  if (!$this->ilAccess->checkAccess('write', '', $this->ref_id)) {
497  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
498  $this->roleAssignments();
499  return false;
500  }
501 
502  if (!$this->role_id) {
503  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
504  $this->showRoleSelection();
505  return false;
506  }
507 
508  $this->loadRoleAssignmentRule($this->rule_id ?? 0, false);
509  $this->rule->setRoleId($this->role_id);
510 
511  if ($this->rule_id) {
512  $this->rule->update();
513  } else {
514  $this->rule->create();
515  }
516 
517  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
518  $this->roleAssignments();
519  return true;
520  }
loadRoleAssignmentRule(int $a_rule_id, bool $load_from_form=true)
Load input from form.
showRoleSelection()
show role selection
roleAssignments()
Edit role assignments.
+ Here is the call graph for this function:

◆ saveSyncronizationSettings()

ilLDAPSettingsGUI::saveSyncronizationSettings ( )

save Syncronization Settings on Role Mapping screen

Definition at line 1747 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

1747  : void
1748  {
1749  $this->server->setRoleBindDN($this->role_bind_user);
1750  $this->server->setRoleBindPassword($this->role_bind_pass);
1751  $this->server->enableRoleSynchronization($this->role_sync_active);
1752 
1753  // Update or create
1754  if ($this->server->getServerId()) {
1755  $this->server->update();
1756  }
1757  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1758  $this->ctrl->redirect($this, "roleMapping");
1759  }
+ Here is the call graph for this function:

◆ serverList()

ilLDAPSettingsGUI::serverList ( )

Definition at line 677 of file class.ilLDAPSettingsGUI.php.

References ilLDAPServer\checkLDAPLib(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

Referenced by activateServer(), confirmDeleteServerSettings(), deactivateServer(), and deleteServerSettings().

677  : void
678  {
679  if (!$this->rbacSystem->checkAccess("visible,read", $this->ref_id)) {
680  $this->ilErr->raiseError($this->lng->txt('msg_no_perm_read'), $this->ilErr->WARNING);
681  }
682 
683  if (!ilLDAPServer::checkLDAPLib() && $this->server->isActive()) {
684  $this->main_tpl->setOnScreenMessage('failure', 'Missing LDAP libraries. Please ensure that the PHP LDAP module is installed on your server.');
685  }
686 
687  if ($this->rbacSystem->checkAccess("write", $this->ref_id)) {
688  $this->toolbar->addButton(
689  $this->lng->txt("add_ldap_server"),
690  $this->ctrl->getLinkTarget($this, "addServerSettings")
691  );
692  }
693 
694  $table = new ilLDAPServerTableGUI($this, "serverList");
695 
696  $this->tpl->setContent($table->getHTML());
697  }
static checkLDAPLib()
Check if ldap module is installed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setServerFormValues()

ilLDAPSettingsGUI::setServerFormValues ( )

Definition at line 699 of file class.ilLDAPSettingsGUI.php.

References ilLDAPAttributeMapping\_lookupGlobalRole().

Referenced by editServerSettings().

699  : void
700  {
701  $this->form_gui->setValuesByArray(array(
702  'active' => $this->server->isActive(),
703  'ds' => !$this->server->isAuthenticationEnabled(),
704  'server_name' => $this->server->getName(),
705  'server_url' => $this->server->getUrlString(),
706  'version' => $this->server->getVersion(),
707  'base_dn' => $this->server->getBaseDN(),
708  'referrals' => $this->server->isActiveReferrer(),
709  'tls' => $this->server->isActiveTLS(),
710  'binding_type' => $this->server->getBindingType(),
711  'bind_dn' => $this->server->getBindUser(),
712  'bind_pass' => $this->server->getBindPassword(),
713  'bind_pass_retype' => $this->server->getBindPassword(),
714  'search_base' => $this->server->getSearchBase(),
715  'user_scope' => $this->server->getUserScope(),
716  'user_attribute' => $this->server->getUserAttribute(),
717  'filter' => $this->server->getFilter(),
718  'group_dn' => $this->server->getGroupDN(),
719  'group_scope' => $this->server->getGroupScope(),
720  'group_filter' => $this->server->getGroupFilter(),
721  'group_member' => $this->server->getGroupMember(),
722  'memberisdn' => $this->server->enabledGroupMemberIsDN(),
723  'group' => $this->server->getGroupName(),
724  'group_attribute' => $this->server->getGroupAttribute(),
725  'group_optional' => $this->server->isMembershipOptional(),
726  'group_user_filter' => $this->server->getGroupUserFilter(),
727  'sync_on_login' => $this->server->enabledSyncOnLogin(),
728  'sync_per_cron' => $this->server->enabledSyncPerCron(),
729  'global_role' => ilLDAPAttributeMapping::_lookupGlobalRole($this->server->getServerId()),
730  'migration' => (int) $this->server->isAccountMigrationEnabled(),
731  "name_filter" => $this->server->getUsernameFilter(),
732  'escape_dn' => $this->server->enabledEscapeDN()
733  ));
734  }
static _lookupGlobalRole(int $a_server_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubTabs()

ilLDAPSettingsGUI::setSubTabs ( )
private

Set sub tabs for ldap section.

Definition at line 1012 of file class.ilLDAPSettingsGUI.php.

References ilLDAPServer\_getServerList(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by addRoleAssignment(), confirmDeleteRules(), editRoleAssignment(), editServerSettings(), initRoleMappingForm(), roleAssignments(), roleMapping(), save(), showRoleSelection(), and userMapping().

1012  : void
1013  {
1014  $this->tabs_gui->clearTargets();
1015 
1016  $this->tabs_gui->setBackTarget(
1017  $this->lng->txt("back"),
1018  $this->ctrl->getLinkTarget($this, 'serverList')
1019  );
1020 
1021 
1022  $this->tabs_gui->addTab(
1023  "settings",
1024  $this->lng->txt("ldap_settings"),
1025  $this->ctrl->getLinkTarget($this, 'editServerSettings')
1026  );
1027 
1028  // Disable all other tabs, if server hasn't been configured.
1029  if (!count(ilLDAPServer::_getServerList())) {
1030  return;
1031  }
1032 
1033  $this->tabs_gui->addTab(
1034  "user_mapping",
1035  $this->lng->txt("ldap_user_mapping"),
1036  $this->ctrl->getLinkTarget($this, 'userMapping')
1037  );
1038 
1039  $this->tabs_gui->addTab(
1040  "role_assignments",
1041  $this->lng->txt('ldap_role_assignments'),
1042  $this->ctrl->getLinkTarget($this, 'roleAssignments')
1043  );
1044 
1045  $this->tabs_gui->addTab(
1046  "role_mapping",
1047  $this->lng->txt("ldap_role_mapping"),
1048  $this->ctrl->getLinkTarget($this, 'roleMapping')
1049  );
1050  }
static _getServerList()
Get list of all configured servers.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setValuesByArray()

ilLDAPSettingsGUI::setValuesByArray ( )
private

set values of form array

Definition at line 285 of file class.ilLDAPSettingsGUI.php.

References $role_id, ilObject\_lookupTitle(), ILIAS\Repository\form(), and ILIAS\Repository\int().

Referenced by editRoleAssignment().

285  : void
286  {
287  $role_id = $this->role_mapping_rule->getRoleId();
288  if ($this->rbacReview->isGlobalRole($role_id)) {
289  $val['role_name'] = 0;
290  $val['role_id'] = $role_id;
291  } else {
292  $val['role_name'] = 1;
293  $val['role_search'] = ilObject::_lookupTitle($role_id);
294  }
295  $val['add_missing'] = (int) $this->role_mapping_rule->isAddOnUpdateEnabled();
296  $val['remove_deprecated'] = (int) $this->role_mapping_rule->isRemoveOnUpdateEnabled();
297  $val['type'] = $this->role_mapping_rule->getType();
298  $val['dn'] = $this->role_mapping_rule->getDN();
299  $val['at'] = $this->role_mapping_rule->getMemberAttribute();
300  $val['isdn'] = $this->role_mapping_rule->isMemberAttributeDN();
301  $val['name'] = $this->role_mapping_rule->getAttributeName();
302  $val['value'] = $this->role_mapping_rule->getAttributeValue();
303  $val['plugin_id'] = $this->role_mapping_rule->getPluginId();
304 
305  $this->form->setValuesByArray($val);
306  }
static _lookupTitle(int $obj_id)
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRoleSelection()

ilLDAPSettingsGUI::showRoleSelection ( )
protected

show role selection

Definition at line 464 of file class.ilLDAPSettingsGUI.php.

References $res, ILIAS\Repository\ctrl(), ilSession\get(), ILIAS\Repository\lng(), ilQueryParser\QP_COMBINATION_AND, and setSubTabs().

Referenced by saveRoleSelection().

464  : bool
465  {
466  $this->setSubTabs();
467  $this->tabs_gui->activateTab('role_assignment');
468  $this->ctrl->saveParameter($this, 'rule_id');
469 
470  $parser = new ilQueryParser(unserialize(ilSession::get('ldap_role_ass'), ["allowed_classes" => false])['role_search']);
471  $parser->setMinWordLength(1);
472  $parser->setCombination(ilQueryParser::QP_COMBINATION_AND);
473  $parser->parse();
474 
475  $object_search = new ilLikeObjectSearch($parser);
476  $object_search->setFilter(array('role'));
477  $res = $object_search->performSearch();
478 
479  $entries = $res->getEntries();
480 
481  $table = new ilRoleSelectionTableGUI($this, 'showRoleSelection');
482  $table->setTitle($this->lng->txt('ldap_role_selection'));
483  $table->addMultiCommand('saveRoleSelection', $this->lng->txt('ldap_choose_role'));
484  $table->parse($entries);
485 
486  $this->tpl->setContent($table->getHTML());
487  return true;
488  }
static get(string $a_var)
$res
Definition: ltiservices.php:69
setSubTabs()
Set sub tabs for ldap section.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateRoleAssignment()

ilLDAPSettingsGUI::updateRoleAssignment ( )

update role assignment

Definition at line 311 of file class.ilLDAPSettingsGUI.php.

References checkRoleAssignmentInput(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), initFormRoleAssignments(), ILIAS\Repository\lng(), roleAssignments(), and roleSelectionRequired().

311  : bool
312  {
313  if (!$this->ilAccess->checkAccess('write', '', $this->ref_id)) {
314  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
315  $this->roleAssignments();
316  return false;
317  }
318 
319  $this->initFormRoleAssignments('edit');
320 
321  $formWithoutErrors = $this->form->checkInput();
322  $roleErrorMessage = $this->checkRoleAssignmentInput($this->rule_id);
323  if (!$formWithoutErrors || $roleErrorMessage !== '') {
324  if ($roleErrorMessage !== '') {
325  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt($roleErrorMessage));
326  }
327 
328  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ldap_role_assignments.html', 'Services/LDAP');
329 
330  $this->form->setValuesByPost();
331  $this->tpl->setVariable('NEW_ASSIGNMENT_TBL', $this->form->getHTML());
332  $this->tabs_gui->activateSubTab('role_assignments');
333  return true;
334  }
335 
336  // Might redirect
337  if ($this->roleSelectionRequired()) {
338  $this->ctrl->redirect($this, 'showRoleSelection');
339  } else {
340  $this->rule->update();
341  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'));
342  $this->roleAssignments();
343  }
344  return true;
345  }
checkRoleAssignmentInput(int $a_rule_id=0)
Check role assignment input.
initFormRoleAssignments(string $a_mode)
Init form table for new role assignments.
roleAssignments()
Edit role assignments.
form( $class_path, string $cmd)
+ Here is the call graph for this function:

◆ updateRoleMapping()

ilLDAPSettingsGUI::updateRoleMapping ( )

Check edit screen input and save to db.

Definition at line 1716 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\ctrl(), initRoleMappingForm(), and ILIAS\Repository\lng().

1716  : void
1717  {
1718  $propertie_form = $this->initRoleMappingForm("updateRoleMapping");
1719 
1720  if ($propertie_form->checkInput() && $this->rbacReview->roleExists($propertie_form->getInput("role"))) {
1721  $mapping = new ilLDAPRoleGroupMappingSetting($this->mapping_id);
1722  $mapping->setServerId($this->server->getServerId());
1723  $mapping->setURL($propertie_form->getInput("url"));
1724  $mapping->setDN($propertie_form->getInput("dn"));
1725  $mapping->setMemberAttribute($propertie_form->getInput("member"));
1726  $mapping->setMemberISDN((bool) $propertie_form->getInput("memberisdn"));
1727  $mapping->setRoleByName($propertie_form->getInput("role"));
1728  $mapping->setMappingInfo($propertie_form->getInput("info"));
1729  $mapping->setMappingInfoType((bool) $propertie_form->getInput("info_type"));
1730  $mapping->update();
1731 
1732  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1733  $this->ctrl->redirect($this, "roleMapping");
1734  } else {
1735  if (!$this->rbacReview->roleExists($propertie_form->getInput("role"))) {
1736  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("ldap_role_not_exists") . " " .
1737  $propertie_form->getInput("role"));
1738  }
1739  $propertie_form->setValuesByPost();
1740  $this->tpl->setContent($propertie_form->getHTML());
1741  }
1742  }
ilLDAPAttributeMapping $mapping
initRoleMappingForm(string $command)
init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
+ Here is the call graph for this function:

◆ userMapping()

ilLDAPSettingsGUI::userMapping ( )

Ldap User Mapping.

Definition at line 1565 of file class.ilLDAPSettingsGUI.php.

References initAttributeMapping(), initUserMappingForm(), setSubTabs(), and userMappingToolbar().

Referenced by chooseMapping(), and saveMapping().

1565  : void
1566  {
1567  $this->initAttributeMapping();
1568 
1569  $this->setSubTabs();
1570  $this->tabs_gui->activateTab('user_mapping');
1571  $this->userMappingToolbar();
1572 
1573  $propertie_form = $this->initUserMappingForm();
1574 
1575  $this->tpl->setContent($propertie_form->getHTML());
1576  }
userMappingToolbar()
Create Toolbar.
setSubTabs()
Set sub tabs for ldap section.
initUserMappingForm()
Create Property Form GUI for User Mapping.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userMappingToolbar()

ilLDAPSettingsGUI::userMappingToolbar ( )
private

Create Toolbar.

Definition at line 1276 of file class.ilLDAPSettingsGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

Referenced by userMapping().

1276  : void
1277  {
1278  $select_form = new ilSelectInputGUI("mapping_template");
1279  $select_form->setPostVar("mapping_template");
1280  $options = array(
1281  "" => $this->lng->txt('ldap_mapping_template'),
1282  "inetOrgPerson" => 'inetOrgPerson',
1283  "organizationalPerson" => 'organizationalPerson',
1284  "person" => 'person',
1285  "ad_2003" => 'Active Directory (Win 2003)');
1286  $select_form->setOptions($options);
1287  $select_form->setValue($this->mapping_template);
1288 
1289  $this->toolbar->addInputItem($select_form);
1290  $this->toolbar->addFormButton($this->lng->txt('show'), "chooseMapping");
1291  $this->toolbar->setFormAction($this->ctrl->getFormAction($this, "chooseMapping"));
1292  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $attribute_mappings

array ilLDAPSettingsGUI::$attribute_mappings = []
private

Definition at line 63 of file class.ilLDAPSettingsGUI.php.

◆ $component_repository

ilComponentRepository ilLDAPSettingsGUI::$component_repository
private

Definition at line 42 of file class.ilLDAPSettingsGUI.php.

◆ $ctrl

ilCtrl ilLDAPSettingsGUI::$ctrl
private

Definition at line 32 of file class.ilLDAPSettingsGUI.php.

◆ $form

ilPropertyFormGUI ilLDAPSettingsGUI::$form = null
private

Definition at line 30 of file class.ilLDAPSettingsGUI.php.

◆ $form_gui

ilPropertyFormGUI ilLDAPSettingsGUI::$form_gui = null
private

Definition at line 29 of file class.ilLDAPSettingsGUI.php.

◆ $ilAccess

ilAccessHandler ilLDAPSettingsGUI::$ilAccess
private

Definition at line 37 of file class.ilLDAPSettingsGUI.php.

◆ $ilErr

ilErrorHandling ilLDAPSettingsGUI::$ilErr
private

Definition at line 36 of file class.ilLDAPSettingsGUI.php.

◆ $ldap_server_id

int ilLDAPSettingsGUI::$ldap_server_id = null
private

Definition at line 56 of file class.ilLDAPSettingsGUI.php.

Referenced by initServer().

◆ $lng

ilLanguage ilLDAPSettingsGUI::$lng
private

Definition at line 34 of file class.ilLDAPSettingsGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilLDAPSettingsGUI::$main_tpl
private

Definition at line 41 of file class.ilLDAPSettingsGUI.php.

◆ $mapping

ilLDAPAttributeMapping ilLDAPSettingsGUI::$mapping
private

Definition at line 28 of file class.ilLDAPSettingsGUI.php.

◆ $mapping_id

int ilLDAPSettingsGUI::$mapping_id = null
private

Definition at line 59 of file class.ilLDAPSettingsGUI.php.

◆ $mapping_template

string ilLDAPSettingsGUI::$mapping_template = null
private

Definition at line 55 of file class.ilLDAPSettingsGUI.php.

◆ $mappings

array ilLDAPSettingsGUI::$mappings = null
private

Definition at line 54 of file class.ilLDAPSettingsGUI.php.

◆ $rbacReview

ilRbacReview ilLDAPSettingsGUI::$rbacReview
private

Definition at line 38 of file class.ilLDAPSettingsGUI.php.

◆ $rbacSystem

ilRbacSystem ilLDAPSettingsGUI::$rbacSystem
private

Definition at line 39 of file class.ilLDAPSettingsGUI.php.

◆ $ref_id

int ilLDAPSettingsGUI::$ref_id
private

Definition at line 26 of file class.ilLDAPSettingsGUI.php.

◆ $role_bind_pass

string ilLDAPSettingsGUI::$role_bind_pass = null
private

Definition at line 61 of file class.ilLDAPSettingsGUI.php.

◆ $role_bind_user

string ilLDAPSettingsGUI::$role_bind_user = null
private

Definition at line 60 of file class.ilLDAPSettingsGUI.php.

◆ $role_id

int ilLDAPSettingsGUI::$role_id = null
private

Definition at line 52 of file class.ilLDAPSettingsGUI.php.

Referenced by prepareGlobalRoleSelection(), and setValuesByArray().

◆ $role_mapping

ilLDAPRoleGroupMappingSettings ilLDAPSettingsGUI::$role_mapping = null
private

Definition at line 46 of file class.ilLDAPSettingsGUI.php.

◆ $role_mapping_rule

ilLDAPRoleAssignmentRule ilLDAPSettingsGUI::$role_mapping_rule = null
private

Definition at line 44 of file class.ilLDAPSettingsGUI.php.

◆ $role_sync_active

bool ilLDAPSettingsGUI::$role_sync_active = false
private

Definition at line 62 of file class.ilLDAPSettingsGUI.php.

◆ $rule

ilLDAPRoleAssignmentRule ilLDAPSettingsGUI::$rule = null
private

Definition at line 45 of file class.ilLDAPSettingsGUI.php.

◆ $rule_id

int ilLDAPSettingsGUI::$rule_id = null
private

Definition at line 51 of file class.ilLDAPSettingsGUI.php.

◆ $rule_ids

array ilLDAPSettingsGUI::$rule_ids = null
private

Definition at line 50 of file class.ilLDAPSettingsGUI.php.

◆ $server

ilLDAPServer ilLDAPSettingsGUI::$server
private

Definition at line 27 of file class.ilLDAPSettingsGUI.php.

Referenced by getServer().

◆ $server_ids

array ilLDAPSettingsGUI::$server_ids = null
private

Definition at line 58 of file class.ilLDAPSettingsGUI.php.

◆ $tabs_gui

ilTabsGUI ilLDAPSettingsGUI::$tabs_gui
private

Definition at line 33 of file class.ilLDAPSettingsGUI.php.

◆ $toolbar

ilToolbarGUI ilLDAPSettingsGUI::$toolbar
private

Definition at line 40 of file class.ilLDAPSettingsGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilLDAPSettingsGUI::$tpl
private

Definition at line 35 of file class.ilLDAPSettingsGUI.php.

◆ $udf

ilUserDefinedFields ilLDAPSettingsGUI::$udf
private

Definition at line 43 of file class.ilLDAPSettingsGUI.php.


The documentation for this class was generated from the following file: