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 committed Jun 21, 2019
1 parent 39f98da commit b088878
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion inc/question.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,17 @@ 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 in (select a.id from glpi_entities as e ,glpi_authldaps as a where a.id=e.authldaps_id and e.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'] : '',
'value' => '',
'on_change' => 'change_LDAP(this)',
]);
echo '</div>';
Expand Down

0 comments on commit b088878

Please sign in to comment.