support type filters without parenthesis

This commit is contained in:
Roland Gruber 2014-02-26 20:13:16 +00:00
parent 72952501fc
commit 59ad00f9d2
1 changed files with 6 additions and 1 deletions

View File

@ -107,8 +107,13 @@ function get_ldap_filter($scope) {
// add type filter
$typeSettings = $_SESSION['config']->get_typeSettings();
if (isset($typeSettings['filter_' . $scope]) && ($typeSettings['filter_' . $scope] != '')) {
if (strpos($typeSettings['filter_' . $scope], '(') === 0) {
$filters['and'][] = $typeSettings['filter_' . $scope];
}
else {
$filters['and'][] = '(' . $typeSettings['filter_' . $scope] . ')';
}
}
// collapse AND filters
$finalFilter = '';
if (sizeof($filters['and']) < 2) {