From 259c8c1b46f69c6b18a59d24b792dae84cff32aa Mon Sep 17 00:00:00 2001 From: Laurent Pinsivy Date: Fri, 19 Oct 2018 09:37:07 +0200 Subject: [PATCH] fix(acl): Host calculation with ACL is not correct (#6436) For users with ACL, the SQL request get the list of all host / service couple and not only host list. --- www/include/monitoring/status/HostGroups/xml/hostGroupXML.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/include/monitoring/status/HostGroups/xml/hostGroupXML.php b/www/include/monitoring/status/HostGroups/xml/hostGroupXML.php index 2f46ae2d747..a73b18ec7c6 100644 --- a/www/include/monitoring/status/HostGroups/xml/hostGroupXML.php +++ b/www/include/monitoring/status/HostGroups/xml/hostGroupXML.php @@ -114,7 +114,7 @@ $rq1 .= $searchStr . "GROUP BY hg.name, h.state"; } else { - $rq1 = "SELECT hg.name as alias, h.state, count(h.host_id) AS nb " . + $rq1 = "SELECT hg.name as alias, h.state, count(DISTINCT h.host_id) AS nb " . "FROM centreon_acl acl, hosts_hostgroups hhg, hosts h, hostgroups hg " . "WHERE hg.hostgroup_id = hhg.hostgroup_id " . "AND hhg.host_id = h.host_id " .