2012-10-11 Dario Rodriguez <dario.rodriguez@artica.es>

* godmode/reporting/graph_builder.php: Fixed a problem
        with entities and custom graph wizard to add new modules.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7068 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2012-10-11 11:02:51 +00:00
parent 55fe5262bc
commit 99a77e2596
2 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2012-10-11 Dario Rodriguez <dario.rodriguez@artica.es>
* godmode/reporting/graph_builder.php: Fixed a problem
with entities and custom graph wizard to add new modules.
2012-10-11 Miguel de Dios <miguel.dedios@artica.es> 2012-10-11 Miguel de Dios <miguel.dedios@artica.es>
* include/ajax/networkmap.ajax.php: added the code for the * include/ajax/networkmap.ajax.php: added the code for the

View File

@ -139,13 +139,21 @@ if ($add_module) {
$id_modules = get_parameter('module'); $id_modules = get_parameter('module');
$id_agents = get_parameter('id_agents'); $id_agents = get_parameter('id_agents');
$weight = get_parameter('weight'); $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 (". $id_agent_modules = db_get_all_rows_sql("SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente IN (".
implode(',', $id_agents). implode(',', $id_agents).
") AND nombre IN ('". ") AND nombre IN ('".
implode("','", $id_modules). implode("','", $id_modules).
"')"); "')");
if (count($id_agent_modules) > 0 && $id_agent_modules != '') { if (count($id_agent_modules) > 0 && $id_agent_modules != '') {
foreach($id_agent_modules as $id_agent_module) 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)); $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'); require_once('godmode/reporting/graph_builder.graph_editor.php');
break; break;
} }
?> ?>