Update recon-task changed. Ticket #2179

This commit is contained in:
Arturo Gonzalez Diaz 2015-07-23 15:51:39 +02:00
parent 4629d46408
commit 49b0ef565b
2 changed files with 15 additions and 5 deletions

View File

@ -155,10 +155,20 @@ if (isset($_GET["update"])) {
$reason = '';
if ($name != "") {
if ((empty($id_recon_script)) && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network))
if ((db_get_value_filter ('name', 'trecon_task', array ('name' => $name))) && (!preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network))){
$reason = __('Recon-task name already exists and incorrect format in Subnet field');
$result = false;
}
else if(db_get_value_filter ('name', 'trecon_task', array ('name' => $name))){
$reason = __('Recon-task name already exists');
$result = false;
}
else if ((empty($id_recon_script)) && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)){
$result = db_process_sql_update('trecon_task', $values, $where);
elseif (!empty($id_recon_script))
}
elseif (!empty($id_recon_script)){
$result = db_process_sql_update('trecon_task', $values, $where);
}
else {
if (!preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network))
$reason = __('Incorrect format in Subnet field');

View File

@ -80,11 +80,11 @@ if (is_ajax ()) {
}
// Edit mode
if (isset($_GET["update"]) || (isset($_GET["crt"]))) {
if (isset($_GET["update"]) || (isset($_GET["upd"]))) {
$update_recon = true;
if (isset($_GET["crt"])) {
if ($_GET["crt"] != "update") {
if (isset($_GET["upd"])) {
if ($_GET["upd"] != "update") {
$update_recon = false;
}
else {