diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index 646230f3a5..66dbe42be4 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -175,6 +175,8 @@ if (isset($_GET["update"])) { else { ui_print_error_message(__('Error updating recon task')); echo $reason; + include('manage_recontask_form.php'); + return; } } @@ -234,7 +236,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 { @@ -248,6 +256,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 194ca178a6..64c60296b1 100644 --- a/pandora_console/godmode/servers/manage_recontask_form.php +++ b/pandora_console/godmode/servers/manage_recontask_form.php @@ -126,9 +126,9 @@ elseif (isset ($_GET["create"]) or 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; @@ -149,10 +149,16 @@ elseif (isset ($_GET["create"]) or isset($_GET["crt"])) { $parent_recursion = 5; $macros = ''; } + $modify = false; + if (($name != '') || ($network != '')){ + $modify = true; + } } -// Headers -ui_print_page_header (__('Manage recontask'), "", false, "recontask", true); +if (!$modify){ + // Headers + ui_print_page_header (__('Manage recontask'), "", false, "recontask", true); +} $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'; if ($is_windows) {