diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 95bc625ddb..5aded80216 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2011-08-09 Vanessa Gil + + * godmode/groups/group_list.php: Added groups must have a name and be unique. + 2011-08-09 Juan Manuel Ramon * godmode/groups/group_list.php: Added db_clean_cache() in order diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 40b46adb27..705ff7f223 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -111,28 +111,35 @@ if ($create_group) { $alerts_disabled = (bool) get_parameter ('alerts_disabled'); $custom_id = (string) get_parameter ('custom_id'); $skin = (string) get_parameter ('skin'); +$check = db_get_value('nombre', 'tgrupo', 'nombre', $name); + /*Check if name field is empty*/ if ($name != "") { - $values = array( - 'nombre' => $name, - 'icon' => substr ($icon, 0, -4), - 'parent' => $id_parent, - 'disabled' => $alerts_disabled, - 'custom_id' => $custom_id, - 'id_skin' => $skin - ); + if (!$check){ + $values = array( + 'nombre' => $name, + 'icon' => substr ($icon, 0, -4), + 'parent' => $id_parent, + 'disabled' => $alerts_disabled, + 'custom_id' => $custom_id, + 'id_skin' => $skin + ); - $result = db_process_sql_insert('tgrupo', $values); - } - else { - $result = false; - } - - if ($result) { - echo "

".__('Group successfully created')."

"; + $result = db_process_sql_insert('tgrupo', $values); + if ($result) { + echo "

".__('Group successfully created')."

"; + } else { + echo "

".__('There was a problem creating group')."

"; + } + } else { + echo "

".__('Each group must have a different name')."

"; + } } else { - echo "

".__('There was a problem creating group')."

"; } + //$result = false; + echo "

".__('Group must have a name')."

"; + } + } /* Update group */