diff options
author | bbaetz%acm.org <> | 2003-06-03 18:47:37 +0200 |
---|---|---|
committer | bbaetz%acm.org <> | 2003-06-03 18:47:37 +0200 |
commit | 1d057f02b277d29ad4d232d598c49b0344798b40 (patch) | |
tree | 5dd73500b1cf10b51875179f7559c8ec97f0b5be /Bugzilla/Search.pm | |
parent | 3a843833f4ab5d07f10e199daa7ec317e03b9959 (diff) | |
download | bugzilla-1d057f02b277d29ad4d232d598c49b0344798b40.tar.gz bugzilla-1d057f02b277d29ad4d232d598c49b0344798b40.tar.xz |
Bug 180635 - Enhance Bugzilla::User to store additional information
r=myk,jake
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r-- | Bugzilla/Search.pm | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 45c26fdf2..df2ab58e3 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -926,28 +926,31 @@ sub init { # Make sure we create a legal SQL query. @andlist = ("1 = 1") if !@andlist; + my $user = Bugzilla->user; + my $query = "SELECT " . join(', ', @fields) . " FROM $suppstring" . " LEFT JOIN bug_group_map " . " ON bug_group_map.bug_id = bugs.bug_id "; - if (defined @{$::vars->{user}{groupids}} && @{$::vars->{user}{groupids}} > 0) { - $query .= " AND bug_group_map.group_id NOT IN (" . join(',', @{$::vars->{user}{groupids}}) . ") "; - } + if ($user) { + if (%{$user->groups}) { + $query .= " AND bug_group_map.group_id NOT IN (" . join(',', values(%{$user->groups})) . ") "; + } - if ($::vars->{user}{userid}) { - $query .= " LEFT JOIN cc ON cc.bug_id = bugs.bug_id AND cc.who = $::userid "; + $query .= " LEFT JOIN cc ON cc.bug_id = bugs.bug_id AND cc.who = " . $user->id; } $query .= " WHERE " . join(' AND ', (@wherepart, @andlist)) . " AND ((bug_group_map.group_id IS NULL)"; - if ($::vars->{user}{userid}) { - $query .= " OR (bugs.reporter_accessible = 1 AND bugs.reporter = $::userid) " . + if ($user) { + my $userid = $user->id; + $query .= " OR (bugs.reporter_accessible = 1 AND bugs.reporter = $userid) " . " OR (bugs.cclist_accessible = 1 AND cc.who IS NOT NULL) " . - " OR (bugs.assigned_to = $::userid) "; + " OR (bugs.assigned_to = $userid) "; if (Param('useqacontact')) { - $query .= "OR (bugs.qa_contact = $::userid) "; + $query .= "OR (bugs.qa_contact = $userid) "; } } |