From 7793b61e4cfd5e341e8d0c88b5e0612101ea2c7d Mon Sep 17 00:00:00 2001 From: Eric Lippmann <eric.lippmann@netways.de> Date: Fri, 29 May 2015 11:40:26 +0200 Subject: [PATCH] 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 --- modules/monitoring/library/Monitoring/Controller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Controller.php b/modules/monitoring/library/Monitoring/Controller.php index c3cbe3c2d..b6b65fc0c 100644 --- a/modules/monitoring/library/Monitoring/Controller.php +++ b/modules/monitoring/library/Monitoring/Controller.php @@ -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; } }