monitoring: Combine restrictions w/ OR

If a user has more than one filter for the same restriction, the filters will be combined w/ or. The combined filters will then be applied w/ AND to the query.

refs #9009
This commit is contained in:
Eric Lippmann 2015-05-29 11:40:26 +02:00
parent 41be32adff
commit 7793b61e4c
1 changed files with 3 additions and 1 deletions

View File

@ -58,9 +58,11 @@ class Controller extends IcingaWebController
*/
protected function applyRestriction($restriction, Filterable $view)
{
$restrictions = Filter::matchAny();
foreach ($this->getRestrictions($restriction) as $filter) {
$view->applyFilter(Filter::fromQueryString($filter));
$restrictions->addFilter(Filter::fromQueryString($filter));
}
$view->applyFilter($restrictions);
return $view;
}
}