Commit 88458a65 authored by dmose%mozilla.org's avatar dmose%mozilla.org

patch from bug 17464 to give user some control over what sorts of bug mail get…

patch from bug 17464 to give user some control over what sorts of bug mail get sent to an account. Original patch by al_raetz@yahoo.com and lots of additional hacking by me; r=donm@bluemartini.com
parent 63ececeb
...@@ -748,6 +748,7 @@ $table{profiles} = ...@@ -748,6 +748,7 @@ $table{profiles} =
newemailtech tinyint not null, newemailtech tinyint not null,
mybugslink tinyint not null default 1, mybugslink tinyint not null default 1,
blessgroupset bigint not null, blessgroupset bigint not null,
emailflags mediumtext,
unique(login_name)'; unique(login_name)';
...@@ -1868,6 +1869,13 @@ unless (-d 'graphs') { ...@@ -1868,6 +1869,13 @@ unless (-d 'graphs') {
} }
} }
#
# 2000-12-18. Added an 'emailflags' field for storing preferences about
# when email gets sent on a per-user basis.
#
if (!GetFieldDef('profiles', 'emailflags')) {
AddField('profiles', 'emailflags', 'mediumtext');
}
# #
# If you had to change the --TABLE-- definition in any way, then add your # If you had to change the --TABLE-- definition in any way, then add your
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
# Contributor(s): Holger Schurig <holgerschurig@nikocity.de> # Contributor(s): Holger Schurig <holgerschurig@nikocity.de>
# Dave Miller <dave@intrec.com> # Dave Miller <dave@intrec.com>
# Joe Robins <jmrobins@tgix.com> # Joe Robins <jmrobins@tgix.com>
# Dan Mosedale <dmose@mozilla.org>
# #
# Direct any questions on this source code to # Direct any questions on this source code to
# #
...@@ -38,6 +39,7 @@ require "globals.pl"; ...@@ -38,6 +39,7 @@ require "globals.pl";
sub sillyness { sub sillyness {
my $zz; my $zz;
$zz = $::userid; $zz = $::userid;
$zz = $::superusergroupset;
} }
my $editall; my $editall;
...@@ -95,10 +97,10 @@ sub EmitElement ($$) ...@@ -95,10 +97,10 @@ sub EmitElement ($$)
# Displays the form to edit a user parameters # Displays the form to edit a user parameters
# #
sub EmitFormElements ($$$$$$$) sub EmitFormElements ($$$$$$$$)
{ {
my ($user, $password, $realname, $groupset, $blessgroupset, my ($user, $password, $realname, $groupset, $blessgroupset,
$emailnotification, $disabledtext) = @_; $emailnotification, $disabledtext, $newemailtech) = @_;
print " <TH ALIGN=\"right\">Login name:</TH>\n"; print " <TH ALIGN=\"right\">Login name:</TH>\n";
EmitElement("user", $user); EmitElement("user", $user);
...@@ -116,10 +118,14 @@ sub EmitFormElements ($$$$$$$) ...@@ -116,10 +118,14 @@ sub EmitFormElements ($$$$$$$)
print " <TD><INPUT TYPE=\"PASSWORD\" SIZE=16 MAXLENGTH=16 NAME=\"password\" VALUE=\"$password\"></TD>\n"; print " <TD><INPUT TYPE=\"PASSWORD\" SIZE=16 MAXLENGTH=16 NAME=\"password\" VALUE=\"$password\"></TD>\n";
} }
print "</TR><TR>\n"; print "</TR><TR>\n";
if (!$newemailtech) {
print " <TH ALIGN=\"right\">Email notification:</TH>\n"; print " <TH ALIGN=\"right\">Email notification:</TH>\n";
print qq{<TD><SELECT NAME="emailnotification">}; print qq{<TD><SELECT NAME="emailnotification">};
foreach my $i (["ExcludeSelfChanges", "All qualifying bugs except those which I change"], foreach my $i (["ExcludeSelfChanges",
["CConly", "Only those bugs which I am listed on the CC line"], "All qualifying bugs except those which I change"],
["CConly",
"Only those bugs which I am listed on the CC line"],
["All", "All qualifying bugs"]) { ["All", "All qualifying bugs"]) {
my ($tag, $desc) = (@$i); my ($tag, $desc) = (@$i);
my $selectpart = ""; my $selectpart = "";
...@@ -130,6 +136,8 @@ sub EmitFormElements ($$$$$$$) ...@@ -130,6 +136,8 @@ sub EmitFormElements ($$$$$$$)
} }
print "</SELECT></TD>\n"; print "</SELECT></TD>\n";
print "</TR><TR>\n"; print "</TR><TR>\n";
}
print " <TH ALIGN=\"right\">Disable text:</TH>\n"; print " <TH ALIGN=\"right\">Disable text:</TH>\n";
print " <TD ROWSPAN=2><TEXTAREA NAME=\"disabledtext\" ROWS=10 COLS=60>" . print " <TD ROWSPAN=2><TEXTAREA NAME=\"disabledtext\" ROWS=10 COLS=60>" .
value_quote($disabledtext) . "</TEXTAREA>\n"; value_quote($disabledtext) . "</TEXTAREA>\n";
...@@ -389,7 +397,7 @@ if ($action eq 'add') { ...@@ -389,7 +397,7 @@ if ($action eq 'add') {
print "<FORM METHOD=POST ACTION=editusers.cgi>\n"; print "<FORM METHOD=POST ACTION=editusers.cgi>\n";
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n"; print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
EmitFormElements('', '', '', 0, 0, 'ExcludeSelfChanges', ''); EmitFormElements('', '', '', 0, 0, 'ExcludeSelfChanges', '', 1);
print "</TR></TABLE>\n<HR>\n"; print "</TR></TABLE>\n<HR>\n";
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n"; print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
...@@ -507,10 +515,11 @@ if ($action eq 'del') { ...@@ -507,10 +515,11 @@ if ($action eq 'del') {
CheckUser($user); CheckUser($user);
# display some data about the user # display some data about the user
SendSQL("SELECT realname, groupset, emailnotification SendSQL("SELECT realname, groupset, emailnotification, newemailtech
FROM profiles FROM profiles
WHERE login_name=" . SqlQuote($user)); WHERE login_name=" . SqlQuote($user));
my ($realname, $groupset, $emailnotification) = FetchSQLData(); my ($realname, $groupset, $emailnotification, $newemailtech) =
FetchSQLData();
$realname ||= "<FONT COLOR=\"red\">missing</FONT>"; $realname ||= "<FONT COLOR=\"red\">missing</FONT>";
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n"; print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n";
...@@ -526,9 +535,11 @@ if ($action eq 'del') { ...@@ -526,9 +535,11 @@ if ($action eq 'del') {
print " <TD VALIGN=\"top\">Real name:</TD>\n"; print " <TD VALIGN=\"top\">Real name:</TD>\n";
print " <TD VALIGN=\"top\">$realname</TD>\n"; print " <TD VALIGN=\"top\">$realname</TD>\n";
if ( !$newemailtech ) {
print "</TR><TR>\n"; print "</TR><TR>\n";
print " <TD VALIGN=\"top\">E-Mail notification:</TD>\n"; print " <TD VALIGN=\"top\">E-Mail notification:</TD>\n";
print " <TD VALIGN=\"top\">$emailnotification</TD>\n"; print " <TD VALIGN=\"top\">$emailnotification</TD>\n";
}
print "</TR><TR>\n"; print "</TR><TR>\n";
print " <TD VALIGN=\"top\">Group set:</TD>\n"; print " <TD VALIGN=\"top\">Group set:</TD>\n";
...@@ -670,17 +681,17 @@ if ($action eq 'edit') { ...@@ -670,17 +681,17 @@ if ($action eq 'edit') {
# get data of user # get data of user
SendSQL("SELECT password, realname, groupset, blessgroupset, SendSQL("SELECT password, realname, groupset, blessgroupset,
emailnotification, disabledtext emailnotification, disabledtext, newemailtech
FROM profiles FROM profiles
WHERE login_name=" . SqlQuote($user)); WHERE login_name=" . SqlQuote($user));
my ($password, $realname, $groupset, $blessgroupset, $emailnotification, my ($password, $realname, $groupset, $blessgroupset, $emailnotification,
$disabledtext) = FetchSQLData(); $disabledtext, $newemailtech) = FetchSQLData();
print "<FORM METHOD=POST ACTION=editusers.cgi>\n"; print "<FORM METHOD=POST ACTION=editusers.cgi>\n";
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n"; print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
EmitFormElements($user, $password, $realname, $groupset, $blessgroupset, EmitFormElements($user, $password, $realname, $groupset, $blessgroupset,
$emailnotification, $disabledtext); $emailnotification, $disabledtext, $newemailtech);
print "</TR></TABLE>\n"; print "</TR></TABLE>\n";
...@@ -691,7 +702,10 @@ if ($action eq 'edit') { ...@@ -691,7 +702,10 @@ if ($action eq 'edit') {
print "<INPUT TYPE=HIDDEN NAME=\"realnameold\" VALUE=\"$realname\">\n"; print "<INPUT TYPE=HIDDEN NAME=\"realnameold\" VALUE=\"$realname\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"groupsetold\" VALUE=\"$groupset\">\n"; print "<INPUT TYPE=HIDDEN NAME=\"groupsetold\" VALUE=\"$groupset\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"blessgroupsetold\" VALUE=\"$blessgroupset\">\n"; print "<INPUT TYPE=HIDDEN NAME=\"blessgroupsetold\" VALUE=\"$blessgroupset\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"emailnotificationold\" VALUE=\"$emailnotification\">\n"; if (!$newemailtech) {
print "<INPUT TYPE=HIDDEN NAME=\"emailnotificationold\" " .
"VALUE=\"$emailnotification\">\n";
}
print "<INPUT TYPE=HIDDEN NAME=\"disabledtextold\" VALUE=\"" . print "<INPUT TYPE=HIDDEN NAME=\"disabledtextold\" VALUE=\"" .
value_quote($disabledtext) . "\">\n"; value_quote($disabledtext) . "\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"update\">\n"; print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"update\">\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment