From 69eba916b21a1a757675158c40eb960004e04a54 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 3 Dec 2009 15:40:49 +0000 Subject: [PATCH] 2009-12-3 Miguel de Dios * godmode/agentes/module_manager_editor_common.php: clean source code. * include/functions_reporting.php: fix the query to count bad modules for SLA. Fixes: 2908101 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2153 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ .../godmode/agentes/module_manager_editor_common.php | 1 + pandora_console/include/functions_reporting.php | 9 +++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5970b24ed2..ed2a2b872a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-12-3 Miguel de Dios + + * godmode/agentes/module_manager_editor_common.php: clean source code. + * include/functions_reporting.php: fix the query to count bad modules for + SLA. + Fixes: 2908101 + 2009-12-3 Miguel de Dios * godmode/reporting/map_builder.php: tiny fix the text for select all diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index d72dd5f1fc..4653f8637b 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -95,6 +95,7 @@ enterprise_include_once('include/functions_policies.php'); $disabledBecauseInPolicy = false; $disabledTextBecauseInPolicy = ''; + if ($config['enterprise_installed'] && ($id_agent_module != 0)) { $disabledBecauseInPolicy = isModuleInPolicy($id_agent_module); if ($disabledBecauseInPolicy) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 50c4c2fa78..30d2fa475f 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -69,10 +69,11 @@ function get_agentmodule_sla ($id_agentmodule, $period = 0, $min_value = 1, $max WHERE id_agente_modulo = %d AND utimestamp > %d AND utimestamp <= %d - AND datos < %d', $id_agentmodule, $datelimit, $date, $min_value); - if ($max_value > $min_value) { - $sql .= sprintf (' AND datos > %d', $max_value); - } + AND ', $id_agentmodule, $datelimit, $date); + if ($max_value > $min_value) + $sql .= sprintf ('( datos < %s OR datos > %d )', $min_value, $max_value); + else + $sql .= sprintf ('datos < %d', $mins_value); $bad = get_db_sql ($sql); if (empty ($bad)) { $bad = 0;