Apply restrictions example extended to hostgroup view
This commit is contained in:
parent
977b360b66
commit
6d59f242a7
|
@ -340,6 +340,7 @@ class Monitoring_ListController extends MonitoringController
|
||||||
'services_pending'
|
'services_pending'
|
||||||
)
|
)
|
||||||
)->getQuery();
|
)->getQuery();
|
||||||
|
$this->applyRestrictions($query);
|
||||||
$this->handleFormatRequest($query);
|
$this->handleFormatRequest($query);
|
||||||
$this->view->hostgroups = $query->paginate();
|
$this->view->hostgroups = $query->paginate();
|
||||||
$this->setupSortControl(array(
|
$this->setupSortControl(array(
|
||||||
|
@ -384,11 +385,11 @@ class Monitoring_ListController extends MonitoringController
|
||||||
foreach ($this->getRestrictions('monitoring/filter') as $restriction) {
|
foreach ($this->getRestrictions('monitoring/filter') as $restriction) {
|
||||||
parse_str($restriction, $filter);
|
parse_str($restriction, $filter);
|
||||||
foreach ($filter as $k => $v) {
|
foreach ($filter as $k => $v) {
|
||||||
// if ($query->isValidFilterTarget($k)) {
|
if ($query->isValidFilterTarget($k)) {
|
||||||
// TODO: This is NOT enough. We need to fix filters and get
|
// TODO: This is NOT enough. We need to fix filters and get
|
||||||
// applyAuthFilters back.
|
// applyAuthFilters back.
|
||||||
$query->where($k, $v);
|
$query->where($k, $v);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $query;
|
return $query;
|
||||||
|
|
Loading…
Reference in New Issue