Commit bbb70361 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:sparkles: feat(management) Allow raw LDAP filters

Showing with 8 additions and 7 deletions
+8 -7
......@@ -120,18 +120,19 @@ class managementFilter
function query (array $attrs, $base)
{
$filter = '';
if (!empty($this->search)) {
$filter = '(|('.implode('=*'.$this->search.'*)(', $this->searchAttributes).'=*'.$this->search.'*))';
}
$elementFilters = array();
foreach ($this->filterElements as $element) {
$element->getFilters($elementFilters);
}
if (!empty($elementFilters)) {
if (!empty($filter)) {
$elementFilters[] = $filter;
if (!empty($this->search)) {
if (preg_match('/^\(.+\)$/', $this->search)) {
$elementFilters[] = $this->search;
} else {
$elementFilters[] = '(|('.implode('=*'.$this->search.'*)(', $this->searchAttributes).'=*'.$this->search.'*))';
}
}
$filter = '';
if (!empty($elementFilters)) {
$filter = '(&'.implode('', $elementFilters).')';
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment