mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Fixed an SQL error
This commit is contained in:
parent
7e7e40dd02
commit
b79d572959
@ -7872,12 +7872,17 @@ function reporting_tiny_stats ($counts_info, $return = false, $type = 'agent', $
|
|||||||
$counts_info['total_count'] = $counts_info['normal_count'] + $counts_info['warning_count'] + $counts_info['critical_count'] + $counts_info['unknown_count'] + $counts_info['notinit_count'];
|
$counts_info['total_count'] = $counts_info['normal_count'] + $counts_info['warning_count'] + $counts_info['critical_count'] + $counts_info['unknown_count'] + $counts_info['notinit_count'];
|
||||||
|
|
||||||
$all_agent_modules = tags_get_agent_modules ($id_agent, $acltags, false, $filter);
|
$all_agent_modules = tags_get_agent_modules ($id_agent, $acltags, false, $filter);
|
||||||
|
if (!empty($all_agent_modules)) {
|
||||||
$mod_clause = "(".implode(',', array_keys($all_agent_modules)).")";
|
$mod_clause = "(".implode(',', array_keys($all_agent_modules)).")";
|
||||||
|
|
||||||
$counts_info['fired_count'] = db_get_sql ("SELECT COUNT(times_fired)
|
$counts_info['fired_count'] = (int) db_get_sql ("SELECT COUNT(times_fired)
|
||||||
FROM talert_template_modules
|
FROM talert_template_modules
|
||||||
WHERE times_fired != 0 AND id_agent_module IN ".$mod_clause);
|
WHERE times_fired != 0 AND id_agent_module IN ".$mod_clause);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$counts_info['fired_count'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Store the counts in a data structure to print hidden divs with titles
|
// Store the counts in a data structure to print hidden divs with titles
|
||||||
$stats = array();
|
$stats = array();
|
||||||
|
@ -1996,7 +1996,7 @@ function tags_get_agent_modules ($id_agent, $groups_and_tags = array(), $fields
|
|||||||
|
|
||||||
// Avoid mysql error
|
// Avoid mysql error
|
||||||
if (empty($id_agent))
|
if (empty($id_agent))
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
if (!is_array ($fields)) {
|
if (!is_array ($fields)) {
|
||||||
$fields = array ();
|
$fields = array ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user