From bc557573ec453c790f378d7789571b5f056f0d4c Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 23 Aug 2017 10:19:56 +0200 Subject: [PATCH] Fixed combo in editor --- .../include/functions_networkmap.php | 2 +- .../include/functions_pandora_networkmap.php | 8 +++-- .../operation/agentes/pandora_networkmap.php | 30 ++++++++++++++++++- .../agentes/pandora_networkmap.view.php | 1 + 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_networkmap.php b/pandora_console/include/functions_networkmap.php index c775ef0329..7393c083e9 100644 --- a/pandora_console/include/functions_networkmap.php +++ b/pandora_console/include/functions_networkmap.php @@ -1447,7 +1447,7 @@ function networkmap_open_graph ($layout, $nooverlap, $pure, $zoom, $head .= "size=\"$size\";"; $head .= "\n"; - + return $head; } diff --git a/pandora_console/include/functions_pandora_networkmap.php b/pandora_console/include/functions_pandora_networkmap.php index 641f9e850b..4048ee5072 100644 --- a/pandora_console/include/functions_pandora_networkmap.php +++ b/pandora_console/include/functions_pandora_networkmap.php @@ -69,6 +69,7 @@ function networkmap_process_networkmap($id = 0) { $layout = "spring2"; break; } + $simple = 0; $font_size = 12; $nooverlap = false; @@ -85,7 +86,7 @@ function networkmap_process_networkmap($id = 0) { case 1: $recon_task = db_get_row_filter('trecon_task', array('id_rt' => $networkmap['source_data'])); - + $ip_mask = $recon_task['subnet']; break; case 2: @@ -140,7 +141,7 @@ function networkmap_process_networkmap($id = 0) { $filename_dot .= "_nooverlap"; } $filename_dot .= "_" . $id . ".dot"; - + file_put_contents($filename_dot, $graph); switch (PHP_OS) { @@ -154,11 +155,12 @@ function networkmap_process_networkmap($id = 0) { break; default: $filename_plain = sys_get_temp_dir() . "/plain.txt"; + $cmd = "$filter -Tplain -o " . $filename_plain . " " . $filename_dot; break; } - + system ($cmd); unlink($filename_dot); diff --git a/pandora_console/operation/agentes/pandora_networkmap.php b/pandora_console/operation/agentes/pandora_networkmap.php index 85acec24d5..2c1bd6f29c 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.php +++ b/pandora_console/operation/agentes/pandora_networkmap.php @@ -207,12 +207,14 @@ else if ($update_networkmap || $copy_networkmap || $delete) { $recon_task_id = (int) get_parameter( 'recon_task_id', 0); - + $source = (string)get_parameter('source', 'group'); $values = array(); $values['name'] = $name; $values['id_group'] = $id_group; + + /* if ($source == 'group') { $values['source'] = 0; $values['source_data'] = $id_group; @@ -225,6 +227,32 @@ else if ($update_networkmap || $copy_networkmap || $delete) { $values['source'] = 2; $values['source_data'] = $ip_mask; } + */ + + switch ($method) { + case 'twopi': + $values['generation_method'] = 2; + break; + case 'dot': + $values['generation_method'] = 1; + break; + case 'circo': + $values['generation_method'] = 0; + break; + case 'neato': + $values['generation_method'] = 3; + break; + case 'fdp': + $values['generation_method'] = 4; + break; + case 'radial_dinamic': + $values['generation_method'] = 6; + break; + default: + $values['generation_method'] = 2; + break; + } + $description = get_parameter('description', ''); $values['description'] = $description; diff --git a/pandora_console/operation/agentes/pandora_networkmap.view.php b/pandora_console/operation/agentes/pandora_networkmap.view.php index 5b34ee442c..5c5d2969c4 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.view.php +++ b/pandora_console/operation/agentes/pandora_networkmap.view.php @@ -756,6 +756,7 @@ else { } $nodes_and_relations = networkmap_process_networkmap($id); + show_networkmap($id, $user_readonly, $nodes_and_relations, $dash_mode, $map_dash_details); } ?>