diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 91bc92fd80..0f8a8a1642 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-10-11 Dario Rodriguez + + * godmode/reporting/graph_builder.php: Fixed a problem + with entities and custom graph wizard to add new modules. + 2012-10-11 Miguel de Dios * include/ajax/networkmap.ajax.php: added the code for the diff --git a/pandora_console/godmode/reporting/graph_builder.php b/pandora_console/godmode/reporting/graph_builder.php index a46c905972..e6445f4547 100644 --- a/pandora_console/godmode/reporting/graph_builder.php +++ b/pandora_console/godmode/reporting/graph_builder.php @@ -139,13 +139,21 @@ if ($add_module) { $id_modules = get_parameter('module'); $id_agents = get_parameter('id_agents'); $weight = get_parameter('weight'); - + + //Id modules has double entities conversion + //Safe output remove all entities + io_safe_output_array($id_modules, ""); + + //We need to put the entities again + //to browse in db + io_safe_input_array($id_modules); + $id_agent_modules = db_get_all_rows_sql("SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente IN (". implode(',', $id_agents). ") AND nombre IN ('". implode("','", $id_modules). "')"); - + if (count($id_agent_modules) > 0 && $id_agent_modules != '') { foreach($id_agent_modules as $id_agent_module) $result = db_process_sql_insert('tgraph_source', array('id_graph' => $id_graph, 'id_agent_module' => $id_agent_module['id_agente_modulo'], 'weight' => $weight)); @@ -261,4 +269,4 @@ switch ($active_tab) { require_once('godmode/reporting/graph_builder.graph_editor.php'); break; } -?> \ No newline at end of file +?>