Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bsauveton committed Oct 28, 2015
1 parent f21d873 commit aef653b
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions www/class/centreonACL.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1467,19 +1467,29 @@ public function getServiceGroupAclConf($search = null, $broker = null, $options
}
# Cant manage empty servicegroup with ACLs. We'll have a problem with acl for conf...
$groupIds = array_keys($this->accessGroups);
$query = "(SELECT " . $request['fields'] . " FROM $db_name_acl.centreon_acl, hostgroup_relation, servicegroup_relation, servicegroup " .
" WHERE $db_name_acl.centreon_acl.group_id IN (" . implode(',', $groupIds) . ") " .
" AND $db_name_acl.centreon_acl.host_id = hostgroup_relation.host_host_id " .
" AND hostgroup_relation.hostgroup_hg_id = servicegroup_relation.hostgroup_hg_id " .
" AND servicegroup_relation.service_service_id = $db_name_acl.centreon_acl.service_id " .
" AND servicegroup_relation.servicegroup_sg_id = servicegroup.sg_id $searchSTR" .
$query = "(SELECT " . $request['fields'] . " FROM hostgroup_relation, servicegroup_relation,servicegroup, acl_res_group_relations, acl_resources_hg_relations " .

" WHERE acl_res_group_relations.acl_group_id IN (" . implode(',', $groupIds) . ") " .

" AND acl_resources_hg_relations.acl_res_id = acl_res_group_relations.acl_res_id $searchSTR " .

" AND servicegroup_relation.hostgroup_hg_id = hostgroup_relation.hostgroup_hg_id " .

" AND servicegroup.sg_id = servicegroup_relation.servicegroup_sg_id " .

") UNION ALL (" .
" SELECT " . $request['fields'] . " FROM $db_name_acl.centreon_acl, servicegroup_relation, servicegroup " .
" WHERE $db_name_acl.centreon_acl.group_id IN (" . implode(',', $groupIds) . ") " .
" AND $db_name_acl.centreon_acl.host_id = servicegroup_relation.host_host_id AND $db_name_acl.centreon_acl.service_id = servicegroup_relation.service_service_id " .
" AND servicegroup_relation.servicegroup_sg_id = servicegroup.sg_id $searchSTR)" .

" SELECT " . $request['fields'] . " FROM servicegroup, acl_resources_sg_relations, acl_res_group_relations " .

" WHERE acl_res_group_relations.acl_group_id IN (" . implode(',', $groupIds) . ") " .

" AND acl_resources_sg_relations.acl_res_id = acl_res_group_relations.acl_res_id " .

" AND acl_resources_sg_relations.sg_id = servicegroup.sg_id $searchSTR)" .

$request['order'];
}

$res = $pearDB->query($query);
if (PEAR::isError($res)) {
return $sg;
Expand Down

0 comments on commit aef653b

Please sign in to comment.