summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extensions/Review/Extension.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm
index f15bdc9ef..c2951d29b 100644
--- a/extensions/Review/Extension.pm
+++ b/extensions/Review/Extension.pm
@@ -80,6 +80,7 @@ sub _bug_mentors {
if (!exists $self->{mentors}) {
my @mentors;
my $whiteboard = $self->status_whiteboard;
+ my $logout = 0;
while ($whiteboard =~ /\[mentor=([^\]]+)\]/g) {
my $mentor_string = $1;
my $user;
@@ -89,6 +90,13 @@ sub _bug_mentors {
} else {
# otherwise assume it's a : prefixed nick. only works if a
# single user matches.
+
+ # we need to be logged in to do user searching
+ if (!Bugzilla->user->id) {
+ Bugzilla->set_user(Bugzilla::User->check({ name => 'nobody@mozilla.org' }));
+ $logout = 1;
+ }
+
foreach my $query ("*:$mentor_string*", "*$mentor_string*") {
my $matches = Bugzilla::User::match($query, 2);
if ($matches && scalar(@$matches) == 1) {
@@ -99,6 +107,7 @@ sub _bug_mentors {
}
push @mentors, $user if $user;
}
+ Bugzilla->logout_request() if $logout;
$self->{mentors} = \@mentors;
}
return $self->{mentors};