ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilLDAPSettingsGUI Class Reference
+ Collaboration diagram for ilLDAPSettingsGUI:

Public Member Functions

 __construct ($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 ilToolbarGUI $ilToolbar. More...
 
 editRoleMapping ()
 Edit Assigments for role mapping. More...
 
 createRoleMapping ()
 Check add screen input and save to db ilRbacReview $rbacreview. 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 ilRbacReview $rbacreview. More...
 
 saveSyncronizationSettings ()
 save Syncronization Settings on Role Mapping screen More...
 

Protected Member Functions

 setValuesByArray ()
 set values of form array More...
 
 roleSelection ()
 
 showRoleSelection ()
 show role selection More...
 
 saveRoleSelection ()
 Save role selection. More...
 
 checkRoleAssignmentInput ($a_rule_id=0)
 Check role assignment input. More...
 
 getRoleAssignmentTable ()
 Show active role assignments. More...
 
 loadRoleAssignmentRule ($a_rule_id, $a_from_form=true)
 Load input from form. More...
 
 initFormRoleAssignments ($a_mode)
 Init form table for new role assignments. More...
 

Private Member Functions

 initForm ()
 
 setSubTabs ()
 Set sub tabs for ldap section. More...
 
 initServer ()
 
 initAttributeMapping ()
 
 initRoleMapping ()
 
 prepareGlobalRoleSelection ($a_as_select=true)
 New implementation for InputForm. More...
 
 prepareRoleSelect ($a_as_select=true)
 Used for old style table. More...
 
 getMappingFields ()
 
 initUserDefinedFields ()
 
 prepareMappingSelect ()
 
 loadMappingDetails ()
 Load info about hide/show details. More...
 
 hasActiveRoleAssignmentPlugins ()
 Check if the plugin is active. More...
 
 userMappingToolbar ()
 Create Toolbar ilToolbarGUI $ilToolbar. More...
 
 initUserMappingForm ()
 Create Property Form GUI for User Mapping. More...
 
 initRoleMappingForm ($command)
 init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile More...
 

Private Attributes

 $ref_id = null
 
 $server = null
 

Detailed Description

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

ilLDAPSettingsGUI:

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

Constructor & Destructor Documentation

◆ __construct()

ilLDAPSettingsGUI::__construct (   $a_auth_ref_id)

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

References $_GET, $ilCtrl, $lng, $tpl, and initServer().

39  {
40  global $lng,$ilCtrl,$tpl,$ilTabs;
41 
42  $this->ctrl = $ilCtrl;
43  $this->tabs_gui = $ilTabs;
44  $this->lng = $lng;
45  $this->lng->loadLanguageModule('ldap');
46 
47  $this->tpl = $tpl;
48 
49  if ($_GET["cmd"] != "addServerSettings") {
50  $this->ctrl->saveParameter($this, 'ldap_server_id');
51  }
52 
53 
54  $this->ref_id = $a_auth_ref_id;
55 
56 
57  $this->initServer();
58  }
$_GET["client_id"]
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

Member Function Documentation

◆ activateServer()

ilLDAPSettingsGUI::activateServer ( )

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

References serverList().

1596  {
1597  $this->server->toggleActive(1);
1598  $this->server->update();
1599  $this->serverList();
1600  }
+ Here is the call graph for this function:

◆ addRoleAssignment()

ilLDAPSettingsGUI::addRoleAssignment ( )

add new role assignment

public

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

References $_POST, $ilErr, checkRoleAssignmentInput(), getRoleAssignmentTable(), initFormRoleAssignments(), roleAssignments(), roleSelection(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

289  {
290  global $ilErr,$ilAccess;
291 
292  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
293  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
294  $this->roleAssignment();
295  return false;
296  }
297 
298  include_once('Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
299  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
300 
301  $this->initFormRoleAssignments('create');
302  if (!$this->form->checkInput() or ($err = $this->checkRoleAssignmentInput())) {
303  if ($err) {
304  ilUtil::sendFailure($this->lng->txt($err));
305  }
306 
307  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ldap_role_assignments.html', 'Services/LDAP');
308 
309  // DONE: wrap this
310  $this->form->setValuesByPost();
311  $this->tpl->setVariable('NEW_ASSIGNMENT_TBL', $this->form->getHTML());
312  $this->tpl->setVariable('RULES_TBL', $this->getRoleAssignmentTable());
313  $this->tabs_gui->setSubTabActive('shib_role_assignment');
314  return true;
315  }
316 
317  // Might redirect
318  $this->roleSelection();
319 
320  $this->rule->create();
321  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
322  unset($_POST);
323  $this->roleAssignments();
324  return true;
325  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
checkRoleAssignmentInput($a_rule_id=0)
Check role assignment input.
roleAssignments()
Edit role assignments.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initFormRoleAssignments($a_mode)
Init form table for new role assignments.
$_POST["username"]
getRoleAssignmentTable()
Show active role assignments.
+ Here is the call graph for this function:

◆ addRoleAutoCompleteObject()

ilLDAPSettingsGUI::addRoleAutoCompleteObject ( )

Add Member for autoComplete.

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

References ilRoleAutoCompleteInputGUI\echoAutoCompleteList().

1276  {
1277  include_once("./Services/Form/classes/class.ilRoleAutoCompleteInputGUI.php");
1279  }
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 1690 of file class.ilLDAPSettingsGUI.php.

References $_GET, and initRoleMappingForm().

1691  {
1692  $propertie_form = $this->initRoleMappingForm("createRoleMapping");
1693  $propertie_form->getItemByPostVar("url")->setValue($this->server->getUrl());
1694 
1695  if (isset($_GET["mapping_id"])) {
1696  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
1697  $mapping = new ilLDAPRoleGroupMappingSetting($_GET["mapping_id"]);
1698  $mapping->read();
1699 
1700  $propertie_form->getItemByPostVar("url")->setValue($mapping->getURL());
1701  $propertie_form->getItemByPostVar("dn")->setValue($mapping->getDN());
1702  $propertie_form->getItemByPostVar("member")->setValue($mapping->getMemberAttribute());
1703  $propertie_form->getItemByPostVar("memberisdn")->setChecked($mapping->getMemberISDN());
1704  $propertie_form->getItemByPostVar("role")->setValue($mapping->getRoleName());
1705  $propertie_form->getItemByPostVar("info")->setValue($mapping->getMappingInfo());
1706  $propertie_form->getItemByPostVar("info_type")->setChecked($mapping->getMappingInfoType());
1707  }
1708 
1709  $this->tpl->setContent($propertie_form->getHTML());
1710  }
$_GET["client_id"]
initRoleMappingForm($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 1505 of file class.ilLDAPSettingsGUI.php.

References initForm().

1506  {
1507  $this->ctrl->clearParameters($this);
1508 
1509  $this->initForm();
1510  return $this->tpl->setContent($this->form_gui->getHtml());
1511  }
+ Here is the call graph for this function:

◆ checkRoleAssignmentInput()

ilLDAPSettingsGUI::checkRoleAssignmentInput (   $a_rule_id = 0)
protected

Check role assignment input.

Returns
Parameters
int$a_rule_id

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

References $ilErr, and loadRoleAssignmentRule().

Referenced by addRoleAssignment(), and updateRoleAssignment().

431  {
432  global $ilErr;
433 
434  $this->loadRoleAssignmentRule($a_rule_id);
435  $this->rule->validate();
436  return $ilErr->getMessage();
437  }
global $ilErr
Definition: raiseError.php:16
loadRoleAssignmentRule($a_rule_id, $a_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 548 of file class.ilLDAPSettingsGUI.php.

References $_POST, $key, ilLDAPAttributeMappingUtils\_getMappingRulesByClass(), initAttributeMapping(), and userMapping().

549  {
550  if (!$_POST['mapping_template']) {
551  $this->userMapping();
552  return;
553  }
554 
555  $this->initAttributeMapping();
556  $this->mapping->clearRules();
557 
558  include_once('Services/LDAP/classes/class.ilLDAPAttributeMappingUtils.php');
559  foreach (ilLDAPAttributeMappingUtils::_getMappingRulesByClass($_POST['mapping_template']) as $key => $value) {
560  $this->mapping->setRule($key, $value, 0);
561  }
562  $this->userMapping();
563  return true;
564  }
userMapping()
Ldap User Mapping.
static _getMappingRulesByClass($a_class)
Get mapping rule by objectClass.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ confirmDeleteRoleMapping()

ilLDAPSettingsGUI::confirmDeleteRoleMapping ( )

confirm delete role mappings

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

References $_POST, $id, $txt, and ilUtil\sendFailure().

1475  {
1476  if (!is_array($_POST['mappings'])) {
1477  ilUtil::sendFailure($this->lng->txt('select_one'), true);
1478  $this->ctrl->redirect($this, "roleMapping");
1479  return false;
1480  }
1481 
1482  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1483  $c_gui = new ilConfirmationGUI();
1484 
1485  // set confirm/cancel commands
1486  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteRoleMapping"));
1487  $c_gui->setHeaderText($this->lng->txt("ldap_confirm_del_role_ass"));
1488  $c_gui->setCancel($this->lng->txt("cancel"), "roleMapping");
1489  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteRoleMapping");
1490 
1491  foreach ($_POST['mappings'] as $id) {
1492  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
1493  $mapping = new ilLDAPRoleGroupMappingSetting($id);
1494  $mapping->read();
1495  $txt = $this->lng->txt('obj_role') . ": " . $mapping->getRoleName() . ", ";
1496  $txt .= $this->lng->txt('ldap_group_dn') . ": " . $mapping->getDN() . ", ";
1497  $txt .= $this->lng->txt('ldap_server_short') . " " . $mapping->getURL() . ", ";
1498  $txt .= $this->lng->txt('ldap_group_member_short') . " " . $mapping->getMemberAttribute();
1499 
1500  $c_gui->addItem("mappings[]", $id, $txt);
1501  }
1502  $this->tpl->setContent($c_gui->getHTML());
1503  }
if(!array_key_exists('StateId', $_REQUEST)) $id
$txt
Definition: error.php:11
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteRules()

ilLDAPSettingsGUI::confirmDeleteRules ( )

Confirm delete rules.

public

Parameters

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

References $_POST, $rule, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), roleAssignments(), ilUtil\sendFailure(), and setSubTabs().

232  {
233  if (!is_array($_POST['rule_ids'])) {
234  ilUtil::sendFailure($this->lng->txt('select_one'));
235  $this->roleAssignments();
236  return false;
237  }
238  $this->setSubTabs();
239  $this->tabs_gui->setTabActive('role_assignments');
240 
241  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
242  $c_gui = new ilConfirmationGUI();
243 
244  // set confirm/cancel commands
245  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteRules"));
246  $c_gui->setHeaderText($this->lng->txt("ldap_confirm_del_role_ass"));
247  $c_gui->setCancel($this->lng->txt("cancel"), "roleAssignments");
248  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteRules");
249 
250  // add items to delete
251  include_once('Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
252  foreach ($_POST["rule_ids"] as $rule_id) {
254  $c_gui->addItem('rule_ids[]', $rule_id, $rule->conditionToString());
255  }
256  $this->tpl->setContent($c_gui->getHTML());
257  }
setSubTabs()
Set sub tabs for ldap section.
$rule
Definition: showstats.php:43
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
roleAssignments()
Edit role assignments.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteServerSettings()

ilLDAPSettingsGUI::confirmDeleteServerSettings ( )

Confirm delete rules.

public

Parameters

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

References $_GET, array, ilUtil\sendFailure(), and serverList().

1532  {
1533  if (!isset($_GET["ldap_server_id"])) {
1534  ilUtil::sendFailure($this->lng->txt('select_one'));
1535  $this->serverList();
1536  return false;
1537  }
1538 
1539  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1540  $c_gui = new ilConfirmationGUI();
1541 
1542  // set confirm/cancel commands
1543  $c_gui->setFormAction($this->ctrl->getFormAction($this, "deleteServerSettings"));
1544  $c_gui->setHeaderText($this->lng->txt("ldap_confirm_del_server_settings"));
1545  $c_gui->setCancel($this->lng->txt("cancel"), "serverList");
1546  $c_gui->setConfirm($this->lng->txt("confirm"), "deleteServerSettings");
1547 
1548  // add items to delete
1549  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
1550  foreach ((array) $_GET["ldap_server_id"] as $server_id) {
1551  $setting = new ilLDAPServer($server_id);
1552  $c_gui->addItem('server_ids[]', $server_id, $setting->getName());
1553  }
1554  $this->tpl->setContent($c_gui->getHTML());
1555  }
$_GET["client_id"]
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Confirmation screen class.
+ Here is the call graph for this function:

◆ createRoleMapping()

ilLDAPSettingsGUI::createRoleMapping ( )

Check add screen input and save to db ilRbacReview $rbacreview.

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

References initRoleMappingForm(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

1442  {
1443  global $rbacreview;
1444  $propertie_form = $this->initRoleMappingForm("createRoleMapping");
1445 
1446  if ($propertie_form->checkInput() && $rbacreview->roleExists($propertie_form->getInput("role"))) {
1447  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
1448  $mapping = new ilLDAPRoleGroupMappingSetting(0);
1449  $mapping->setServerId($this->server->getServerId());
1450  $mapping->setURL($propertie_form->getInput("url"));
1451  $mapping->setDN($propertie_form->getInput("dn"));
1452  $mapping->setMemberAttribute($propertie_form->getInput("member"));
1453  $mapping->setMemberISDN($propertie_form->getInput("memberisdn"));
1454  $mapping->setRoleByName($propertie_form->getInput("role"));
1455  $mapping->setMappingInfo($propertie_form->getInput("info"));
1456  $mapping->setMappingInfoType($propertie_form->getInput("info_type"));
1457  $mapping->save();
1458 
1459  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1460  $this->ctrl->redirect($this, "roleMapping");
1461  } else {
1462  if (!$rbacreview->roleExists($propertie_form->getInput("role"))) {
1463  ilUtil::sendFailure($this->lng->txt("ldap_role_not_exists") . " " .
1464  $propertie_form->getInput("role"));
1465  }
1466  $propertie_form->setValuesByPost();
1467  $this->tpl->setContent($propertie_form->getHTML());
1468  }
1469  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initRoleMappingForm($command)
init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ deactivateServer()

ilLDAPSettingsGUI::deactivateServer ( )

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

References serverList().

1603  {
1604  $this->server->toggleActive(0);
1605  $this->server->update();
1606  $this->serverList();
1607  }
+ Here is the call graph for this function:

◆ deleteRoleMapping()

ilLDAPSettingsGUI::deleteRoleMapping ( )

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

References $_POST, initRoleMapping(), roleMapping(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

531  {
532  if (!count($_POST['mappings'])) {
533  ilUtil::sendFailure($this->lng->txt('select_one'));
534  $this->roleMapping();
535  return false;
536  }
537 
538  $this->initRoleMapping();
539 
540  foreach ($_POST['mappings'] as $mapping_id) {
541  $this->role_mapping->delete($mapping_id);
542  }
543  ilUtil::sendSuccess($this->lng->txt('ldap_deleted_role_mapping'));
544  $this->roleMapping();
545  return true;
546  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
roleMapping()
Role Mapping Tab ilToolbarGUI $ilToolbar.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteRules()

ilLDAPSettingsGUI::deleteRules ( )

delete role assignment rule

public

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

References $_POST, $rule, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), roleAssignments(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

266  {
267  if (!is_array($_POST['rule_ids'])) {
268  ilUtil::sendFailure($this->lng->txt('select_once'));
269  $this->roleAssignments();
270  return false;
271  }
272  include_once('Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
273  foreach ($_POST["rule_ids"] as $rule_id) {
275  $rule->delete();
276  }
277  ilUtil::sendSuccess($this->lng->txt('ldap_deleted_rule'));
278  $this->roleAssignments();
279  return true;
280  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$rule
Definition: showstats.php:43
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
roleAssignments()
Edit role assignments.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteServerSettings()

ilLDAPSettingsGUI::deleteServerSettings ( )

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

References $_POST, array, ilUtil\sendFailure(), ilUtil\sendSuccess(), and serverList().

1561  {
1562  if (!is_array($_POST["server_ids"])) {
1563  ilUtil::sendFailure($this->lng->txt('select_one'));
1564  $this->serverList();
1565  return false;
1566  }
1567 
1568  foreach ((array) $_POST["server_ids"] as $server_id) {
1569  $setting = new ilLDAPServer($server_id);
1570  $setting->delete();
1571  }
1572  ilUtil::sendSuccess($this->lng->txt('deleted'));
1573 
1574  $this->serverList();
1575  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ editRoleAssignment()

ilLDAPSettingsGUI::editRoleAssignment ( )

Edit role assignment.

public

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

References $_GET, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), initFormRoleAssignments(), roleAssignments(), ilUtil\sendFailure(), setSubTabs(), and setValuesByArray().

131  {
132  if (!(int) $_GET['rule_id']) {
133  ilUtil::sendFailure($this->lng->txt('select_one'));
134  $this->roleAssignments();
135  return false;
136  }
137  $this->setSubTabs();
138  $this->tabs_gui->setTabActive('role_assignments');
139 
140  $this->ctrl->saveParameter($this, 'rule_id', (int) $_GET['rule_id']);
141  include_once('Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
143  'edit',
144  $this->role_mapping_rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId((int) $_GET['rule_id'])
145  );
146  $this->setValuesByArray();
147  $this->tpl->setContent($this->form->getHTML());
148  }
$_GET["client_id"]
setSubTabs()
Set sub tabs for ldap section.
setValuesByArray()
set values of form array
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
roleAssignments()
Edit role assignments.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initFormRoleAssignments($a_mode)
Init form table for new role assignments.
+ Here is the call graph for this function:

◆ editRoleMapping()

ilLDAPSettingsGUI::editRoleMapping ( )

Edit Assigments for role mapping.

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

References $_GET, and initRoleMappingForm().

1417  {
1418  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
1419  $mapping = new ilLDAPRoleGroupMappingSetting($_GET["mapping_id"]);
1420  $mapping->read();
1421 
1422  $propertie_form = $this->initRoleMappingForm("updateRoleMapping");
1423  $propertie_form->setTitle($this->lng->txt('ldap_edit_role_assignment'));
1424  $propertie_form->getItemByPostVar("url")->setValue($mapping->getURL());
1425  $propertie_form->getItemByPostVar("dn")->setValue($mapping->getDN());
1426  $propertie_form->getItemByPostVar("member")->setValue($mapping->getMemberAttribute());
1427  $propertie_form->getItemByPostVar("memberisdn")->setChecked($mapping->getMemberISDN());
1428  $propertie_form->getItemByPostVar("role")->setValue($mapping->getRoleName());
1429  $propertie_form->getItemByPostVar("info")->setValue($mapping->getMappingInfo());
1430  $propertie_form->getItemByPostVar("info_type")->setChecked($mapping->getMappingInfoType());
1431 
1432  $this->tpl->setContent($propertie_form->getHTML());
1433  }
$_GET["client_id"]
initRoleMappingForm($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 1513 of file class.ilLDAPSettingsGUI.php.

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

1514  {
1515  $this->setSubTabs();
1516  $this->tabs_gui->setTabActive('settings');
1517 
1518  $this->initForm();
1519  $this->setServerFormValues();
1520  return $this->tpl->setContent($this->form_gui->getHtml());
1521  }
setSubTabs()
Set sub tabs for ldap section.
+ Here is the call graph for this function:

◆ executeCommand()

ilLDAPSettingsGUI::executeCommand ( )

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

References $ilCtrl, $ilErr, and ilUtil\sendFailure().

61  {
62  global $ilAccess,$ilias, $ilErr, $ilCtrl;
63 
64  $next_class = $this->ctrl->getNextClass($this);
65  $cmd = $this->ctrl->getCmd();
66 
67  if (!$ilAccess->checkAccess('write', '', $this->ref_id) && $cmd != "serverList") {
68  ilUtil::sendFailure($this->lng->txt('msg_no_perm_write'), true);
69  $ilCtrl->redirect($this, "serverList");
70  }
71 
72 
73  switch ($next_class) {
74  default:
75  if (!$cmd) {
76  $cmd = "serverList";
77  }
78  $this->$cmd();
79  break;
80  }
81  return true;
82  }
global $ilErr
Definition: raiseError.php:16
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ getMappingFields()

ilLDAPSettingsGUI::getMappingFields ( )
private

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

References array.

Referenced by initUserMappingForm(), and saveMapping().

1073  {
1074  return array('gender' => $this->lng->txt('gender'),
1075  'firstname' => $this->lng->txt('firstname'),
1076  'lastname' => $this->lng->txt('lastname'),
1077  'title' => $this->lng->txt('person_title'),
1078  'institution' => $this->lng->txt('institution'),
1079  'department' => $this->lng->txt('department'),
1080  'street' => $this->lng->txt('street'),
1081  'city' => $this->lng->txt('city'),
1082  'zipcode' => $this->lng->txt('zipcode'),
1083  'country' => $this->lng->txt('country'),
1084  'phone_office' => $this->lng->txt('phone_office'),
1085  'phone_home' => $this->lng->txt('phone_home'),
1086  'phone_mobile' => $this->lng->txt('phone_mobile'),
1087  'fax' => $this->lng->txt('fax'),
1088  'email' => $this->lng->txt('email'),
1089  'hobby' => $this->lng->txt('hobby'),
1090  'matriculation' => $this->lng->txt('matriculation'));
1091  #'photo' => $this->lng->txt('photo'));
1092  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getRoleAssignmentTable()

ilLDAPSettingsGUI::getRoleAssignmentTable ( )
protected

Show active role assignments.

Returns

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

References ilLDAPRoleAssignmentRule\_getRules().

Referenced by addRoleAssignment().

445  {
446  if (count($rules = ilLDAPRoleAssignmentRule::_getRules($this->server->getServerId()))) {
447  include_once("./Services/LDAP/classes/class.ilLDAPRoleAssignmentTableGUI.php");
448  $table_gui = new ilLDAPRoleAssignmentTableGUI($this, 'roleAssignments');
449  $table_gui->setTitle($this->lng->txt("ldap_tbl_role_ass"));
450  $table_gui->parse($rules);
451  $table_gui->addMultiCommand("confirmDeleteRules", $this->lng->txt("delete"));
452  $table_gui->setSelectAllCheckbox("rule_id");
453  return $table_gui->getHTML();
454  }
455  return '';
456  }
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.

Returns
ilLDAPServer

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

References $server.

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

89  {
90  return $this->server;
91  }
+ Here is the caller graph for this function:

◆ hasActiveRoleAssignmentPlugins()

ilLDAPSettingsGUI::hasActiveRoleAssignmentPlugins ( )
private

Check if the plugin is active.

Returns

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

References IL_COMP_SERVICE.

Referenced by initFormRoleAssignments().

1265  {
1266  global $ilPluginAdmin;
1267 
1268  return count($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, 'LDAP', 'ldaphk')) ? true : false;
1269  }
const IL_COMP_SERVICE
+ Here is the caller graph for this function:

◆ initAttributeMapping()

ilLDAPSettingsGUI::initAttributeMapping ( )
private

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

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

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

999  {
1000  include_once './Services/LDAP/classes/class.ilLDAPAttributeMapping.php';
1001  $this->mapping = ilLDAPAttributeMapping::_getInstanceByServerId($this->getServer()->getServerId());
1002  }
static _getInstanceByServerId($a_server_id)
Get instance of class.
getServer()
Get server settings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilLDAPSettingsGUI::initForm ( )
private

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

References $_GET, $binding, $pass, $version, ilAdministrationSettingsFormHandler\addFieldsToForm(), ilSubEnabledFormPropertyGUI\addSubItem(), ilRadioOption\addSubItem(), array, ilAdministrationSettingsFormHandler\FORM_LDAP, ilAdministrationSettingsFormHandler\getSettingsGUIInstance(), IL_LDAP_BIND_ANONYMOUS, IL_LDAP_BIND_USER, IL_LDAP_SCOPE_ONE, IL_LDAP_SCOPE_SUB, prepareRoleSelect(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilCheckboxInputGUI\setOptionTitle(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilCheckboxInputGUI\setValue().

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

652  {
653  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
654 
655  $this->form_gui = new ilPropertyFormGUI();
656  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
657  $this->form_gui->setTitle($this->lng->txt('ldap_configure'));
658 
659  $active = new ilCheckboxInputGUI($this->lng->txt('auth_ldap_enable'), 'active');
660  $active->setValue(1);
661  $this->form_gui->addItem($active);
662 
663  $ds = new ilCheckboxInputGUI($this->lng->txt('ldap_as_ds'), 'ds');
664  $ds->setValue(1);
665  $ds->setInfo($this->lng->txt('ldap_as_ds_info'));
666  $this->form_gui->addItem($ds);
667 
668  $servername = new ilTextInputGUI($this->lng->txt('ldap_server_name'), 'server_name');
669  $servername->setRequired(true);
670  $servername->setInfo($this->lng->txt('ldap_server_name_info'));
671  $servername->setSize(32);
672  $servername->setMaxLength(32);
673  $this->form_gui->addItem($servername);
674 
675  // start Patch Name Filter
676  $namefilter = new ilTextInputGUI($this->lng->txt('ldap_username_filter'), "name_filter");//ADD LANG VAR
677  $namefilter->setInfo($this->lng->txt("ldap_username_filter_info"));
678  $namefilter->setSize(64);
679  $namefilter->setMaxLength(255);
680  $this->form_gui->addItem($namefilter);
681  // end Patch Name Filter
682 
683  $serverurl = new ilTextInputGUI($this->lng->txt('ldap_server'), 'server_url');
684  $serverurl->setRequired(true);
685  $serverurl->setInfo($this->lng->txt('ldap_server_url_info'));
686  $serverurl->setSize(64);
687  $serverurl->setMaxLength(255);
688  $this->form_gui->addItem($serverurl);
689 
690  $version = new ilSelectInputGUI($this->lng->txt('ldap_version'), 'version');
691  $version->setOptions(array(2 => 2, 3 => 3));
692  $version->setInfo($this->lng->txt('ldap_server_version_info'));
693  $this->form_gui->addItem($version);
694 
695  $basedsn = new ilTextInputGUI($this->lng->txt('basedn'), 'base_dn');
696  $basedsn->setRequired(true);
697  $basedsn->setSize(64);
698  $basedsn->setMaxLength(255);
699  $this->form_gui->addItem($basedsn);
700 
701  $referrals = new ilCheckboxInputGUI($this->lng->txt('ldap_referrals'), 'referrals');
702  $referrals->setValue(1);
703  $referrals->setInfo($this->lng->txt('ldap_referrals_info'));
704  $this->form_gui->addItem($referrals);
705 
706  $section_security = new ilFormSectionHeaderGUI();
707  $section_security->setTitle($this->lng->txt('ldap_server_security_settings'));
708  $this->form_gui->addItem($section_security);
709 
710  $tls = new ilCheckboxInputGUI($this->lng->txt('ldap_tls'), 'tls');
711  $tls->setValue(1);
712  $this->form_gui->addItem($tls);
713 
714  $binding = new ilRadioGroupInputGUI($this->lng->txt('ldap_server_binding'), 'binding_type');
715  $anonymous = new ilRadioOption($this->lng->txt('ldap_bind_anonymous'), IL_LDAP_BIND_ANONYMOUS);
716  $binding->addOption($anonymous);
717  $user = new ilRadioOption($this->lng->txt('ldap_bind_user'), IL_LDAP_BIND_USER);
718  $dn = new ilTextInputGUI($this->lng->txt('ldap_server_bind_dn'), 'bind_dn');
719  $dn->setSize(64);
720  $dn->setMaxLength(255);
721  $user->addSubItem($dn);
722  $pass = new ilPasswordInputGUI($this->lng->txt('ldap_server_bind_pass'), 'bind_pass');
723  $pass->setSkipSyntaxCheck(true);
724  $pass->setSize(12);
725  $pass->setMaxLength(36);
726  $user->addSubItem($pass);
727  $binding->addOption($user);
728  $this->form_gui->addItem($binding);
729 
730  $section_auth = new ilFormSectionHeaderGUI();
731  $section_auth->setTitle($this->lng->txt('ldap_authentication_settings'));
732  $this->form_gui->addItem($section_auth);
733 
734  $search_base = new ilTextInputGUI($this->lng->txt('ldap_user_dn'), 'search_base');
735  $search_base->setInfo($this->lng->txt('ldap_search_base_info'));
736  $search_base->setSize(64);
737  $search_base->setMaxLength(255);
738  $this->form_gui->addItem($search_base);
739 
740  $user_scope = new ilSelectInputGUI($this->lng->txt('ldap_user_scope'), 'user_scope');
741  $user_scope->setOptions(array(IL_LDAP_SCOPE_ONE => $this->lng->txt('ldap_scope_one'),
742  IL_LDAP_SCOPE_SUB => $this->lng->txt('ldap_scope_sub')));
743  $user_scope->setInfo($this->lng->txt('ldap_user_scope_info'));
744  $this->form_gui->addItem($user_scope);
745 
746  $user_attribute = new ilTextInputGUI($this->lng->txt('ldap_user_attribute'), 'user_attribute');
747  $user_attribute->setSize(16);
748  $user_attribute->setMaxLength(64);
749  $user_attribute->setRequired(true);
750  $this->form_gui->addItem($user_attribute);
751 
752  $filter = new ilTextInputGUI($this->lng->txt('ldap_search_filter'), 'filter');
753  $filter->setInfo($this->lng->txt('ldap_filter_info'));
754  $filter->setSize(64);
755  $filter->setMaxLength(512);
756  $this->form_gui->addItem($filter);
757 
758  $section_restrictions = new ilFormSectionHeaderGUI();
759  $section_restrictions->setTitle($this->lng->txt('ldap_group_restrictions'));
760  $this->form_gui->addItem($section_restrictions);
761 
762  $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_search_base'), 'group_dn');
763  $group_dn->setInfo($this->lng->txt('ldap_group_dn_info'));
764  $group_dn->setSize(64);
765  $group_dn->setMaxLength(255);
766  $this->form_gui->addItem($group_dn);
767 
768  $group_scope = new ilSelectInputGUI($this->lng->txt('ldap_group_scope'), 'group_scope');
769  $group_scope->setOptions(array(IL_LDAP_SCOPE_ONE => $this->lng->txt('ldap_scope_one'),
770  IL_LDAP_SCOPE_SUB => $this->lng->txt('ldap_scope_sub')));
771  $group_scope->setInfo($this->lng->txt('ldap_group_scope_info'));
772  $this->form_gui->addItem($group_scope);
773 
774  $group_filter = new ilTextInputGUI($this->lng->txt('ldap_group_filter'), 'group_filter');
775  $group_filter->setInfo($this->lng->txt('ldap_group_filter_info'));
776  $group_filter->setSize(64);
777  $group_filter->setMaxLength(255);
778  $this->form_gui->addItem($group_filter);
779 
780  $group_member = new ilTextInputGUI($this->lng->txt('ldap_group_member'), 'group_member');
781  $group_member->setInfo($this->lng->txt('ldap_group_member_info'));
782  $group_member->setSize(32);
783  $group_member->setMaxLength(255);
784  $this->form_gui->addItem($group_member);
785 
786 
787  $group_member_isdn = new ilCheckboxInputGUI($this->lng->txt('ldap_memberisdn'), 'memberisdn');
788  #$group_member_isdn->setInfo($this->lng->txt('ldap_group_member_info'));
789  $this->form_gui->addItem($group_member_isdn);
790  #$group_member->addSubItem($group_member_isdn);
791 
792  $group = new ilTextInputGUI($this->lng->txt('ldap_group_name'), 'group');
793  $group->setInfo($this->lng->txt('ldap_group_name_info'));
794  $group->setSize(32);
795  $group->setMaxLength(255);
796  $this->form_gui->addItem($group);
797 
798  $group_atrr = new ilTextInputGUI($this->lng->txt('ldap_group_attribute'), 'group_attribute');
799  $group_atrr->setInfo($this->lng->txt('ldap_group_attribute_info'));
800  $group_atrr->setSize(16);
801  $group_atrr->setMaxLength(64);
802  $this->form_gui->addItem($group_atrr);
803 
804  $group_optional = new ilCheckboxInputGUI($this->lng->txt('ldap_group_membership'), 'group_optional');
805  $group_optional->setOptionTitle($this->lng->txt('ldap_group_member_optional'));
806  $group_optional->setInfo($this->lng->txt('ldap_group_optional_info'));
807  $group_optional->setValue(1);
808  $group_user_filter = new ilTextInputGUI($this->lng->txt('ldap_group_user_filter'), 'group_user_filter');
809  $group_user_filter->setSize(64);
810  $group_user_filter->setMaxLength(255);
811  $group_optional->addSubItem($group_user_filter);
812  $this->form_gui->addItem($group_optional);
813 
814  $section_sync = new ilFormSectionHeaderGUI();
815  $section_sync->setTitle($this->lng->txt('ldap_user_sync'));
816  $this->form_gui->addItem($section_sync);
817 
818  $ci_gui = new ilCustomInputGUI($this->lng->txt('ldap_moment_sync'));
819  $sync_on_login = new ilCheckboxInputGUI($this->lng->txt('ldap_sync_login'), 'sync_on_login');
820  $sync_on_login->setValue(1);
821  $ci_gui->addSubItem($sync_on_login);
822  $sync_per_cron = new ilCheckboxInputGUI($this->lng->txt('ldap_sync_cron'), 'sync_per_cron');
823  $sync_per_cron->setValue(1);
824  $ci_gui->addSubItem($sync_per_cron);
825  $ci_gui->setInfo($this->lng->txt('ldap_user_sync_info'));
826  $this->form_gui->addItem($ci_gui);
827 
828  $global_role = new ilSelectInputGUI($this->lng->txt('ldap_global_role_assignment'), 'global_role');
829  $global_role->setOptions($this->prepareRoleSelect(false));
830  $global_role->setInfo($this->lng->txt('ldap_global_role_info'));
831  $this->form_gui->addItem($global_role);
832 
833  $migr = new ilCheckboxInputGUI($this->lng->txt('auth_ldap_migration'), 'migration');
834  $migr->setInfo($this->lng->txt('auth_ldap_migration_info'));
835  $migr->setValue(1);
836  $this->form_gui->addItem($migr);
837 
838 
839  include_once "Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
842  $this->form_gui,
844  );
845 
846 
847  $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
848  if ($_GET["cmd"] == "addServerSettings") {
849  $this->form_gui->addCommandButton('serverList', $this->lng->txt('cancel'));
850  }
851  }
This class represents an option in a radio group.
const IL_LDAP_BIND_USER
This class represents a selection list property in a property form.
This class represents a property form user interface.
$_GET["client_id"]
This class represents a section header in a property form.
const IL_LDAP_BIND_ANONYMOUS
const IL_LDAP_SCOPE_SUB
This class represents a checkbox property in a property form.
prepareRoleSelect($a_as_select=true)
Used for old style table.
static addFieldsToForm($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
setValue($a_value)
Set Value.
setSize($a_size)
Set Size.
const IL_LDAP_SCOPE_ONE
This class represents a text property in a property form.
This class represents a password property in a property form.
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
This class represents a custom property in a property form.
setOptionTitle($a_optiontitle)
Set Option Title (optional).
$binding
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormRoleAssignments()

ilLDAPSettingsGUI::initFormRoleAssignments (   $a_mode)
protected

Init form table for new role assignments.

Parameters
stringmode edit | create
objectobject of ilLDAPRoleAsssignmentRule protected

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

References $id, $name, ilRadioOption\addSubItem(), hasActiveRoleAssignmentPlugins(), prepareGlobalRoleSelection(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), ilNonEditableValueGUI\setValue(), ilLDAPRoleAssignmentRule\TYPE_ATTRIBUTE, and ilLDAPRoleAssignmentRule\TYPE_GROUP.

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

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

◆ initRoleMapping()

ilLDAPSettingsGUI::initRoleMapping ( )
private

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

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

Referenced by deleteRoleMapping().

1005  {
1006  include_once './Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php';
1007  $this->role_mapping = ilLDAPRoleGroupMappingSettings::_getInstanceByServerId($this->getServer()->getServerId());
1008  }
getServer()
Get server settings.
static _getInstanceByServerId($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 (   $command)
private

init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile

Parameters
string$commandcommand methode
Returns

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

References $_GET, $info, $url, ilFormPropertyGUI\setPostVar(), and setSubTabs().

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

1618  {
1619  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1620  $this->setSubTabs();
1621  $this->tabs_gui->setTabActive('role_mapping');
1622 
1623  if (isset($_GET["mapping_id"])) {
1624  $this->ctrl->setParameter($this, 'mapping_id', $_GET["mapping_id"]);
1625  }
1626 
1627  $propertie_form = new ilPropertyFormGUI();
1628  $propertie_form->setTitle($this->lng->txt('ldap_mapping_table'));
1629  $propertie_form->setFormAction($this->ctrl->getFormAction($this, $command));
1630  $propertie_form->addCommandButton($command, $this->lng->txt('save'));
1631  $propertie_form->addCommandButton("roleMapping", $this->lng->txt('cancel'));
1632 
1633  $url = new ilTextInputGUI($this->lng->txt('ldap_server'));
1634  $url->setPostVar("url");
1635  $url->setSize(50);
1636  $url->setMaxLength(255);
1637  $url->setRequired(true);
1638 
1639  $group_dn = new ilTextInputGUI($this->lng->txt('ldap_group_dn'));
1640  $group_dn->setPostVar("dn");
1641  $group_dn->setSize(50);
1642  $group_dn->setMaxLength(255);
1643  $group_dn->setInfo($this->lng->txt('ldap_dn_info'));
1644  $group_dn->setRequired(true);
1645 
1646  $member = new ilTextInputGUI($this->lng->txt('ldap_group_member'));
1647  $member->setPostVar("member");
1648  $member->setSize(32);
1649  $member->setMaxLength(255);
1650  $member->setInfo($this->lng->txt('ldap_member_info'));
1651  $member->setRequired(true);
1652 
1653  $member_isdn = new ilCheckboxInputGUI("");
1654  $member_isdn->setPostVar("memberisdn");
1655  $member_isdn->setOptionTitle($this->lng->txt('ldap_memberisdn'));
1656 
1657  $role = new ilTextInputGUI($this->lng->txt('ldap_ilias_role'));
1658  $role->setPostVar("role");
1659  $role->setSize(32);
1660  $role->setMaxLength(255);
1661  $role->setInfo($this->lng->txt('ldap_role_info'));
1662  $role->setRequired(true);
1663 
1664  $info = new ilTextAreaInputGUI($this->lng->txt('ldap_info_text'));
1665  $info->setPostVar("info");
1666  $info->setCols(50);
1667  $info->setRows(3);
1668  $info->setInfo($this->lng->txt('ldap_info_text_info'));
1669 
1670  $info_type = new ilCheckboxInputGUI("");
1671  $info_type->setPostVar("info_type");
1672  $info_type->setOptionTitle($this->lng->txt('ldap_mapping_info_type'));
1673 
1674  $propertie_form->addItem($url);
1675  $propertie_form->addItem($group_dn);
1676  $propertie_form->addItem($member);
1677  $propertie_form->addItem($member_isdn);
1678  $propertie_form->addItem($role);
1679  $propertie_form->addItem($info);
1680  $propertie_form->addItem($info_type);
1681 
1682  return $propertie_form;
1683  }
This class represents a property form user interface.
$_GET["client_id"]
setPostVar($a_postvar)
Set Post Variable.
This class represents a checkbox property in a property form.
setSubTabs()
Set sub tabs for ldap section.
This class represents a text property in a property form.
This class represents a text area property in a property form.
$url
$info
Definition: index.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initServer()

ilLDAPSettingsGUI::initServer ( )
private

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

Referenced by __construct().

990  {
991  include_once './Services/LDAP/classes/class.ilLDAPServer.php';
992  if (!$_REQUEST['ldap_server_id']) {
993  $_REQUEST['ldap_server_id'] = 0;
994  }
995  $this->server = new ilLDAPServer((int) $_REQUEST['ldap_server_id']);
996  }
+ Here is the caller graph for this function:

◆ initUserDefinedFields()

ilLDAPSettingsGUI::initUserDefinedFields ( )
private

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

References ilUserDefinedFields\_getInstance().

Referenced by initUserMappingForm(), and saveMapping().

1095  {
1096  include_once("./Services/User/classes/class.ilUserDefinedFields.php");
1097  $this->udf = ilUserDefinedFields::_getInstance();
1098  }
static _getInstance()
Get instance.
+ 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.

Returns

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

References $lang, getMappingFields(), and initUserDefinedFields().

Referenced by userMapping().

1314  {
1315  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1316  $propertie_form = new ilPropertyFormGUI();
1317  $propertie_form->setTitle($this->lng->txt('ldap_mapping_table'));
1318  $propertie_form->setFormAction($this->ctrl->getFormAction($this, 'saveMapping'));
1319  $propertie_form->addCommandButton('saveMapping', $this->lng->txt('save'));
1320 
1321  foreach ($this->getMappingFields() as $mapping => $lang) {
1322  $text_form = new ilTextInputGUI($lang);
1323  $text_form->setPostVar($mapping . "_value");
1324  $text_form->setValue($this->mapping->getValue($mapping));
1325  $text_form->setSize(32);
1326  $text_form->setMaxLength(255);
1327  $propertie_form->addItem($text_form);
1328 
1329  $checkbox_form = new ilCheckboxInputGUI("");
1330  $checkbox_form->setPostVar($mapping . "_update");
1331  $checkbox_form->setChecked($this->mapping->enabledUpdate($mapping));
1332  $checkbox_form->setOptionTitle($this->lng->txt('ldap_update_field_info'));
1333  $propertie_form->addItem($checkbox_form);
1334  }
1335 
1336  $this->initUserDefinedFields();
1337  foreach ($this->udf->getDefinitions() as $definition) {
1338  $text_form = new ilTextInputGUI($definition['field_name']);
1339  $text_form->setPostVar('udf_' . $definition['field_id'] . '_value');
1340  $text_form->setValue($this->mapping->getValue('udf_' . $definition['field_id']));
1341  $text_form->setSize(32);
1342  $text_form->setMaxLength(255);
1343  $propertie_form->addItem($text_form);
1344 
1345  $checkbox_form = new ilCheckboxInputGUI("");
1346  $checkbox_form->setPostVar('udf_' . $definition['field_id'] . '_update');
1347  $checkbox_form->setChecked($this->mapping->enabledUpdate('udf_' . $definition['field_id']));
1348  $checkbox_form->setOptionTitle($this->lng->txt('ldap_update_field_info'));
1349  $propertie_form->addItem($checkbox_form);
1350  }
1351 
1352  return $propertie_form;
1353  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
This class represents a text property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadMappingDetails()

ilLDAPSettingsGUI::loadMappingDetails ( )
private

Load info about hide/show details.

private

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

References $_GET, $_SESSION, and array.

1116  {
1117  if (!isset($_SESSION['ldap_mapping_details'])) {
1118  $_SESSION['ldap_mapping_details'] = array();
1119  }
1120  if (isset($_GET['details_show'])) {
1121  $_SESSION['ldap_mapping_details'][$_GET['details_show']] = $_GET['details_show'];
1122  }
1123  if (isset($_GET['details_hide'])) {
1124  unset($_SESSION['ldap_mapping_details'][$_GET['details_hide']]);
1125  }
1126  }
$_SESSION["AccountId"]
$_GET["client_id"]
Create styles array
The data for the language used.

◆ loadRoleAssignmentRule()

ilLDAPSettingsGUI::loadRoleAssignmentRule (   $a_rule_id,
  $a_from_form = true 
)
protected

Load input from form.

Returns
Parameters
object$a_rule_id

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

References $_SESSION, $parser, $res, ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), array, getServer(), QP_COMBINATION_AND, and ilUtil\stripSlashes().

Referenced by checkRoleAssignmentInput(), and saveRoleSelection().

465  {
466  if (is_object($this->rule)) {
467  return true;
468  }
469 
470  include_once './Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php';
471  $this->rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId($a_rule_id);
472 
473 
474  if ($a_from_form) {
475  if ($this->form->getInput('role_name') == 0) {
476  $this->rule->setRoleId($this->form->getInput('role_id'));
477  } elseif ($this->form->getInput('role_search')) {
478  // Search role
479  include_once './Services/Search/classes/class.ilQueryParser.php';
480 
481  $parser = new ilQueryParser('"' . $this->form->getInput('role_search') . '"');
482 
483  // TODO: Handle minWordLength
484  $parser->setMinWordLength(1, true);
485  $parser->setCombination(QP_COMBINATION_AND);
486  $parser->parse();
487 
488  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
489  $object_search = new ilLikeObjectSearch($parser);
490  $object_search->setFilter(array('role'));
491  $res = $object_search->performSearch();
492 
493  $entries = $res->getEntries();
494  if (count($entries) == 1) {
495  $role = current($entries);
496  $this->rule->setRoleId($role['obj_id']);
497  } elseif (count($entries) > 1) {
498  $this->rule->setRoleId(-1);
499  }
500  }
501 
502  $this->rule->setAttributeName($this->form->getInput('name'));
503  $this->rule->setAttributeValue($this->form->getInput('value'));
504  $this->rule->setDN($this->form->getInput('dn'));
505  $this->rule->setMemberAttribute($this->form->getInput('at'));
506  $this->rule->setMemberIsDN($this->form->getInput('isdn'));
507  $this->rule->enableAddOnUpdate($this->form->getInput('add_missing'));
508  $this->rule->enableRemoveOnUpdate($this->form->getInput('remove_deprecated'));
509  $this->rule->setPluginId($this->form->getInput('plugin_id'));
510  $this->rule->setType($this->form->getInput('type'));
511  $this->rule->setServerId($this->getServer()->getServerId());
512  return true;
513  }
514 
515  // LOAD from session
516  $this->rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId($a_rule_id);
517  $this->rule->setServerId($this->getServer()->getServerId());
518  $this->rule->enableAddOnUpdate((int) $_SESSION['ldap_role_ass']['add_on_update']);
519  $this->rule->enableRemoveOnUpdate((int) $_SESSION['ldap_role_ass']['remove_on_update']);
520  $this->rule->setType(ilUtil::stripSlashes($_SESSION['ldap_role_ass']['type']));
521  $this->rule->setDN(ilUtil::stripSlashes($_SESSION['ldap_role_ass']['dn']));
522  $this->rule->setMemberAttribute(ilUtil::stripSlashes($_SESSION['ldap_role_ass']['at']));
523  $this->rule->setMemberIsDN(ilUtil::stripSlashes($_SESSION['ldap_role_ass']['isdn']));
524  $this->rule->setAttributeName(ilUtil::stripSlashes($_SESSION['ldap_role_ass']['name']));
525  $this->rule->setAttributeValue(ilUtil::stripSlashes($_SESSION['ldap_role_ass']['value']));
526  $this->rule->setPluginId(ilUtil::stripSlashes($_SESSION['ldap_role_ass']['plugin']));
527  return true;
528  }
$_SESSION["AccountId"]
getServer()
Get server settings.
foreach($_POST as $key=> $value) $res
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
$parser
Definition: BPMN2Parser.php:23
const QP_COMBINATION_AND
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareGlobalRoleSelection()

ilLDAPSettingsGUI::prepareGlobalRoleSelection (   $a_as_select = true)
private

New implementation for InputForm.

Returns
Parameters
object$a_as_select,[optional]

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

References ilObject\_lookupTitle(), and ilUtil\_sortIds().

Referenced by initFormRoleAssignments().

1016  {
1017  global $rbacreview,$ilObjDataCache;
1018 
1019  $global_roles = ilUtil::_sortIds(
1020  $rbacreview->getGlobalRoles(),
1021  'object_data',
1022  'title',
1023  'obj_id'
1024  );
1025 
1026  $select[0] = $this->lng->txt('links_select_one');
1027  foreach ($global_roles as $role_id) {
1028  $select[$role_id] = ilObject::_lookupTitle($role_id);
1029  }
1030  return $select;
1031  }
static _lookupTitle($a_id)
lookup object title
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,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 1100 of file class.ilLDAPSettingsGUI.php.

References $_POST, array, and ilUtil\formSelect().

1101  {
1102  return ilUtil::formSelect($_POST['mapping_template'], 'mapping_template', array(0 => $this->lng->txt('ldap_mapping_template'),
1103  "inetOrgPerson" => 'inetOrgPerson',
1104  "organizationalPerson" => 'organizationalPerson',
1105  "person" => 'person',
1106  "ad_2003" => 'Active Directory (Win 2003)'), false, true);
1107  }
Create styles array
The data for the language used.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
$_POST["username"]
+ Here is the call graph for this function:

◆ prepareRoleSelect()

ilLDAPSettingsGUI::prepareRoleSelect (   $a_as_select = true)
private

Used for old style table.

Deprecated:
Returns
Parameters
object$a_as_select,[optional]

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

References ilLDAPAttributeMapping\_lookupGlobalRole(), ilObject\_lookupTitle(), ilUtil\_sortIds(), and ilUtil\formSelect().

Referenced by initForm().

1041  {
1042  global $rbacreview,$ilObjDataCache;
1043 
1044  include_once('./Services/LDAP/classes/class.ilLDAPAttributeMapping.php');
1045 
1046  $global_roles = ilUtil::_sortIds(
1047  $rbacreview->getGlobalRoles(),
1048  'object_data',
1049  'title',
1050  'obj_id'
1051  );
1052 
1053  $select[0] = $this->lng->txt('links_select_one');
1054  foreach ($global_roles as $role_id) {
1055  $select[$role_id] = ilObject::_lookupTitle($role_id);
1056  }
1057 
1058  if ($a_as_select) {
1059  return ilUtil::formSelect(
1060  ilLDAPAttributeMapping::_lookupGlobalRole($this->server->getServerId()),
1061  'global_role',
1062  $select,
1063  false,
1064  true
1065  );
1066  } else {
1067  return $select;
1068  }
1069  }
static _lookupGlobalRole($a_server_id)
Lookup global role assignment.
static _lookupTitle($a_id)
lookup object title
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roleAssignments()

ilLDAPSettingsGUI::roleAssignments ( )

Edit role assignments.

public

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

References ilLDAPRoleAssignmentRule\_getInstanceByRuleId(), ilLDAPRoleAssignmentRule\_getRules(), initFormRoleAssignments(), and setSubTabs().

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

100  {
101  global $rbacreview;
102 
103  $this->setSubTabs();
104  $this->tabs_gui->setTabActive('role_assignments');
105 
106  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ldap_role_assignments.html', 'Services/LDAP');
107 
108  include_once('Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
109  $this->initFormRoleAssignments('create', $this->role_mapping_rule = ilLDAPRoleAssignmentRule::_getInstanceByRuleId(0));
110  $this->tpl->setVariable('NEW_ASSIGNMENT_TBL', $this->form->getHTML());
111 
112 
113  if (count($rules = ilLDAPRoleAssignmentRule::_getRules($this->server->getServerId()))) {
114  include_once("./Services/LDAP/classes/class.ilLDAPRoleAssignmentTableGUI.php");
115  $table_gui = new ilLDAPRoleAssignmentTableGUI($this, 'roleAssignments');
116  $table_gui->setTitle($this->lng->txt("ldap_tbl_role_ass"));
117  $table_gui->parse($rules);
118  $table_gui->addMultiCommand("confirmDeleteRules", $this->lng->txt("delete"));
119  $table_gui->setSelectAllCheckbox("rule_id");
120  $this->tpl->setVariable('RULES_TBL', $table_gui->getHTML());
121  }
122  }
setSubTabs()
Set sub tabs for ldap section.
static _getRules($a_server_id)
Get all rules.
static _getInstanceByRuleId($a_rule_id)
get instance by rule id
initFormRoleAssignments($a_mode)
Init form table for new role assignments.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roleMapping()

ilLDAPSettingsGUI::roleMapping ( )

Role Mapping Tab ilToolbarGUI $ilToolbar.

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

References $binding, $pass, ilLDAPRoleGroupMappingSettings\_getInstanceByServerId(), ilFormPropertyGUI\setPostVar(), setSubTabs(), and ilTable2GUI\setTitle().

Referenced by deleteRoleMapping().

1360  {
1361  global $ilToolbar;
1362  $this->setSubTabs();
1363  $this->tabs_gui->setTabActive('role_mapping');
1364  $ilToolbar->addButton(
1365  $this->lng->txt("ldap_new_role_assignment"),
1366  $this->ctrl->getLinkTarget($this, 'addRoleMapping')
1367  );
1368  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1369 
1370  //Set propertyform for synchronization settings
1371  include_once("./Services/Form/classes/class.ilCombinationInputGUI.php");
1372  $propertie_form = new ilPropertyFormGUI();
1373  $propertie_form->setTitle($this->lng->txt('ldap_role_settings'));
1374  $propertie_form->setFormAction($this->ctrl->getFormAction($this, "saveSyncronizationSettings"));
1375  $propertie_form->addCommandButton("saveSyncronizationSettings", $this->lng->txt('save'));
1376  $role_active = new ilCheckboxInputGUI($this->lng->txt('ldap_role_active'));
1377  $role_active->setPostVar('role_sync_active');
1378  $role_active->setChecked($this->server->enabledRoleSynchronization() ? true : false);
1379  $propertie_form->addItem($role_active);
1380  $binding = new ilCombinationInputGUI($this->lng->txt('ldap_server_binding'));
1381  $binding->setInfo($this->lng->txt('ldap_role_bind_user_info'));
1382  $user = new ilTextInputGUI("");
1383  $user->setPostVar("role_bind_user");
1384  $user->setValue($this->server->getRoleBindDN());
1385  $user->setSize(50);
1386  $user->setMaxLength(255);
1387  $binding->addCombinationItem(0, $user, $this->lng->txt('ldap_role_bind_user'));
1388  $pass = new ilPasswordInputGUI("");
1389  $pass->setPostVar("role_bind_pass");
1390  $pass->setValue($this->server->getRoleBindPassword());
1391  $pass->setSize(12);
1392  $pass->setMaxLength(36);
1393  $pass->setRetype(false);
1394  $binding->addCombinationItem(1, $pass, $this->lng->txt('ldap_role_bind_pass'));
1395  $propertie_form->addItem($binding);
1396 
1397  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ldap_role_mappings.html', 'Services/LDAP');
1398  $this->tpl->setVariable("NEW_ASSIGNMENT_TBL", $propertie_form->getHTML());
1399 
1400  //Set Group Assignments Table if mappings exist
1401  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php');
1402  $mapping_instance = ilLDAPRoleGroupMappingSettings::_getInstanceByServerId($this->server->getServerId());
1403  $mappings = $mapping_instance->getMappings();
1404  if (count($mappings)) {
1405  include_once("./Services/LDAP/classes/class.ilLDAPRoleMappingTableGUI.php");
1406  $table_gui = new ilLDAPRoleMappingTableGUI($this, $this->server->getServerId());
1407  $table_gui->setTitle($this->lng->txt('ldap_role_group_assignments'));
1408  $table_gui->setData($mappings);
1409  $this->tpl->setVariable("RULES_TBL", $table_gui->getHTML());
1410  }
1411  }
This class represents a property form user interface.
setPostVar($a_postvar)
Set Post Variable.
This class represents a checkbox property in a property form.
setSubTabs()
Set sub tabs for ldap section.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static _getInstanceByServerId($a_server_id)
Get instance of class.
This class represents a text property in a property form.
This class represents a password property in a property form.
This class represents a number property in a property form.
$binding
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roleSelection()

ilLDAPSettingsGUI::roleSelection ( )
protected
Returns

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

References $_SESSION, and getServer().

Referenced by addRoleAssignment(), and updateRoleAssignment().

332  {
333  if ($this->rule->getRoleId() > 0) {
334  return false;
335  }
336  $_SESSION['ldap_role_ass']['server_id'] = $this->getServer()->getServerId();
337  $_SESSION['ldap_role_ass']['rule_id'] = $_REQUEST['rule_id'] ? $_REQUEST['rule_id'] : 0;
338  $_SESSION['ldap_role_ass']['role_search'] = $this->form->getInput('role_search');
339  $_SESSION['ldap_role_ass']['add_on_update'] = $this->form->getInput('add_missing');
340  $_SESSION['ldap_role_ass']['remove_on_update'] = $this->form->getInput('remove_deprecated');
341  $_SESSION['ldap_role_ass']['type'] = $this->form->getInput('type');
342  $_SESSION['ldap_role_ass']['dn'] = $this->form->getInput('dn');
343  $_SESSION['ldap_role_ass']['at'] = $this->form->getInput('at');
344  $_SESSION['ldap_role_ass']['isdn'] = $this->form->getInput('isdn');
345  $_SESSION['ldap_role_ass']['name'] = $this->form->getInput('name');
346  $_SESSION['ldap_role_ass']['value'] = $this->form->getInput('value');
347  $_SESSION['ldap_role_ass']['plugin'] = $this->form->getInput('plugin_id');
348 
349 
350  $this->ctrl->saveParameter($this, 'rule_id');
351  $this->ctrl->redirect($this, 'showRoleSelection');
352  }
$_SESSION["AccountId"]
getServer()
Get server settings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilLDAPSettingsGUI::save ( )

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

References $ilErr, initAttributeMapping(), initForm(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and setSubTabs().

857  {
858  global $ilErr;
859 
860  $this->setSubTabs();
861  $this->tabs_gui->setTabActive('settings');
862 
863  $this->initForm();
864  if ($this->form_gui->checkInput()) {
865  $this->server->toggleActive((int) $this->form_gui->getInput('active'));
866  $this->server->enableAuthentication(!$this->form_gui->getInput('ds'));
867  $this->server->setName($this->form_gui->getInput('server_name'));
868  $this->server->setUrl($this->form_gui->getInput('server_url'));
869  $this->server->setVersion($this->form_gui->getInput('version'));
870  $this->server->setBaseDN($this->form_gui->getInput('base_dn'));
871  $this->server->toggleReferrer($this->form_gui->getInput('referrals'));
872  $this->server->toggleTLS($this->form_gui->getInput('tls'));
873  $this->server->setBindingType((int) $this->form_gui->getInput('binding_type'));
874  $this->server->setBindUser($this->form_gui->getInput('bind_dn'));
875  $this->server->setBindPassword($this->form_gui->getInput('bind_pass'));
876  $this->server->setSearchBase($this->form_gui->getInput('search_base'));
877  $this->server->setUserScope($this->form_gui->getInput('user_scope'));
878  $this->server->setUserAttribute($this->form_gui->getInput('user_attribute'));
879  $this->server->setFilter($this->form_gui->getInput('filter'));
880  $this->server->setGroupDN($this->form_gui->getInput('group_dn'));
881  $this->server->setGroupScope((int) $this->form_gui->getInput('group_scope'));
882  $this->server->setGroupFilter($this->form_gui->getInput('group_filter'));
883  $this->server->setGroupMember($this->form_gui->getInput('group_member'));
884  $this->server->enableGroupMemberIsDN((int) $this->form_gui->getInput('memberisdn'));
885  $this->server->setGroupName($this->form_gui->getInput('group'));
886  $this->server->setGroupAttribute($this->form_gui->getInput('group_attribute'));
887  $this->server->setGroupUserFilter($this->form_gui->getInput('group_user_filter'));
888  $this->server->toggleMembershipOptional((int) $this->form_gui->getInput('group_optional'));
889  $this->server->enableSyncOnLogin((int) $this->form_gui->getInput('sync_on_login'));
890  $this->server->enableSyncPerCron((int) $this->form_gui->getInput('sync_per_cron'));
891  $this->server->setGlobalRole((int) $this->form_gui->getInput('global_role'));
892  $this->server->enableAccountMigration((int) $this->form_gui->getInput('migration'));
893  // start Patch Name Filter
894  $this->server->setUsernameFilter($this->form_gui->getInput("name_filter"));
895  // end Patch Name Filter
896  if (!$this->server->validate()) {
897  ilUtil::sendFailure($ilErr->getMessage());
898  $this->form_gui->setValuesByPost();
899  return $this->tpl->setContent($this->form_gui->getHtml());
900  }
901 
902  // Update or create
903  if ($this->server->getServerId()) {
904  $this->server->update();
905  } else {
906  $this->server->create();
907  }
908 
909  // Now server_id exists => update LDAP attribute mapping
910  $this->initAttributeMapping();
911  $this->mapping->setRule('global_role', (int) $this->form_gui->getInput('global_role'), false);
912  $this->mapping->save();
913 
914  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
915  $this->ctrl->redirect($this, 'serverList');
916  return true;
917  #$this->form_gui->setValuesByPost();
918  #return $this->tpl->setContent($this->form_gui->getHtml());
919  }
920 
921  $this->form_gui->setValuesByPost();
922  return $this->tpl->setContent($this->form_gui->getHtml());
923  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
setSubTabs()
Set sub tabs for ldap section.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ saveMapping()

ilLDAPSettingsGUI::saveMapping ( )

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

References $_POST, $key, getMappingFields(), initAttributeMapping(), initUserDefinedFields(), ilUtil\sendSuccess(), ilUtil\stripSlashes(), and userMapping().

567  {
568  $this->initAttributeMapping();
569  $this->tabs_gui->setTabActive('role_mapping');
570 
571  foreach ($this->getMappingFields() as $key => $mapping) {
572  $this->mapping->setRule($key, ilUtil::stripSlashes($_POST[$key . '_value']), (int) $_POST[$key . '_update']);
573  }
574  $this->initUserDefinedFields();
575  foreach ($this->udf->getDefinitions() as $definition) {
576  $key = 'udf_' . $definition['field_id'];
577  $this->mapping->setRule($key, ilUtil::stripSlashes($_POST[$key . '_value']), (int) $_POST[$key . '_update']);
578  }
579 
580  $this->mapping->save();
581  $this->userMapping();
582 
583  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
584  unset($_POST['mapping_template']);
585  return;
586  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
userMapping()
Ldap User Mapping.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ saveRoleSelection()

ilLDAPSettingsGUI::saveRoleSelection ( )
protected

Save role selection.

Returns

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

References $ilErr, loadRoleAssignmentRule(), roleAssignments(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and showRoleSelection().

395  {
396  global $ilErr,$ilAccess;
397 
398  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
399  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
400  $this->roleAssignment();
401  return false;
402  }
403 
404  if (!(int) $_REQUEST['role_id']) {
405  ilUtil::sendFailure($this->lng->txt('select_one'));
406  $this->showRoleSelection();
407  return false;
408  }
409 
410  $this->loadRoleAssignmentRule((int) $_REQUEST['rule_id'], false);
411  $this->rule->setRoleId((int) $_REQUEST['role_id']);
412 
413  if ((int) $_REQUEST['rule_id']) {
414  $this->rule->update();
415  } else {
416  $this->rule->create();
417  }
418 
419  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
420  $this->roleAssignments();
421  return true;
422  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
showRoleSelection()
show role selection
roleAssignments()
Edit role assignments.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
loadRoleAssignmentRule($a_rule_id, $a_from_form=true)
Load input from form.
+ Here is the call graph for this function:

◆ saveSyncronizationSettings()

ilLDAPSettingsGUI::saveSyncronizationSettings ( )

save Syncronization Settings on Role Mapping screen

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

References $_POST, ilUtil\sendSuccess(), and ilUtil\stripSlashes().

1751  {
1752  $this->server->setRoleBindDN(ilUtil::stripSlashes($_POST['role_bind_user']));
1753  $this->server->setRoleBindPassword(ilUtil::stripSlashes($_POST['role_bind_pass']));
1754  $this->server->enableRoleSynchronization((int) $_POST['role_sync_active']);
1755 
1756  // Update or create
1757  if ($this->server->getServerId()) {
1758  $this->server->update();
1759  }
1760  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1761  $this->ctrl->redirect($this, "roleMapping");
1762  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ serverList()

ilLDAPSettingsGUI::serverList ( )

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

References $ilErr, $table, ilLDAPServer\checkLDAPLib(), and ilUtil\sendFailure().

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

589  {
590  global $ilAccess, $ilErr, $ilToolbar;
591 
592  if (!$ilAccess->checkAccess('read', '', $this->ref_id) && $cmd != "serverList") {
593  $ilErr->raiseError($this->lng->txt('msg_no_perm_write'), $ilErr->WARNING);
594  }
595 
596  if (!ilLDAPServer::checkLDAPLib() and $this->server->isActive()) {
597  ilUtil::sendFailure('Missing LDAP libraries. Please ensure that the PHP LDAP module is installed on your server.');
598  }
599 
600  $ilToolbar->addButton(
601  $this->lng->txt("add_ldap_server"),
602  $this->ctrl->getLinkTarget($this, "addServerSettings")
603  );
604 
605  include_once './Services/LDAP/classes/class.ilLDAPServerTableGUI.php';
606 
607  $table = new ilLDAPServerTableGUI($this, "serverList");
608 
609 
610  return $this->tpl->setContent($table->getHTML());
611  }
static checkLDAPLib()
Check if ldap module is installed.
global $ilErr
Definition: raiseError.php:16
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setServerFormValues()

ilLDAPSettingsGUI::setServerFormValues ( )

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

References ilLDAPAttributeMapping\_lookupGlobalRole(), and array.

Referenced by editServerSettings().

614  {
615  $this->form_gui->setValuesByArray(array(
616  'active' => $this->server->isActive(),
617  'ds' => !$this->server->isAuthenticationEnabled(),
618  'server_name' => $this->server->getName(),
619  'server_url' => $this->server->getUrlString(),
620  'version' => $this->server->getVersion(),
621  'base_dn' => $this->server->getBaseDN(),
622  'referrals' => $this->server->isActiveReferrer(),
623  'tls' => $this->server->isActiveTLS(),
624  'binding_type' => $this->server->getBindingType(),
625  'bind_dn' => $this->server->getBindUser(),
626  'bind_pass' => $this->server->getBindPassword(),
627  'bind_pass_retype' => $this->server->getBindPassword(),
628  'search_base' => $this->server->getSearchBase(),
629  'user_scope' => $this->server->getUserScope(),
630  'user_attribute' => $this->server->getUserAttribute(),
631  'filter' => $this->server->getFilter(),
632  'group_dn' => $this->server->getGroupDN(),
633  'group_scope' => $this->server->getGroupScope(),
634  'group_filter' => $this->server->getGroupFilter(),
635  'group_member' => $this->server->getGroupMember(),
636  'memberisdn' => $this->server->enabledGroupMemberIsDN(),
637  'group' => $this->server->getGroupName(),
638  'group_attribute' => $this->server->getGroupAttribute(),
639  'group_optional' => $this->server->isMembershipOptional(),
640  'group_user_filter' => $this->server->getGroupUserFilter(),
641  'sync_on_login' => $this->server->enabledSyncOnLogin(),
642  'sync_per_cron' => $this->server->enabledSyncPerCron(),
643  'global_role' => ilLDAPAttributeMapping::_lookupGlobalRole($this->server->getServerId()),
644  'migration' => (int) $this->server->isAccountMigrationEnabled(),
645  // start Patch Name Filter
646  "name_filter" => $this->server->getUsernameFilter()
647  // end Patch Name Filter
648  ));
649  }
static _lookupGlobalRole($a_server_id)
Lookup global role assignment.
Create styles array
The data for the language used.
+ 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.

private

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

References ilLDAPServer\_getServerList().

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

933  {
934  $this->tabs_gui->clearTargets();
935 
936  $this->tabs_gui->setBackTarget(
937  $this->lng->txt("back"),
938  $this->ctrl->getLinkTarget($this, 'serverList')
939  );
940 
941  /*$this->tabs_gui->addSubTabTarget("ldap_settings",
942  $this->ctrl->getLinkTarget($this,'serverList'),
943  "serverList",get_class($this));*/
944 
945  $this->tabs_gui->addTab(
946  "settings",
947  $this->lng->txt("ldap_settings"),
948  $this->ctrl->getLinkTarget($this, 'editServerSettings')
949  );
950 
951  // Disable all other tabs, if server hasn't been configured.
952  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
953  if (!count(ilLDAPServer::_getServerList())) {
954  return true;
955  }
956 
957  /*$this->tabs_gui->addSubTabTarget("ldap_user_mapping",
958  $this->ctrl->getLinkTarget($this,'userMapping'),
959  "userMapping",get_class($this));*/
960 
961  $this->tabs_gui->addTab(
962  "user_mapping",
963  $this->lng->txt("ldap_user_mapping"),
964  $this->ctrl->getLinkTarget($this, 'userMapping')
965  );
966 
967  /*$this->tabs_gui->addSubTabTarget('ldap_role_assignments',
968  $this->ctrl->getLinkTarget($this,'roleAssignments'),
969  "roleAssignments",get_class($this));*/
970 
971  $this->tabs_gui->addTab(
972  "role_assignments",
973  $this->lng->txt('ldap_role_assignments'),
974  $this->ctrl->getLinkTarget($this, 'roleAssignments')
975  );
976 
977  /*$this->tabs_gui->addSubTabTarget("ldap_role_mapping",
978  $this->ctrl->getLinkTarget($this,'roleMapping'),
979  "roleMapping",get_class($this));
980  "roleMapping",get_class($this));*/
981  $this->tabs_gui->addTab(
982  "role_mapping",
983  $this->lng->txt("ldap_role_mapping"),
984  $this->ctrl->getLinkTarget($this, 'roleMapping')
985  );
986  }
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 ( )
protected

set values of form array

Returns

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

References ilObject\_lookupTitle().

Referenced by editRoleAssignment().

156  {
157  global $rbacreview;
158 
159  $role_id = $this->role_mapping_rule->getRoleId();
160  if ($rbacreview->isGlobalRole($role_id)) {
161  $val['role_name'] = 0;
162  $val['role_id'] = $role_id;
163  } else {
164  $val['role_name'] = 1;
165  $val['role_search'] = ilObject::_lookupTitle($role_id);
166  }
167  $val['add_missing'] = (int) $this->role_mapping_rule->isAddOnUpdateEnabled();
168  $val['remove_deprecated'] = (int) $this->role_mapping_rule->isRemoveOnUpdateEnabled();
169  $val['type'] = (int) $this->role_mapping_rule->getType();
170  $val['dn'] = $this->role_mapping_rule->getDN();
171  $val['at'] = $this->role_mapping_rule->getMemberAttribute();
172  $val['isdn'] = $this->role_mapping_rule->isMemberAttributeDN();
173  $val['name'] = $this->role_mapping_rule->getAttributeName();
174  $val['value'] = $this->role_mapping_rule->getAttributeValue();
175  $val['plugin_id'] = $this->role_mapping_rule->getPluginId();
176 
177  $this->form->setValuesByArray($val);
178  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRoleSelection()

ilLDAPSettingsGUI::showRoleSelection ( )
protected

show role selection

Returns

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

References $_SESSION, $parser, $res, $table, array, QP_COMBINATION_AND, and setSubTabs().

Referenced by saveRoleSelection().

361  {
362  $this->setSubTabs();
363  $this->tabs_gui->setTabActive('role_assignment');
364  $this->ctrl->saveParameter($this, 'rule_id');
365 
366  include_once './Services/Search/classes/class.ilQueryParser.php';
367  $parser = new ilQueryParser($_SESSION['ldap_role_ass']['role_search']);
368  $parser->setMinWordLength(1, true);
369  $parser->setCombination(QP_COMBINATION_AND);
370  $parser->parse();
371 
372  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
373  $object_search = new ilLikeObjectSearch($parser);
374  $object_search->setFilter(array('role'));
375  $res = $object_search->performSearch();
376 
377  $entries = $res->getEntries();
378 
379  include_once './Services/AccessControl/classes/class.ilRoleSelectionTableGUI.php';
380  $table = new ilRoleSelectionTableGUI($this, 'showRoleSelection');
381  $table->setTitle($this->lng->txt('ldap_role_selection'));
382  $table->addMultiCommand('saveRoleSelection', $this->lng->txt('ldap_choose_role'));
383  #$table->addCommandButton('roleAssignment',$this->lng->txt('cancel'));
384  $table->parse($entries);
385 
386  $this->tpl->setContent($table->getHTML());
387  return true;
388  }
$_SESSION["AccountId"]
setSubTabs()
Set sub tabs for ldap section.
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
$parser
Definition: BPMN2Parser.php:23
const QP_COMBINATION_AND
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateRoleAssignment()

ilLDAPSettingsGUI::updateRoleAssignment ( )

update role assignment

public

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

References $ilErr, checkRoleAssignmentInput(), initFormRoleAssignments(), roleAssignments(), roleSelection(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

187  {
188  global $ilErr,$ilAccess;
189 
190  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
191  ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
192  $this->roleAssignment();
193  return false;
194  }
195 
196  include_once('Services/LDAP/classes/class.ilLDAPRoleAssignmentRule.php');
197  include_once('Services/LDAP/classes/class.ilLDAPServer.php');
198 
199  $this->initFormRoleAssignments('edit');
200  if (!$this->form->checkInput() or ($err = $this->checkRoleAssignmentInput((int) $_REQUEST['rule_id']))) {
201  if ($err) {
202  ilUtil::sendFailure($this->lng->txt($err));
203  }
204 
205  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.ldap_role_assignments.html', 'Services/LDAP');
206 
207  // DONE: wrap this
208  $this->form->setValuesByPost();
209  $this->tpl->setVariable('NEW_ASSIGNMENT_TBL', $this->form->getHTML());
210  #$this->tpl->setVariable('RULES_TBL',$this->getRoleAssignmentTable());
211  $this->tabs_gui->setSubTabActive('shib_role_assignment');
212  return true;
213  }
214 
215  // Might redirect
216  $this->roleSelection();
217 
218  $this->rule->update();
219  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
220  $this->roleAssignments();
221  return true;
222  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
checkRoleAssignmentInput($a_rule_id=0)
Check role assignment input.
roleAssignments()
Edit role assignments.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initFormRoleAssignments($a_mode)
Init form table for new role assignments.
+ Here is the call graph for this function:

◆ updateRoleMapping()

ilLDAPSettingsGUI::updateRoleMapping ( )

Check edit screen input and save to db ilRbacReview $rbacreview.

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

References $_GET, initRoleMappingForm(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

1718  {
1719  global $rbacreview;
1720  $propertie_form = $this->initRoleMappingForm("updateRoleMapping");
1721 
1722  if ($propertie_form->checkInput() && $rbacreview->roleExists($propertie_form->getInput("role"))) {
1723  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMappingSetting.php');
1724  $mapping = new ilLDAPRoleGroupMappingSetting($_GET["mapping_id"]);
1725  $mapping->setServerId($this->server->getServerId());
1726  $mapping->setURL($propertie_form->getInput("url"));
1727  $mapping->setDN($propertie_form->getInput("dn"));
1728  $mapping->setMemberAttribute($propertie_form->getInput("member"));
1729  $mapping->setMemberISDN($propertie_form->getInput("memberisdn"));
1730  $mapping->setRoleByName($propertie_form->getInput("role"));
1731  $mapping->setMappingInfo($propertie_form->getInput("info"));
1732  $mapping->setMappingInfoType($propertie_form->getInput("info_type"));
1733  $mapping->update();
1734 
1735  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
1736  $this->ctrl->redirect($this, "roleMapping");
1737  } else {
1738  if (!$rbacreview->roleExists($propertie_form->getInput("role"))) {
1739  ilUtil::sendFailure($this->lng->txt("ldap_role_not_exists") . " " .
1740  $propertie_form->getInput("role"));
1741  }
1742  $propertie_form->setValuesByPost();
1743  $this->tpl->setContent($propertie_form->getHTML());
1744  }
1745  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
initRoleMappingForm($command)
init propertyformgui for Assignment of LDAP Attributes to ILIAS User Profile
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ userMapping()

ilLDAPSettingsGUI::userMapping ( )

Ldap User Mapping.

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

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

Referenced by chooseMapping(), and saveMapping().

1581  {
1582  $this->initAttributeMapping();
1583 
1584  $this->setSubTabs();
1585  $this->tabs_gui->setTabActive('user_mapping');
1586  $this->userMappingToolbar();
1587 
1588  $propertie_form = $this->initUserMappingForm();
1589 
1590  $this->tpl->setContent($propertie_form->getHTML());
1591  }
userMappingToolbar()
Create Toolbar ilToolbarGUI $ilToolbar.
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 ilToolbarGUI $ilToolbar.

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

References $_POST, $options, and array.

Referenced by userMapping().

1289  {
1290  global $ilToolbar;
1291  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1292 
1293  $select_form = new ilSelectInputGUI("mapping_template");
1294  $select_form->setPostVar("mapping_template");
1295  $options = array(
1296  "" => $this->lng->txt('ldap_mapping_template'),
1297  "inetOrgPerson" => 'inetOrgPerson',
1298  "organizationalPerson" => 'organizationalPerson',
1299  "person" => 'person',
1300  "ad_2003" => 'Active Directory (Win 2003)');
1301  $select_form->setOptions($options);
1302  $select_form->setValue($_POST['mapping_template']);
1303 
1304  $ilToolbar->addInputItem($select_form);
1305  $ilToolbar->addFormButton($this->lng->txt('show'), "chooseMapping");
1306  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "chooseMapping"));
1307  }
This class represents a selection list property in a property form.
Create styles array
The data for the language used.
$_POST["username"]
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the caller graph for this function:

Field Documentation

◆ $ref_id

ilLDAPSettingsGUI::$ref_id = null
private

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

◆ $server

ilLDAPSettingsGUI::$server = null
private

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

Referenced by getServer().


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