From 745445d6d402532e7031571182a11bf58b8849d7 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Fri, 12 Jun 2015 13:05:33 +0100 Subject: [PATCH] Fixed an error on oracle --- pandora_console/include/functions_agents.php | 10 +++++----- pandora_console/include/functions_db.php | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 10efa5790f..c44da599cb 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1681,7 +1681,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) { //Alert db_process_delete_temp ("talert_template_modules", - "id_agent_module", $where_modules); + "id_agent_module", $where_modules, true); //Events (up/down monitors) // Dont delete here, could be very time-exausting, let the daily script @@ -1690,11 +1690,11 @@ function agents_delete_agent ($id_agents, $disableACL = false) { //Graphs, layouts, reports & networkmapenterprise db_process_delete_temp ("tgraph_source", - "id_agent_module", $where_modules); + "id_agent_module", $where_modules, true); db_process_delete_temp ("tlayout_data", - "id_agente_modulo", $where_modules); + "id_agente_modulo", $where_modules, true); db_process_delete_temp ("treport_content", - "id_agent_module", $where_modules); + "id_agent_module", $where_modules, true); if (enterprise_installed()) { $nodes = db_get_all_rows_filter( "tnetworkmap_enterprise_nodes", @@ -1743,7 +1743,7 @@ function agents_delete_agent ($id_agents, $disableACL = false) { // tagente_datos_inc // Dont delete here, this records are deleted later, in database script - // db_process_delete_temp ("tagente_datos_inc", "id_agente_modulo", $where_modules); + // db_process_delete_temp ("tagente_datos_inc", "id_agente_modulo", $where_modules, true); // Delete remote configuration if (enterprise_installed()) { diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index f9dc206877..09e7fa73a8 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -848,10 +848,11 @@ function db_format_array_where_clause_sql ($values, $join = 'AND', $prefix = fal * @param string Table name * @param string Field of the filter condition * @param string Value of the filter + * @param bool The value will be appended without quotes * * @result Rows deleted or false if something goes wrong */ -function db_process_delete_temp ($table, $row, $value) { +function db_process_delete_temp ($table, $row, $value, $custom_value = false) { global $error; //Globalize the errors variable global $config; @@ -861,8 +862,8 @@ function db_process_delete_temp ($table, $row, $value) { $result = db_process_sql_delete ($table, $row.' = '.$value); break; case "oracle": - if (is_int ($value) || is_bool ($value) || - is_float ($value) || is_double ($value)) { + if ($custom_value || is_int ($value) || is_bool ($value) || + is_float ($value) || is_double ($value)) { $result = oracle_db_process_sql_delete_temp ($table, $row . ' = ' . $value); } else {