Now when don't creates manage recontask, comes back to the creation page with the anterior values. Ticket #2543

This commit is contained in:
Arturo Gonzalez Diaz 2015-08-18 17:05:31 +02:00
parent a18484ffa2
commit d8e65e7595
2 changed files with 22 additions and 6 deletions

View File

@ -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;
}
}

View File

@ -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) {