diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2014937e1d..0212dc60c3 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2009-01-09 Evi Vanoost + + * general/footer.php, operation/agentes/sla_view.php, + operation/agentes/estado_ultimopaquete.php: Replaced time + function with get_system_time + + * operation/reporting/reporting_viewer.php, + operation/reporting/reporting_xml.php, reporting/stat_win.php, + godmode/agentes/configurar_agente.php: Function renaming + + * include/functions_reporting.php, include/functions_db.php, + operation/agentes/exportdata.php, + operation/agentes/estado_generalagente.php, reporting/fgraph.php, + godmode/db/db_info.php, godmode/db/db_purge.php, + godmode/agentes/modificar_agente.php: Made tagente_datos.id_agente + redundant by using the internal functions and separate queries. + 2009-01-08 Evi Vanoost * general/footer.php: Made image link relative. It wasn't working for me. diff --git a/pandora_console/general/footer.php b/pandora_console/general/footer.php index 0f657f10a3..b0e9087a01 100644 --- a/pandora_console/general/footer.php +++ b/pandora_console/general/footer.php @@ -20,7 +20,7 @@ if (isset($_SERVER['REQUEST_TIME'])) { $time = $_SERVER['REQUEST_TIME']; } else { - $time = time(); + $time = get_system_time (); } echo 'Pandora FMS '.$pandora_version.' - Build '.$build_version.'
'; diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 6ce35d9083..8187fc6e43 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -252,7 +252,7 @@ if (isset ($_POST["create_agent"])) { if (isset($_GET["fix_module"])){ $id_module = get_parameter_get ("fix_module",0); // get info about this module - $media = get_agent_module_value_average ($id_module, 30758400); //Get average over the year + $media = get_agentmodule_data_average ($id_module, 30758400); //Get average over the year $media *= 1.3; $error = ""; //If the value of media is 0 or something went wrong, don't delete diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 386700875b..7ae88f3e51 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -39,6 +39,7 @@ if (isset ($_GET["borrar_agente"])) { // if delete agent $id_agente = get_parameter_get ("borrar_agente"); $agent_name = get_agent_name ($id_agente); $id_grupo = dame_id_grupo ($id_agente); + $modules = array_keys (get_agent_modules ($id_agente)); if (give_acl ($config["id_user"], $id_grupo, "AW")==1) { //Start transaction - this improves consistency process_sql ("SET AUTOCOMMIT=0;"); @@ -55,29 +56,28 @@ if (isset ($_GET["borrar_agente"])) { // if delete agent if (process_sql ($sql_delete) === false) $del_error++; - // Delete tagente_datos data - $sql_delete = "DELETE FROM tagente_datos WHERE id_agente = ".$id_agente; - if (process_sql ($sql_delete) === false) - $del_error++; + if (!empty ($modules) { + // Delete tagente_datos data + $sql_delete = "DELETE FROM tagente_datos WHERE id_agente_modulo IN (".implode (",",$modules).")"; + if (process_sql ($sql_delete) === false) + $del_error++; - // Delete tagente_datos_string data - $sql_delete = "DELETE FROM tagente_datos_string WHERE id_agente = ".$id_agente; - if (process_sql ($sql_delete) === false) - $del_error++; + // Delete tagente_datos_string data + $sql_delete = "DELETE FROM tagente_datos_string WHERE id_agente_modulo IN (".implode (",",$modules).")"; + if (process_sql ($sql_delete) === false) + $del_error++; - // Delete from tagente_datos - relies on id_agente_modulo - $sql_delete = "DELETE FROM tagente_datos_inc WHERE - id_agente_modulo = ANY(SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = ".$id_agente.")"; - if (process_sql ($sql_delete) === false) - $del_error++; - - // Delete alerts from talerta_agente_modulo - relies on - // id_agente_modulo - $sql_delete = "DELETE FROM talerta_agente_modulo WHERE - id_agente_modulo = ANY(SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = ".$id_agente.")"; - if (process_sql ($sql_delete) === false) - $del_error++; + // Delete from tagente_datos - relies on id_agente_modulo + $sql_delete = "DELETE FROM tagente_datos_inc WHERE id_agente_modulo IN (".implode (",",$modules).")"; + if (process_sql ($sql_delete) === false) + $del_error++; + // Delete alerts from talerta_agente_modulo - relies on + // id_agente_modulo + $sql_delete = "DELETE FROM talerta_agente_modulo WHERE id_agente_modulo IN (".implode (",",$modules).")"; + if (process_sql ($sql_delete) === false) + $del_error++; + } // Delete from tagente_modulo $sql_delete ="DELETE FROM tagente_modulo WHERE id_agente = ".$id_agente; if (process_sql ($sql_delete) === false) diff --git a/pandora_console/godmode/db/db_info.php b/pandora_console/godmode/db/db_info.php index d7d59c6c0f..6cf20e9f6f 100644 --- a/pandora_console/godmode/db/db_info.php +++ b/pandora_console/godmode/db/db_info.php @@ -53,6 +53,7 @@ echo ''.__('Press here to get database information as text').'
'; echo '