diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 70b87ec7d0..44676647f8 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2010-04-29 Sergio Martin + + * godmode/servers/manage_recontask.php: Fixed the creation + of recon task without name and network. Also, the network + is checked by the following regular expression + "/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/" + 2010-04-29 Sergio Martin * godmode/reporting/visual_console_builder.php: Fixed that diff --git a/pandora_console/godmode/servers/manage_recontask.php b/pandora_console/godmode/servers/manage_recontask.php index c476ba5d3b..02b7d3f194 100644 --- a/pandora_console/godmode/servers/manage_recontask.php +++ b/pandora_console/godmode/servers/manage_recontask.php @@ -68,7 +68,12 @@ if (isset($_GET["update"])) { description = '%s', id_recon_server = %d, create_incident = %b, id_group = %d, interval_sweep = %u, id_network_profile = %d, recon_ports = '%s' WHERE id_rt = %u",$id_os,$name,$network,$description,$id_recon_server,$create_incident,$id_group,$interval,$id_network_profile,$recon_ports, $id); - if (process_sql ($sql) !== false) { + if($name != "" && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) + $result = process_sql ($sql); + else + $result = false; + + if ($result !== false) { echo '

'.__('Successfully updated recon task').'

'; } else { echo '

'.__('Error updating recon task').'

'; @@ -83,7 +88,13 @@ if (isset($_GET["create"])) { (name, subnet, description, id_recon_server, create_incident, id_group, id_network_profile, interval_sweep, id_os, recon_ports) VALUES ( '%s', '%s', '%s', %u, %b, %d, %d, %u, %d, '%s')",$name,$network,$description,$id_recon_server,$create_incident,$id_group,$id_network_profile,$interval,$id_os, $recon_ports); - if (process_sql ($sql) !== false) { + if($name != "" && preg_match("/[0-9]+.+[0-9]+.+[0-9]+.+[0-9]+\/+[0-9]/", $network)) + $result = process_sql ($sql); + else + $result = false; + + + if ($result !== false) { echo '

'.__('Successfully created recon task').'

'; } else { echo '

'.__('Error creating recon task').'

';