]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 365302 email userprefs doesn't tell you if you are a globalwatcher
authortimeless%mozdev.org <>
Sun, 22 Jul 2007 20:40:13 +0000 (20:40 +0000)
committertimeless%mozdev.org <>
Sun, 22 Jul 2007 20:40:13 +0000 (20:40 +0000)
r=lpsolit a=lpsolit

Bugzilla/User.pm

index 3e952e56df96fd801e9d35a77cc17dfeb02a9dd5..d37636c85e84068a0ed43394ad61a9b4e48b7451 100644 (file)
@@ -1486,6 +1486,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;
 
@@ -2028,6 +2038,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<is_global_watcher>
+
+Returns true if the user is a global watcher,
+i.e. if the 'globalwatchers' parameter contains the user.
+
 =back
 
 =head1 CLASS FUNCTIONS