summaryrefslogtreecommitdiffstats
path: root/userprefs.cgi
diff options
context:
space:
mode:
authormyk%mozilla.org <>2002-03-01 22:20:07 +0100
committermyk%mozilla.org <>2002-03-01 22:20:07 +0100
commit8e855f2dcd3f80aa2a1f4d17ba46f96eae05b99e (patch)
treef88cca1c661899c42d565bd6e8b5634596e79c6b /userprefs.cgi
parentab4e4fe77939e9489aafde4ccc4fb2730e075a1a (diff)
downloadbugzilla-8e855f2dcd3f80aa2a1f4d17ba46f96eae05b99e.tar.gz
bugzilla-8e855f2dcd3f80aa2a1f4d17ba46f96eae05b99e.tar.xz
Fix for bug 128422: Fixes serious tree horkage where everyone gets email on all changes regardless of email preferences.
Fix by Myk Melez <myk@mozilla.org>. r=gerv@mozilla.org, waiting on second review but checking in now due to severity of bug.
Diffstat (limited to 'userprefs.cgi')
-rwxr-xr-xuserprefs.cgi22
1 files changed, 15 insertions, 7 deletions
diff --git a/userprefs.cgi b/userprefs.cgi
index d86282d08..fbac113a0 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -45,10 +45,12 @@ my $userid;
# The default email flags leave all email on.
my $defaultflagstring = "ExcludeSelf~on~";
-foreach my $role ("Owner", "Reporter", "QAcontact", "CClist", "Voter") {
- foreach my $reason ("Removeme", "Comments", "Attachments", "Status",
- "Resolved", "Keywords", "CC", "Other")
- {
+my @roles = ("Owner", "Reporter", "QAcontact", "CClist", "Voter");
+my @reasons = ("Removeme", "Comments", "Attachments", "Status", "Resolved",
+ "Keywords", "CC", "Other");
+
+foreach my $role (@roles) {
+ foreach my $reason (@reasons) {
$defaultflagstring .= "email$role$reason~on~";
}
}
@@ -174,9 +176,15 @@ sub SaveEmail {
$updateString .= 'ExcludeSelf~';
}
- foreach my $key (keys %::FORM) {
- if ($key =~ /email([A-Z]+[a-z]+)([A-Z]+[a-z]*)/) {
- $updateString .= "~$key~on";
+ foreach my $role (@roles) {
+ foreach my $reason (@reasons) {
+ # Add this preference to the list without giving it a value,
+ # which is the equivalent of setting the value to "off."
+ $updateString .= "~email$role$reason~";
+
+ # If the form field for this preference is defined, then we
+ # know the checkbox was checked, so set the value to "on".
+ $updateString .= "on" if defined $::FORM{"email$role$reason"};
}
}