filter by substring match instead of exact match
This commit is contained in:
parent
a3f0c07096
commit
714dbaa0fd
|
@ -1,5 +1,6 @@
|
|||
December 2019 7.0
|
||||
- Lamdaemon can be configured with directory prefix for homedirs
|
||||
- Account list filters match on substrings instead of whole value
|
||||
- Fixed bugs:
|
||||
-> Missing CSS for Duo
|
||||
|
||||
|
|
|
@ -1080,7 +1080,14 @@ class lamList {
|
|||
if (!$this->isAttributeFilteredByServer($attr)) {
|
||||
continue;
|
||||
}
|
||||
$text .= '(' . $attr . '=' . $filter . ')';
|
||||
$filterExpression = $filter;
|
||||
if (strpos($filter, '*') !== 0) {
|
||||
$filterExpression = '*' . $filterExpression;
|
||||
}
|
||||
if (strrpos($filter, '*') !== (strlen($filter) - 1)) {
|
||||
$filterExpression = $filterExpression . '*';
|
||||
}
|
||||
$text .= '(' . $attr . '=' . $filterExpression . ')';
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
@ -1113,7 +1120,7 @@ class lamList {
|
|||
continue;
|
||||
}
|
||||
$regex = str_replace(array('*'), array('.*'), $filterValue);
|
||||
$regex = '/^' . $regex . '$/i';
|
||||
$regex = '/' . $regex . '/i';
|
||||
if (!$this->isFilterMatching($data, $filterAttribute, $regex)) {
|
||||
$toFilter[] = $index;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue