summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
authorbbaetz%student.usyd.edu.au <>2002-11-09 10:58:02 +0100
committerbbaetz%student.usyd.edu.au <>2002-11-09 10:58:02 +0100
commitc39803cc45e621f01e0598c7fb875f5e494ebd14 (patch)
treed5d74424513f12226010fb44f15ef01427bfaa19 /CGI.pl
parent3619b6e9f63fd0c1352a3eeddb8339e1bc362e57 (diff)
downloadbugzilla-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.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/CGI.pl b/CGI.pl
index 2069d9235..9ff485265 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -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;
}