summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search.pm
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2004-07-31 11:27:23 +0200
committerbugreport%peshkin.net <>2004-07-31 11:27:23 +0200
commit4c1db37570469aef2c7cc9f2ad9f859560ca8851 (patch)
tree17a519e7f08a85993b710ecd6d809bd9e4b40211 /Bugzilla/Search.pm
parent1ffd632931b05caea45f9c48079b455d156086be (diff)
downloadbugzilla-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.gz
bugzilla-4c1db37570469aef2c7cc9f2ad9f859560ca8851.tar.xz
Bug 253588: Change Bugzilla->user to be usable even for a logged-out user
patch by erik,joel r=kiko a=justdave
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r--Bugzilla/Search.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 00b213d54..6cff2940e 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -1172,7 +1172,7 @@ sub init {
" LEFT JOIN bug_group_map " .
" ON bug_group_map.bug_id = bugs.bug_id ";
- if ($user) {
+ if ($user->id) {
if (%{$user->groups}) {
$query .= " AND bug_group_map.group_id NOT IN (" . join(',', values(%{$user->groups})) . ") ";
}
@@ -1183,7 +1183,7 @@ sub init {
$query .= " WHERE " . join(' AND ', (@wherepart, @andlist)) .
" AND ((bug_group_map.group_id IS NULL)";
- if ($user) {
+ if ($user->id) {
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) " .
@@ -1338,7 +1338,7 @@ sub getSQL {
sub pronoun {
my ($noun, $user) = (@_);
if ($noun eq "%user%") {
- if ($user) {
+ if ($user->id) {
return $user->id;
} else {
ThrowUserError('login_required_for_pronoun');