diff options
author | plegall <plg@piwigo.org> | 2005-01-17 21:02:43 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2005-01-17 21:02:43 +0000 |
commit | 0df0998ce33cdddf375e5118f4697ef311b4c8c9 (patch) | |
tree | 0c041b4a06898447db23d7ca194725fe833013c3 /admin | |
parent | 578026e7bbc7aecddee90a8c1d1ecf758444c1e9 (diff) |
- bug fixed : when trying to link a blank user to a group, only a french
hard coded message was displayed and a wrong SQL query was executed
git-svn-id: http://piwigo.org/svn/trunk@704 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/group_list.php | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/admin/group_list.php b/admin/group_list.php index 9b16cf883..cdf123f4e 100644 --- a/admin/group_list.php +++ b/admin/group_list.php @@ -84,14 +84,21 @@ elseif ( isset( $_POST['new'] ) ) elseif ( isset( $_POST['add'] ) ) { $userdata = getuserdata($_POST['username']); - if (!$userdata) echo "Utilisateur inexistant"; - - // create a new association between the user and a group - $query = 'INSERT INTO '.USER_GROUP_TABLE; - $query.= ' (user_id,group_id) VALUES'; - $query.= ' ('.$userdata['id'].','.$_POST['edit_group_id'].')'; - $query.= ';'; - pwg_query( $query ); + if (!$userdata) + { + array_push($error, $lang['user_err_unknown']); + } + else + { + // create a new association between the user and a group + $query = ' +INSERT INTO '.USER_GROUP_TABLE.' + (user_id,group_id) + VALUES + ('.$userdata['id'].','.$_POST['edit_group_id'].') +;'; + pwg_query($query); + } } elseif (isset( $_POST['deny_user'] )) { |