BetaHostgroupRestriction: fix single-host query

This commit is contained in:
Thomas Gelf 2017-03-07 11:46:02 +01:00
parent 02a3652c86
commit 56af88ee3f
1 changed files with 1 additions and 2 deletions

View File

@ -18,10 +18,9 @@ class BetaHostgroupRestriction extends ObjectRestriction
$query = $this->db->select()->from( $query = $this->db->select()->from(
array('h' => 'icinga_host'), array('h' => 'icinga_host'),
array('id') array('id')
); )->where('id = ?', $host->id);
$this->applyToHostsQuery($query); $this->applyToHostsQuery($query);
return (int) $this->db->fetchOne($query) === (int) $host->get('id'); return (int) $this->db->fetchOne($query) === (int) $host->get('id');
} }