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
|
December 2019 7.0
|
||||||
- Lamdaemon can be configured with directory prefix for homedirs
|
- Lamdaemon can be configured with directory prefix for homedirs
|
||||||
|
- Account list filters match on substrings instead of whole value
|
||||||
- Fixed bugs:
|
- Fixed bugs:
|
||||||
-> Missing CSS for Duo
|
-> Missing CSS for Duo
|
||||||
|
|
||||||
|
|
|
@ -1080,7 +1080,14 @@ class lamList {
|
||||||
if (!$this->isAttributeFilteredByServer($attr)) {
|
if (!$this->isAttributeFilteredByServer($attr)) {
|
||||||
continue;
|
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;
|
return $text;
|
||||||
}
|
}
|
||||||
|
@ -1113,7 +1120,7 @@ class lamList {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$regex = str_replace(array('*'), array('.*'), $filterValue);
|
$regex = str_replace(array('*'), array('.*'), $filterValue);
|
||||||
$regex = '/^' . $regex . '$/i';
|
$regex = '/' . $regex . '/i';
|
||||||
if (!$this->isFilterMatching($data, $filterAttribute, $regex)) {
|
if (!$this->isFilterMatching($data, $filterAttribute, $regex)) {
|
||||||
$toFilter[] = $index;
|
$toFilter[] = $index;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue