From 64fed83bbf1f8a7f289986044bb16dfeaa880b8f Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Diaz Date: Tue, 18 Aug 2015 16:59:43 +0200 Subject: [PATCH] Now when don't creates manage recontask, comes back to the creation page with the anterior values. Ticket #2543. --- .../godmode/servers/manage_recontask.php | 12 +++++++++++- .../godmode/servers/manage_recontask_form.php | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index 68e8f2acd2..69898a1d13 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -178,6 +178,8 @@ if (isset($_GET["update"])) { else { ui_print_error_message(__('Error updating recon task')); echo $reason; + include('manage_recontask_form.php'); + return; } } @@ -237,7 +239,13 @@ if (isset($_GET["create"])) { } } else { - $result = db_process_sql_insert('trecon_task', $values); + if ($name_exists){ + $reason = __('Recon-task name already exists'); + $result = false; + } + else{ + $result = db_process_sql_insert('trecon_task', $values); + } } } else { @@ -251,6 +259,8 @@ if (isset($_GET["create"])) { else { ui_print_error_message(__('Error creating recon task')); echo $reason; + include('manage_recontask_form.php'); + return; } } diff --git a/pandora_console/godmode/servers/manage_recontask_form.php b/pandora_console/godmode/servers/manage_recontask_form.php index 50dc2cd998..e17f75827a 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -146,9 +146,9 @@ elseif (isset($_GET["create"]) || isset($_GET["crt"])) { if ($create_recon) { $id_rt = -1; - $name = ""; - $network = ""; - $description = ""; + $name = get_parameter('name'); + $network = get_parameter('network'); + $description = get_parameter('description'); $id_recon_server = 0; $interval = 0; $id_group = 0; @@ -169,10 +169,18 @@ elseif (isset($_GET["create"]) || isset($_GET["crt"])) { $parent_recursion = 5; $macros = ''; } + + $modify = false; + if (($name != '') || ($network != '')){ + $modify = true; + } +} + +if (!$modify){ + // Headers + ui_print_page_header (__('Manage recontask'), "", false, "recontask", true); } -// Headers -ui_print_page_header (__('Manage recontask'), "", false, "recontask", true); $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; if ($is_windows) {