mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
MonitoredObject: Ensure that the filter is applied to all queries
refs #9009
This commit is contained in:
parent
d0a7c481c2
commit
670d6e93c7
@ -151,8 +151,8 @@ class Host extends MonitoredObject
|
|||||||
$services = array();
|
$services = array();
|
||||||
foreach ($this->backend->select()->from('servicestatus', array('service_description'))
|
foreach ($this->backend->select()->from('servicestatus', array('service_description'))
|
||||||
->where('host_name', $this->host)
|
->where('host_name', $this->host)
|
||||||
->getQuery()
|
->applyFilter($this->getFilter())
|
||||||
->fetchAll() as $service) {
|
->getQuery() as $service) {
|
||||||
$services[] = new Service($this->backend, $this->host, $service->service_description);
|
$services[] = new Service($this->backend, $this->host, $service->service_description);
|
||||||
}
|
}
|
||||||
$this->services = $services;
|
$this->services = $services;
|
||||||
|
@ -155,7 +155,7 @@ abstract class MonitoredObject implements Filterable
|
|||||||
public function getFilter()
|
public function getFilter()
|
||||||
{
|
{
|
||||||
if ($this->filter === null) {
|
if ($this->filter === null) {
|
||||||
$this->filter = Filter::matchAny();
|
$this->filter = Filter::matchAll();
|
||||||
}
|
}
|
||||||
return $this->filter;
|
return $this->filter;
|
||||||
}
|
}
|
||||||
@ -261,7 +261,7 @@ abstract class MonitoredObject implements Filterable
|
|||||||
} else {
|
} else {
|
||||||
$comments->where('host_name', $this->host_name);
|
$comments->where('host_name', $this->host_name);
|
||||||
}
|
}
|
||||||
$this->comments = $comments->getQuery()->fetchAll();
|
$this->comments = $comments->applyFilter($this->getFilter())->getQuery()->fetchAll();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ abstract class MonitoredObject implements Filterable
|
|||||||
$downtimes
|
$downtimes
|
||||||
->where('host_name', $this->host_name);
|
->where('host_name', $this->host_name);
|
||||||
}
|
}
|
||||||
$this->downtimes = $downtimes->getQuery()->fetchAll();
|
$this->downtimes = $downtimes->applyFilter($this->getFilter())->getQuery()->fetchAll();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ abstract class MonitoredObject implements Filterable
|
|||||||
$this->hostgroups = $this->backend->select()
|
$this->hostgroups = $this->backend->select()
|
||||||
->from('hostgroup', array('hostgroup_name', 'hostgroup_alias'))
|
->from('hostgroup', array('hostgroup_name', 'hostgroup_alias'))
|
||||||
->where('host_name', $this->host_name)
|
->where('host_name', $this->host_name)
|
||||||
->applyFilter($this->filter)
|
->applyFilter($this->getFilter())
|
||||||
->fetchPairs();
|
->fetchPairs();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -395,7 +395,7 @@ abstract class MonitoredObject implements Filterable
|
|||||||
} else {
|
} else {
|
||||||
$contacts->where('host_name', $this->host_name);
|
$contacts->where('host_name', $this->host_name);
|
||||||
}
|
}
|
||||||
$this->contacts = $contacts->getQuery()->fetchAll();
|
$this->contacts = $contacts->applyFilter($this->getFilter())->getQuery()->fetchAll();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ abstract class MonitoredObject implements Filterable
|
|||||||
} else {
|
} else {
|
||||||
$contactsGroups->where('host_name', $this->host_name);
|
$contactsGroups->where('host_name', $this->host_name);
|
||||||
}
|
}
|
||||||
$this->contactgroups = $contactsGroups->getQuery()->fetchAll();
|
$this->contactgroups = $contactsGroups->applyFilter($this->getFilter())->getQuery()->fetchAll();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ abstract class MonitoredObject implements Filterable
|
|||||||
if ($this->type === self::TYPE_SERVICE) {
|
if ($this->type === self::TYPE_SERVICE) {
|
||||||
$eventHistory->where('service_description', $this->service_description);
|
$eventHistory->where('service_description', $this->service_description);
|
||||||
}
|
}
|
||||||
$this->eventhistory = $eventHistory;
|
$this->eventhistory = $eventHistory->applyFilter($this->getFilter());
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user