diff --git a/lam/HISTORY b/lam/HISTORY index 10591170..5abfad56 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -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 diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc index eb27dd40..44528327 100644 --- a/lam/lib/lists.inc +++ b/lam/lib/lists.inc @@ -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; }