From b3389a8ce4312bbb7e27ffd17d454c35150c5888 Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" <> Date: Sun, 22 Jul 2007 20:08:09 +0000 Subject: Bug 365302 email userprefs doesn't tell you if you are a globalwatcher r=lpsolit a=lpsolit --- Bugzilla/User.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'Bugzilla/User.pm') diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index f13b94fbf..1a9729ee9 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -1513,6 +1513,16 @@ sub is_insider { return $self->{'is_insider'}; } +sub is_global_watcher { + my $self = shift; + + if (!defined $self->{'is_global_watcher'}) { + my @watchers = split(/[,\s]+/, Bugzilla->params->{'globalwatchers'}); + $self->{'is_global_watcher'} = grep { $_ eq $self->login } @watchers; + } + return $self->{'is_global_watcher'}; +} + sub get_userlist { my $self = shift; @@ -2055,6 +2065,11 @@ moving is enabled. Returns true if the user can access private comments and attachments, i.e. if the 'insidergroup' parameter is set and the user belongs to this group. +=item C + +Returns true if the user is a global watcher, +i.e. if the 'globalwatchers' parameter contains the user. + =back =head1 CLASS FUNCTIONS -- cgit v1.2.3-24-g4f1b