summaryrefslogtreecommitdiffstats
path: root/editusers.cgi
diff options
context:
space:
mode:
authordmose%mozilla.org <>2001-01-25 05:26:23 +0100
committerdmose%mozilla.org <>2001-01-25 05:26:23 +0100
commit88458a6565247863a96ea2f3a99f22c5d4a79a9e (patch)
treebb575858ab06c507d697d44b5bdde181b8f5f134 /editusers.cgi
parent63ececeb0b04265e63e777874f0dae99549ab75f (diff)
downloadbugzilla-88458a6565247863a96ea2f3a99f22c5d4a79a9e.tar.gz
bugzilla-88458a6565247863a96ea2f3a99f22c5d4a79a9e.tar.xz
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
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-xeditusers.cgi62
1 files changed, 38 insertions, 24 deletions
diff --git a/editusers.cgi b/editusers.cgi
index e5784c8db..72e42f03d 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -21,6 +21,7 @@
# Contributor(s): Holger Schurig <holgerschurig@nikocity.de>
# Dave Miller <dave@intrec.com>
# Joe Robins <jmrobins@tgix.com>
+# Dan Mosedale <dmose@mozilla.org>
#
# Direct any questions on this source code to
#
@@ -38,6 +39,7 @@ require "globals.pl";
sub sillyness {
my $zz;
$zz = $::userid;
+ $zz = $::superusergroupset;
}
my $editall;
@@ -95,10 +97,10 @@ sub EmitElement ($$)
# Displays the form to edit a user parameters
#
-sub EmitFormElements ($$$$$$$)
+sub EmitFormElements ($$$$$$$$)
{
my ($user, $password, $realname, $groupset, $blessgroupset,
- $emailnotification, $disabledtext) = @_;
+ $emailnotification, $disabledtext, $newemailtech) = @_;
print " <TH ALIGN=\"right\">Login name:</TH>\n";
EmitElement("user", $user);
@@ -116,20 +118,26 @@ sub EmitFormElements ($$$$$$$)
print " <TD><INPUT TYPE=\"PASSWORD\" SIZE=16 MAXLENGTH=16 NAME=\"password\" VALUE=\"$password\"></TD>\n";
}
print "</TR><TR>\n";
- print " <TH ALIGN=\"right\">Email notification:</TH>\n";
- print qq{<TD><SELECT NAME="emailnotification">};
- foreach my $i (["ExcludeSelfChanges", "All qualifying bugs except those which I change"],
- ["CConly", "Only those bugs which I am listed on the CC line"],
- ["All", "All qualifying bugs"]) {
- my ($tag, $desc) = (@$i);
- my $selectpart = "";
- if ($tag eq $emailnotification) {
- $selectpart = " SELECTED";
+
+ if (!$newemailtech) {
+ print " <TH ALIGN=\"right\">Email notification:</TH>\n";
+ print qq{<TD><SELECT NAME="emailnotification">};
+ foreach my $i (["ExcludeSelfChanges",
+ "All qualifying bugs except those which I change"],
+ ["CConly",
+ "Only those bugs which I am listed on the CC line"],
+ ["All", "All qualifying bugs"]) {
+ my ($tag, $desc) = (@$i);
+ my $selectpart = "";
+ if ($tag eq $emailnotification) {
+ $selectpart = " SELECTED";
+ }
+ print qq{<OPTION$selectpart VALUE="$tag">$desc\n};
}
- print qq{<OPTION$selectpart VALUE="$tag">$desc\n};
+ print "</SELECT></TD>\n";
+ print "</TR><TR>\n";
}
- print "</SELECT></TD>\n";
- print "</TR><TR>\n";
+
print " <TH ALIGN=\"right\">Disable text:</TH>\n";
print " <TD ROWSPAN=2><TEXTAREA NAME=\"disabledtext\" ROWS=10 COLS=60>" .
value_quote($disabledtext) . "</TEXTAREA>\n";
@@ -389,7 +397,7 @@ if ($action eq 'add') {
print "<FORM METHOD=POST ACTION=editusers.cgi>\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 "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
@@ -507,10 +515,11 @@ if ($action eq 'del') {
CheckUser($user);
# display some data about the user
- SendSQL("SELECT realname, groupset, emailnotification
+ SendSQL("SELECT realname, groupset, emailnotification, newemailtech
FROM profiles
WHERE login_name=" . SqlQuote($user));
- my ($realname, $groupset, $emailnotification) = FetchSQLData();
+ my ($realname, $groupset, $emailnotification, $newemailtech) =
+ FetchSQLData();
$realname ||= "<FONT COLOR=\"red\">missing</FONT>";
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n";
@@ -526,9 +535,11 @@ if ($action eq 'del') {
print " <TD VALIGN=\"top\">Real name:</TD>\n";
print " <TD VALIGN=\"top\">$realname</TD>\n";
- print "</TR><TR>\n";
- print " <TD VALIGN=\"top\">E-Mail notification:</TD>\n";
- print " <TD VALIGN=\"top\">$emailnotification</TD>\n";
+ if ( !$newemailtech ) {
+ print "</TR><TR>\n";
+ print " <TD VALIGN=\"top\">E-Mail notification:</TD>\n";
+ print " <TD VALIGN=\"top\">$emailnotification</TD>\n";
+ }
print "</TR><TR>\n";
print " <TD VALIGN=\"top\">Group set:</TD>\n";
@@ -670,17 +681,17 @@ if ($action eq 'edit') {
# get data of user
SendSQL("SELECT password, realname, groupset, blessgroupset,
- emailnotification, disabledtext
+ emailnotification, disabledtext, newemailtech
FROM profiles
WHERE login_name=" . SqlQuote($user));
my ($password, $realname, $groupset, $blessgroupset, $emailnotification,
- $disabledtext) = FetchSQLData();
+ $disabledtext, $newemailtech) = FetchSQLData();
print "<FORM METHOD=POST ACTION=editusers.cgi>\n";
print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n";
EmitFormElements($user, $password, $realname, $groupset, $blessgroupset,
- $emailnotification, $disabledtext);
+ $emailnotification, $disabledtext, $newemailtech);
print "</TR></TABLE>\n";
@@ -691,7 +702,10 @@ if ($action eq 'edit') {
print "<INPUT TYPE=HIDDEN NAME=\"realnameold\" VALUE=\"$realname\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"groupsetold\" VALUE=\"$groupset\">\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=\"" .
value_quote($disabledtext) . "\">\n";
print "<INPUT TYPE=HIDDEN NAME=\"action\" VALUE=\"update\">\n";