2012-02-08 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/alerts_status.php: added a check for user ACL groups in the list of alerts. Fixes: #3484959 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5520 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
df57eef2bb
commit
9d5acedfc3
|
@ -1,3 +1,10 @@
|
|||
2012-02-08 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* operation/agentes/alerts_status.php: added a check for user ACL groups in
|
||||
the list of alerts.
|
||||
|
||||
Fixes: #3484959
|
||||
|
||||
2012-02-08 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||
|
||||
* godmode/events/custom_events.php: Changed 'sec' link parameter
|
||||
|
|
|
@ -222,6 +222,24 @@ switch ($sortField) {
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
//Add checks for user ACL
|
||||
$groups = users_get_groups($config["id_user"]);
|
||||
$id_groups = array_keys($groups);
|
||||
|
||||
if (empty($id_groups)) {
|
||||
$whereAlertSimple .= ' AND (1 = 0) ';
|
||||
}
|
||||
else {
|
||||
$whereAlertSimple .= ' AND id_agent_module IN (
|
||||
SELECT tam.id_agente_modulo
|
||||
FROM tagente_modulo AS tam
|
||||
WHERE tam.id_agente IN (SELECT ta.id_agente
|
||||
FROM tagente AS ta
|
||||
WHERE ta.id_grupo IN (' . implode(',', $id_groups) . '))) ';
|
||||
}
|
||||
|
||||
|
||||
$alerts = array();
|
||||
$options_simple = array('offset' => $offset_simple, 'limit' => $config['block_size'], 'order' => $order);
|
||||
$options_combined = array('limit' => $config["block_size"], 'offset' => $offset_combined);
|
||||
|
@ -230,16 +248,20 @@ $filter_alert = array();
|
|||
if($filter_standby == 'standby_on') {
|
||||
$filter_alert['disabled'] = $filter;
|
||||
$filter_alert['standby'] = '1';
|
||||
}else if($filter_standby == 'standby_off') {
|
||||
}
|
||||
else if($filter_standby == 'standby_off') {
|
||||
$filter_alert['disabled'] = $filter;
|
||||
$filter_alert['standby'] = '0';
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
$filter_alert['disabled'] = $filter;
|
||||
}
|
||||
|
||||
$alerts['alerts_simple'] = agents_get_alerts_simple ($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup);
|
||||
$alerts['alerts_simple'] = agents_get_alerts_simple ($agents,
|
||||
$filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup);
|
||||
|
||||
$countAlertsSimple = agents_get_alerts_simple ($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true);
|
||||
$countAlertsSimple = agents_get_alerts_simple ($agents, $filter_alert,
|
||||
false, $whereAlertSimple, false, false, $idGroup, true);
|
||||
|
||||
$alerts['alerts_combined'] = agents_get_alerts_compound($agents, $filter, $options_combined, $idGroup, false, $whereAlertCombined);
|
||||
$countAlertsCombined = agents_get_alerts_compound($agents, $filter, false, $idGroup, true, $whereAlertCombined);
|
||||
|
|
Loading…
Reference in New Issue