Skip to content

Commit

Permalink
Restrict available LDAP servers.
Browse files Browse the repository at this point in the history
You can view any available LDAP if you have access
to the root entity.

Otherwise, only the LDAP configured as the default
for the current entity is displayed.
  • Loading branch information
cosmedd authored and btry committed Jun 23, 2019
1 parent 39f98da commit 7f1e0c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions inc/question.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,15 @@ public function showForm($ID, $options = []) {
if ($ldap_values === null) {
$ldap_values = [];
}
$current_entity = $_SESSION['glpiactive_entity'];
if ($current_entity == 0) {
$auth_ldap_condition = '';
} else {
$auth_ldap_condition = "glpi_authldaps.id = (select glpi_entities.authldaps_id from glpi_entities where id=${current_entity})";
}
Dropdown::show('AuthLDAP', [
'name' => 'ldap_auth',
'condition' => $auth_ldap_condition,
'rand' => $rand,
'value' => (isset($ldap_values['ldap_auth'])) ? $ldap_values['ldap_auth'] : '',
'on_change' => 'change_LDAP(this)',
Expand Down

0 comments on commit 7f1e0c8

Please sign in to comment.