summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/BugMail.pm14
-rw-r--r--Bugzilla/Constants.pm71
-rw-r--r--Bugzilla/User.pm14
3 files changed, 71 insertions, 28 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm
index 638b8a413..da41d4247 100644
--- a/Bugzilla/BugMail.pm
+++ b/Bugzilla/BugMail.pm
@@ -615,15 +615,6 @@ sub filterEmailGroup ($$$) {
SendSQL("SELECT emailflags FROM profiles WHERE userid = $userid");
my $prefs = FetchOneColumn();
- # If the user's preferences are empty, it means the user has not set
- # their mail preferences after the installation upgraded from a
- # version of Bugzilla without email preferences to one with them. In
- # this case, assume they want to receive all mail.
- if (!defined($prefs) || $prefs !~ /email/) {
- push(@recipients, $user);
- next;
- }
-
# Write the user's preferences into a Perl record indexed by
# preference name. We pass the value "255" to the split function
# because otherwise split will trim trailing null fields, causing
@@ -665,10 +656,7 @@ sub filterEmailGroup ($$$) {
}
# If the user prefers to be included in mail about this change,
- # or they haven't specified a preference for it (because they
- # haven't visited the email preferences page since the preference
- # was added, in which case we include them by default), add them
- # to the list of recipients.
+ # add them to the list of recipients.
foreach my $reason (@$reasons) {
my $pref = "email$role$reason";
if (!exists($prefs{$pref}) || $prefs{$pref} eq 'on') {
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm
index 1a9334f35..284506e15 100644
--- a/Bugzilla/Constants.pm
+++ b/Bugzilla/Constants.pm
@@ -25,7 +25,7 @@
# J. Paul Reed <preed@sigkill.com>
# Bradley Baetz <bbaetz@student.usyd.edu.au>
# Christopher Aillon <christopher@aillon.com>
-
+# Shane H. W. Travis <travis@sedsystems.ca>
package Bugzilla::Constants;
use strict;
@@ -51,6 +51,9 @@ use base qw(Exporter);
LOGOUT_CURRENT
LOGOUT_KEEP_CURRENT
+ DEFAULT_FLAG_EMAIL_SETTINGS
+ DEFAULT_EMAIL_SETTINGS
+
GRANT_DIRECT
GRANT_DERIVED
GRANT_REGEXP
@@ -122,6 +125,72 @@ use constant contenttypes =>
"ics" => "text/calendar" ,
};
+use constant DEFAULT_FLAG_EMAIL_SETTINGS =>
+ "~FlagRequestee~on" .
+ "~FlagRequester~on";
+
+# By default, almost all bugmail is turned on, with the exception
+# of CC list additions for anyone except the Assignee/Owner.
+# If you want to customize the default settings for new users at
+# your own site, ensure that each of the lines ends with either
+# "~on" or just "~" (for off).
+
+use constant DEFAULT_EMAIL_SETTINGS =>
+ "ExcludeSelf~on" .
+
+ "~FlagRequestee~on" .
+ "~FlagRequester~on" .
+
+ "~emailOwnerRemoveme~on" .
+ "~emailOwnerComments~on" .
+ "~emailOwnerAttachments~on" .
+ "~emailOwnerStatus~on" .
+ "~emailOwnerResolved~on" .
+ "~emailOwnerKeywords~on" .
+ "~emailOwnerCC~on" .
+ "~emailOwnerOther~on" .
+ "~emailOwnerUnconfirmed~on" .
+
+ "~emailReporterRemoveme~on" .
+ "~emailReporterComments~on" .
+ "~emailReporterAttachments~on" .
+ "~emailReporterStatus~on" .
+ "~emailReporterResolved~on" .
+ "~emailReporterKeywords~on" .
+ "~emailReporterCC~" .
+ "~emailReporterOther~on" .
+ "~emailReporterUnconfirmed~on" .
+
+ "~emailQAcontactRemoveme~on" .
+ "~emailQAcontactComments~on" .
+ "~emailQAcontactAttachments~on" .
+ "~emailQAcontactStatus~on" .
+ "~emailQAcontactResolved~on" .
+ "~emailQAcontactKeywords~on" .
+ "~emailQAcontactCC~" .
+ "~emailQAcontactOther~on" .
+ "~emailQAcontactUnconfirmed~on" .
+
+ "~emailCClistRemoveme~on" .
+ "~emailCClistComments~on" .
+ "~emailCClistAttachments~on" .
+ "~emailCClistStatus~on" .
+ "~emailCClistResolved~on" .
+ "~emailCClistKeywords~on" .
+ "~emailCClistCC~" .
+ "~emailCClistOther~on" .
+ "~emailCClistUnconfirmed~on" .
+
+ "~emailVoterRemoveme~on" .
+ "~emailVoterComments~on" .
+ "~emailVoterAttachments~on" .
+ "~emailVoterStatus~on" .
+ "~emailVoterResolved~on" .
+ "~emailVoterKeywords~on" .
+ "~emailVoterCC~" .
+ "~emailVoterOther~on" .
+ "~emailVoterUnconfirmed~on";
+
use constant GRANT_DIRECT => 0;
use constant GRANT_DERIVED => 1;
use constant GRANT_REGEXP => 2;
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index e66419941..373a65655 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -858,20 +858,6 @@ sub email_prefs {
my @reasons = qw(Removeme Comments Attachments Status Resolved Keywords
CC Other Unconfirmed);
- # If the prefs are empty, this user hasn't visited the email pane
- # of userprefs.cgi since before the change to use the "emailflags"
- # column, so initialize that field with the default prefs.
- if (!$flags) {
- # Create a default prefs string that causes the user to get all email.
- $flags = "ExcludeSelf~on~FlagRequestee~on~FlagRequester~on~";
- foreach my $role (@roles) {
- foreach my $reason (@reasons) {
- $flags .= "email$role$reason~on~";
- }
- }
- chop $flags;
- }
-
# Convert the prefs from the flags string from the database into
# a Perl record. The 255 param is here because split will trim
# any trailing null fields without a third param, which causes Perl