mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Allow LDAP queries without objectClass filter
This commit is contained in:
parent
f24e5eaa8a
commit
fea7e8993b
@ -313,8 +313,8 @@ class Query
|
|||||||
protected function render()
|
protected function render()
|
||||||
{
|
{
|
||||||
$parts = array();
|
$parts = array();
|
||||||
if ($this->filters['objectClass'] === null) {
|
if (! isset($this->filters['objectClass']) || $this->filters['objectClass'] === null) {
|
||||||
throw new Exception('Object class is mandatory');
|
// throw new Exception('Object class is mandatory');
|
||||||
}
|
}
|
||||||
foreach ($this->filters as $key => $value) {
|
foreach ($this->filters as $key => $value) {
|
||||||
$parts[] = sprintf(
|
$parts[] = sprintf(
|
||||||
@ -323,7 +323,11 @@ class Query
|
|||||||
LdapUtils::quoteForSearch($value, true)
|
LdapUtils::quoteForSearch($value, true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return '(&(' . implode(')(', $parts) . '))';
|
if (count($parts) > 1) {
|
||||||
|
return '(&(' . implode(')(', $parts) . '))';
|
||||||
|
} else {
|
||||||
|
return '(' . $parts[0] . ')';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user