mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 00:34:46 +02:00
Fixed the tactical with empty (in acl) users. TICKET: #3148
This commit is contained in:
parent
eef2101651
commit
a1c28937bd
@ -38,6 +38,10 @@ function tactical_get_data ($id_user = false, $user_strict = false, $acltags, $r
|
|||||||
$user_groups_ids = implode(',', array_keys($acltags));
|
$user_groups_ids = implode(',', array_keys($acltags));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($user_groups_ids)) {
|
||||||
|
$user_groups_ids = 'null';
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($user_groups_ids)) {
|
if (!empty($user_groups_ids)) {
|
||||||
switch ($config["dbtype"]) {
|
switch ($config["dbtype"]) {
|
||||||
case "mysql":
|
case "mysql":
|
||||||
@ -70,7 +74,9 @@ function tactical_get_data ($id_user = false, $user_strict = false, $acltags, $r
|
|||||||
$list['_monitors_unknown_'] = 0;
|
$list['_monitors_unknown_'] = 0;
|
||||||
$list['_monitors_not_init_'] = 0;
|
$list['_monitors_not_init_'] = 0;
|
||||||
$list['_monitors_ok_'] = 0;
|
$list['_monitors_ok_'] = 0;
|
||||||
if ($list_groups == false) {
|
|
||||||
|
|
||||||
|
if (empty($list_groups)) {
|
||||||
$list_groups = array();
|
$list_groups = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,6 +305,7 @@ function tactical_get_data ($id_user = false, $user_strict = false, $acltags, $r
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if ($user_strict) {
|
if ($user_strict) {
|
||||||
$_tag_condition = 'AND ' . tags_get_acl_tags_module_condition($acltags,'tae');
|
$_tag_condition = 'AND ' . tags_get_acl_tags_module_condition($acltags,'tae');
|
||||||
}
|
}
|
||||||
@ -316,6 +323,9 @@ function tactical_get_data ($id_user = false, $user_strict = false, $acltags, $r
|
|||||||
$_tag_condition
|
$_tag_condition
|
||||||
GROUP BY estado");
|
GROUP BY estado");
|
||||||
|
|
||||||
|
if (empty($result_list))
|
||||||
|
$result_list = array();
|
||||||
|
|
||||||
foreach ($result_list as $result) {
|
foreach ($result_list as $result) {
|
||||||
switch ($result['estado']) {
|
switch ($result['estado']) {
|
||||||
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
|
case AGENT_MODULE_STATUS_CRITICAL_ALERT:
|
||||||
@ -419,6 +429,7 @@ function tactical_status_modules_agents($id_user = false, $user_strict = false,
|
|||||||
|
|
||||||
$result_list = tactical_get_data ($id_user, $user_strict,
|
$result_list = tactical_get_data ($id_user, $user_strict,
|
||||||
$acltags);
|
$acltags);
|
||||||
|
|
||||||
return $result_list;
|
return $result_list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -429,7 +440,6 @@ function tactical_monitor_alerts ($group_array, $strict_user = false, $id_group_
|
|||||||
|
|
||||||
if (empty ($group_array)) {
|
if (empty ($group_array)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (!is_array ($group_array)) {
|
else if (!is_array ($group_array)) {
|
||||||
$group_array = array($group_array);
|
$group_array = array($group_array);
|
||||||
@ -448,7 +458,8 @@ function tactical_monitor_alerts ($group_array, $strict_user = false, $id_group_
|
|||||||
AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo";
|
AND talert_template_modules.id_agent_module = tagente_modulo.id_agente_modulo";
|
||||||
$count = db_get_sql ($sql);
|
$count = db_get_sql ($sql);
|
||||||
return $count;
|
return $count;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//TODO REVIEW ORACLE AND POSTGRES
|
//TODO REVIEW ORACLE AND POSTGRES
|
||||||
return db_get_sql ("SELECT COUNT(talert_template_modules.id)
|
return db_get_sql ("SELECT COUNT(talert_template_modules.id)
|
||||||
FROM talert_template_modules, tagente_modulo, tagente_estado, tagente
|
FROM talert_template_modules, tagente_modulo, tagente_estado, tagente
|
||||||
@ -464,7 +475,6 @@ function tactical_monitor_fired_alerts ($group_array, $strict_user = false, $id_
|
|||||||
|
|
||||||
if (empty ($group_array)) {
|
if (empty ($group_array)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (!is_array ($group_array)) {
|
else if (!is_array ($group_array)) {
|
||||||
$group_array = array($group_array);
|
$group_array = array($group_array);
|
||||||
@ -486,7 +496,8 @@ function tactical_monitor_fired_alerts ($group_array, $strict_user = false, $id_
|
|||||||
|
|
||||||
$count = db_get_sql ($sql);
|
$count = db_get_sql ($sql);
|
||||||
return $count;
|
return $count;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//TODO REVIEW ORACLE AND POSTGRES
|
//TODO REVIEW ORACLE AND POSTGRES
|
||||||
return db_get_sql ("SELECT COUNT(talert_template_modules.id)
|
return db_get_sql ("SELECT COUNT(talert_template_modules.id)
|
||||||
FROM talert_template_modules, tagente_modulo, tagente_estado, tagente
|
FROM talert_template_modules, tagente_modulo, tagente_estado, tagente
|
||||||
@ -497,6 +508,4 @@ function tactical_monitor_fired_alerts ($group_array, $strict_user = false, $id_
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user