}
}
- if (Bugzilla->params->{"supportwatchers"}) {
- # Find all those user-watching anyone on the current list, who is not
- # on it already themselves.
- my $involved = join(",", keys %recipients);
-
- my $userwatchers =
- $dbh->selectall_arrayref("SELECT watcher, watched FROM watch
- WHERE watched IN ($involved)");
-
- # Mark these people as having the role of the person they are watching
- foreach my $watch (@$userwatchers) {
- while (my ($role, $bits) = each %{$recipients{$watch->[1]}}) {
- $recipients{$watch->[0]}->{$role} |= BIT_WATCHING
- if $bits & BIT_DIRECT;
- }
- push (@{$watching{$watch->[0]}}, $watch->[1]);
+ # Find all those user-watching anyone on the current list, who is not
+ # on it already themselves.
+ my $involved = join(",", keys %recipients);
+
+ my $userwatchers =
+ $dbh->selectall_arrayref("SELECT watcher, watched FROM watch
+ WHERE watched IN ($involved)");
+
+ # Mark these people as having the role of the person they are watching
+ foreach my $watch (@$userwatchers) {
+ while (my ($role, $bits) = each %{$recipients{$watch->[1]}}) {
+ $recipients{$watch->[0]}->{$role} |= BIT_WATCHING
+ if $bits & BIT_DIRECT;
}
+ push(@{$watching{$watch->[0]}}, $watch->[1]);
}
# Global watcher
name => 'allowuserdeletion',
type => 'b',
default => 0
- },
-
- {
- name => 'supportwatchers',
- type => 'b',
- default => 0
- } );
+ });
return @param_list;
}
<section id="param-admin-policies">
<title>Administrative Policies</title>
- <para>
- This page contains parameters for basic administrative functions.
- Options include whether to allow the deletion of bugs and users, whether
- to allow users to change their email address, and whether to allow
- user watching (one user receiving all notifications of a selected
- other user).
- </para>
-
- <variablelist>
-
- <varlistentry>
- <term>
- supportwatchers
- </term>
- <listitem>
- <para>
- Turning on this option allows users to ask to receive copies
- of bug mail sent to another user. Watching a user with
- different group permissions is not a way to 'get around' the
- system; copied emails are still subject to the normal groupset
- permissions of a bug, and <quote>watchers</quote> will only be
- copied on emails from bugs they would normally be allowed to view.
- </para>
- </listitem>
- </varlistentry>
-
- </variablelist>
-
+ <para>
+ This page contains parameters for basic administrative functions.
+ Options include whether to allow the deletion of bugs and users,
+ and whether to allow users to change their email address.
+ </para>
</section>
<section id="param-user-authentication">
# below), keyed by reasonname (e.g. comments; again, see
# below). The value is a boolean - true if the user is
# receiving mail for that reason when in that role.
- # Also references the 'supportwatchers' Param.
#%]
[% PROCESS global/variables.none.tmpl %]
[% END %]
[% END %]
-[% IF Param('supportwatchers') %]
<hr>
<b>User Watching</b>
[% END %]
</p>
-[% END %]
-
<hr>
<br>
"$terms.Bugzilla will issue a warning in case you'd run into inconsistencies " _
"when you're about to do so, but such deletions remain kinda scary. " _
"So, you have to turn on this option before any such deletions " _
- "will ever happen.",
-
- supportwatchers => "Support one user watching (ie getting copies of all related " _
- "email about) another's ${terms.bugs}. Useful for people going on " _
- "vacation, and QA folks watching particular developers' ${terms.bugs}." }
+ "will ever happen." }
%]
\ No newline at end of file
###########################################################################
# User watching
###########################################################################
- if (Bugzilla->params->{"supportwatchers"}) {
- my $watched_ref = $dbh->selectcol_arrayref(
- "SELECT profiles.login_name FROM watch INNER JOIN profiles" .
- " ON watch.watched = profiles.userid" .
- " WHERE watcher = ?" .
- " ORDER BY profiles.login_name",
- undef, $user->id);
- $vars->{'watchedusers'} = $watched_ref;
-
- my $watcher_ids = $dbh->selectcol_arrayref(
- "SELECT watcher FROM watch WHERE watched = ?",
- undef, $user->id);
-
- my @watchers;
- foreach my $watcher_id (@$watcher_ids) {
- my $watcher = new Bugzilla::User($watcher_id);
- push (@watchers, Bugzilla::User::identity($watcher));
- }
-
- @watchers = sort { lc($a) cmp lc($b) } @watchers;
- $vars->{'watchers'} = \@watchers;
+ my $watched_ref = $dbh->selectcol_arrayref(
+ "SELECT profiles.login_name FROM watch INNER JOIN profiles" .
+ " ON watch.watched = profiles.userid" .
+ " WHERE watcher = ?" .
+ " ORDER BY profiles.login_name",
+ undef, $user->id);
+ $vars->{'watchedusers'} = $watched_ref;
+
+ my $watcher_ids = $dbh->selectcol_arrayref(
+ "SELECT watcher FROM watch WHERE watched = ?",
+ undef, $user->id);
+
+ my @watchers;
+ foreach my $watcher_id (@$watcher_ids) {
+ my $watcher = new Bugzilla::User($watcher_id);
+ push(@watchers, Bugzilla::User::identity($watcher));
}
+ @watchers = sort { lc($a) cmp lc($b) } @watchers;
+ $vars->{'watchers'} = \@watchers;
+
###########################################################################
# Role-based preferences
###########################################################################
my $cgi = Bugzilla->cgi;
my $user = Bugzilla->user;
- if (Bugzilla->params->{"supportwatchers"}) {
- Bugzilla::User::match_field($cgi, { 'new_watchedusers' => {'type' => 'multi'} });
- }
+ Bugzilla::User::match_field($cgi, { 'new_watchedusers' => {'type' => 'multi'} });
###########################################################################
# Role-based preferences
###########################################################################
# User watching
###########################################################################
- if (Bugzilla->params->{"supportwatchers"}
- && (defined $cgi->param('new_watchedusers')
- || defined $cgi->param('remove_watched_users')))
+ if (defined $cgi->param('new_watchedusers')
+ || defined $cgi->param('remove_watched_users'))
{
$dbh->bz_start_transaction();