2011-07-29 Dario Rodriguez <dario.rodriguez@artica.es>

* godmode/modules/manage_network_templates_form.php: Fixed
        a bug with allows to create a module template without a
        name.

        Fixes: 3371381



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4653 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
darode 2011-07-29 11:30:46 +00:00
parent e162178d82
commit f7347f4ba4
2 changed files with 34 additions and 21 deletions

View File

@ -1,8 +1,18 @@
2011-07-29 Dario Rodriguez <dario.rodriguez@artica.es>
* godmode/modules/manage_network_templates_form.php: Fixed
a bug with allows to create a module template without a
name.
Fixes: 3371381
2011-07-29 Dario Rodriguez <dario.rodriguez@artica.es>
* include/functions_agents.php: Fixed a bug related to
wrong value for a foreach function.
Fixes: 3371341
2011-07-28 Sergio Martin <sergio.martin@artica.es>
* include/functions_networkmap.php: Added new mode to

View File

@ -74,28 +74,31 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
//Submitted form
$name = get_parameter_post ("name");
$description = get_parameter_post ("description");
if ($id_np > 0) {
//Profile exists
$values = array(
'name' => $name,
'description' => $description);
$result = db_process_sql_update('tnetwork_profile', $values, array('id_np' => $id_np));
if ($name != "") {
if ($id_np > 0) {
//Profile exists
$values = array(
'name' => $name,
'description' => $description);
$result = db_process_sql_update('tnetwork_profile', $values, array('id_np' => $id_np));
ui_print_result_message ($result !== false,
__('Successfully updated network profile'),
__('Error updating network profile'));
}
else {
//Profile doesn't exist
$values = array('name' => $name, 'description' => $description);
$result = db_process_sql_insert('tnetwork_profile', $values);
ui_print_result_message ($result,
__('Successfully added network profile'),
__('Error adding network profile'));
$id_np = (int) $result; //Will return either 0 (in case of error) or an int
}
ui_print_result_message ($result !== false,
__('Successfully updated network profile'),
__('Error updating network profile'));
}
else {
//Profile doesn't exist
$values = array('name' => $name, 'description' => $description);
$result = db_process_sql_insert('tnetwork_profile', $values);
ui_print_result_message ($result,
__('Successfully added network profile'),
__('Error adding network profile'));
$id_np = (int) $result; //Will return either 0 (in case of error) or an int
}
} else {
ui_print_result_message(false, "", _("Cannot create a template without name"));
}
}
elseif ($id_np > 0) {