diff options
author | bbaetz%student.usyd.edu.au <> | 2002-11-09 10:58:02 +0100 |
---|---|---|
committer | bbaetz%student.usyd.edu.au <> | 2002-11-09 10:58:02 +0100 |
commit | c39803cc45e621f01e0598c7fb875f5e494ebd14 (patch) | |
tree | d5d74424513f12226010fb44f15ef01427bfaa19 /CGI.pl | |
parent | 3619b6e9f63fd0c1352a3eeddb8339e1bc362e57 (diff) | |
download | bugzilla-c39803cc45e621f01e0598c7fb875f5e494ebd14.tar.gz bugzilla-c39803cc45e621f01e0598c7fb875f5e494ebd14.tar.xz |
Bug 114696 - permission checking in queries not optimal
Patch by joel, dkl + me
r=myk, a=justdave
Diffstat (limited to 'CGI.pl')
-rw-r--r-- | CGI.pl | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -280,6 +280,7 @@ sub GetUserInfo { my %user; my @queries; my %groups; + my @groupids; # No info if not logged in return \%user if ($userid == 0); @@ -304,16 +305,18 @@ sub GetUserInfo { $user{'canblessany'} = UserCanBlessAnything(); - SendSQL("SELECT name FROM groups, user_group_map " . + SendSQL("SELECT DISTINCT id, name FROM groups, user_group_map " . "WHERE groups.id = user_group_map.group_id " . "AND user_id = $userid " . "AND NOT isbless"); while (MoreSQLData()) { - my ($name) = FetchSQLData(); + my ($id, $name) = FetchSQLData(); + push(@groupids,$id); $groups{$name} = 1; } $user{'groups'} = \%groups; + $user{'groupids'} = \@groupids; return \%user; } |