Commit 2c4ed3fd authored by jake%acutex.net's avatar jake%acutex.net

Bug 71552 - Remove oldemailtech from Bugzilla

r= justdave@syndicomm.com
parent c04fc5cc
......@@ -518,7 +518,6 @@ sub isExecutableFile {
}
if ($my_webservergroup) {
mkdir 'shadow', 0770 unless -d 'shadow';
# Funny! getgrname returns the GID if fed with NAME ...
my $webservergid = getgrnam($my_webservergroup);
# chmod needs to be called with a valid uid, not 0. $< returns the
......@@ -540,7 +539,7 @@ if ($my_webservergroup) {
}
# make sure that contrib keeps the permissions it had (don't touch it)
chmod 0770, 'data', 'shadow', 'graphs';
chmod 0770, 'data', 'graphs';
chmod 0666, glob('data/*');
chmod 01777, glob('data/*/'); # directories stay executable
}
......@@ -817,9 +816,7 @@ $table{profiles} =
cryptpassword varchar(64),
realname varchar(255),
groupset bigint not null,
emailnotification enum("ExcludeSelfChanges", "CConly", "All") not null default "ExcludeSelfChanges",
disabledtext mediumtext,
newemailtech tinyint not null default 1,
mybugslink tinyint not null default 1,
blessgroupset bigint not null default 0,
emailflags mediumtext,
......@@ -1186,7 +1183,6 @@ sub CheckEnumField ($$@)
$dbh->do("ALTER TABLE $table
CHANGE $field
$field $_");
$::regenerateshadow = 1;
}
}
......@@ -1328,8 +1324,8 @@ _End_Of_SQL_
$dbh->do(<<_End_Of_SQL_);
INSERT INTO profiles
(login_name, realname, password, cryptpassword, groupset, newemailtech)
VALUES ($login, $realname, $pass1, encrypt($pass1), 0x7fffffffffffffff, 1)
(login_name, realname, password, cryptpassword, groupset)
VALUES ($login, $realname, $pass1, encrypt($pass1), 0x7fffffffffffffff)
_End_Of_SQL_
} else {
$dbh->do(<<_End_Of_SQL_);
......@@ -1467,8 +1463,6 @@ sub TableExists ($)
return $exists;
}
$::regenerateshadow = 0;
# really old fields that were added before checksetup.pl existed
# but aren't in very old bugzilla's (like 2.1)
......@@ -1484,14 +1478,6 @@ AddField('components', 'description', 'mediumtext not null');
ChangeFieldType('components', 'program', 'varchar(64)');
# 1999-05-12 Added a pref to control how much email you get. This needs a new
# column in the profiles table, so feed the following to mysql:
AddField('profiles', 'emailnotification', 'enum("ExcludeSelfChanges", "CConly",
"All") not null default "ExcludeSelfChanges"');
# 1999-06-22 Added an entry to the attachments table to record who the
# submitter was. Nothing uses this yet, but it still should be recorded.
......@@ -1724,8 +1710,6 @@ if (GetFieldDef('bugs', 'long_desc')) {
DropField('bugs', 'long_desc');
$dbh->do("UNLOCK TABLES");
$::regenerateshadow = 1;
}
......@@ -1768,14 +1752,14 @@ if (GetFieldDef('bugs_activity', 'field')) {
# record when email notifications were last sent about this bug. Also,
# added a user pref whether a user wants to use the brand new experimental
# stuff.
# 2001-04-29 jake@acutex.net - The newemailtech field is no longer needed
# http://bugzilla.mozilla.org/show_bugs.cgi?id=71552
if (!GetFieldDef('bugs', 'lastdiffed')) {
AddField('bugs', 'lastdiffed', 'datetime not null');
$dbh->do('UPDATE bugs SET lastdiffed = now(), delta_ts = delta_ts');
}
AddField('profiles', 'newemailtech', 'tinyint not null');
# 2000-01-22 The "login_name" field in the "profiles" table was not
# declared to be unique. Sure enough, somehow, I got 22 duplicated entries
......@@ -1999,8 +1983,6 @@ if ( CountIndexes('cc') != 3 ) {
DropIndexes('cc');
$dbh->do("ALTER TABLE cc ADD UNIQUE (bug_id,who)");
$dbh->do("ALTER TABLE cc ADD INDEX (who)");
$::regenerateshadow=1; # cc fields no longer have spaces in them
}
if ( CountIndexes('keywords') != 3 ) {
......@@ -2045,8 +2027,6 @@ if (!($sth->fetchrow_arrayref()->[0])) {
$dbh->do("INSERT INTO duplicates VALUES('$dupes{$key}', '$key')");
# BugItsADupeOf Dupe
}
$::regenerateshadow = 1;
}
# 2000-12-14 New graphing system requires a directory to put the graphs in
......@@ -2162,6 +2142,17 @@ unless (-d 'data/duplicates') {
}
}
# 2001-04-29 jake@acutex.net - Remove oldemailtech
# http://bugzilla.mozilla.org/show_bugs.cgi?id=71552
if (-d 'shadow') {
print "Removing shadow directory...\n";
unlink glob("shadow/*");
unlink glob("shadow/.*");
rmdir "shadow";
}
DropField("profiles", "emailnotification");
DropField("profiles", "newemailtech");
# If you had to change the --TABLE-- definition in any way, then add your
# differential change code *** A B O V E *** this comment.
#
......@@ -2173,10 +2164,6 @@ unless (-d 'data/duplicates') {
#
#
# Final checks...
if ($::regenerateshadow) {
print "Now regenerating the shadow database for all bugs.\n";
system("./processmail", "regenerate");
}
unlink "data/versioncache";
print "Reminder: Bugzilla now requires version 8.7 or later of sendmail.\n";
......@@ -145,11 +145,6 @@ DefParam("preferlists",
"b",
1);
DefParam("prettyasciimail",
"If this is on, Bugzilla will send email reports formatted (assuming 76 character monospace font display). If this is off, email reports are sent using the old 'one-item-per-line' format.",
"b",
0);
DefParam("capitalizelists",
"If this is on, Bugzilla will capitalize list entries, checkboxes, and radio buttons. If this is off, Bugzilla will leave these items untouched.",
"b",
......@@ -374,51 +369,18 @@ To use the wonders of Bugzilla, you can use the following:
});
DefParam("changedmail",
q{The email that gets sent to people when a bug changes. Within this
text, %to% gets replaced by the assigned-to and reported-by people,
separated by a comma (with duplication removed, if they're the same
person). %cc% gets replaced by the list of people on the CC list,
separated by commas. %bugid% gets replaced by the bug number.
%diffs% gets replaced by the diff text from the old version to the new
version of this bug. %neworchanged% is "New: " if this mail is
reporting a new bug or empty if changes were made
to an existing one. %summary% gets replaced by the summary of this
bug. %<i>anythingelse</i>% gets replaced by the definition of that
parameter (as defined on this page).},
"l",
"From: bugzilla-daemon
To: %to%
Cc: %cc%
Subject: [Bug %bugid%] %neworchanged%%summary%
%urlbase%show_bug.cgi?id=%bugid%
%diffs%");
DefParam("newemailtech",
q{The way that email diffs are constructed by Bugzilla. You can revert to
the old technology by turning this off, but this is not advised, as the old
email tech will probably disappear in the next version of Bugzilla. Some
features (watches, server side mail filtering) depend on newemailtech being
set to on.},
"b",
1);
DefParam("newemailtechdefault",
q{Make "newemailtech" the default for all new accounts created. This will
not change any existing accounts nor will it remove a users ability to go
back to the oldmail system (requires "newemailtech" to be on as well).},
"b",
1);
DefParam("newchangedmail",
q{The same as 'changedmail', but used for the newemailtech stuff.},
q{The email that gets sent to people when a bug changes. Within this
text, %to% gets replaced with the e-mail address of the person recieving
the mail. %bugid% gets replaced by the bug number. %diffs% gets
replaced with what's changed. %neworchanged% is "New:" if this mail is
reporting a new bug or empty if changes were made to an existing one.
%summary% gets replaced by the summary of this bug. %<i>anythingelse</i>%
gets replaced by the definition of that parameter (as defined on this
page).},
"l",
"From: bugzilla-daemon
To: %to%
Cc: %cc%
Subject: [Bug %bugid%] %neworchanged%%summary%
%urlbase%show_bug.cgi?id=%bugid%
......
......@@ -97,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, $newemailtech) = @_;
$disabledtext) = @_;
print " <TH ALIGN=\"right\">Login name:</TH>\n";
EmitElement("user", $user);
......@@ -119,25 +119,6 @@ sub EmitFormElements ($$$$$$$$)
}
print "</TR><TR>\n";
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 "</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";
......@@ -397,7 +378,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', '', 1);
EmitFormElements('', '', '', 0, 0, '');
print "</TR></TABLE>\n<HR>\n";
print "<INPUT TYPE=SUBMIT VALUE=\"Add\">\n";
......@@ -515,10 +496,9 @@ if ($action eq 'del') {
CheckUser($user);
# display some data about the user
SendSQL("SELECT realname, groupset, emailnotification, newemailtech
FROM profiles
SendSQL("SELECT realname, groupset FROM profiles
WHERE login_name=" . SqlQuote($user));
my ($realname, $groupset, $emailnotification, $newemailtech) =
my ($realname, $groupset) =
FetchSQLData();
$realname ||= "<FONT COLOR=\"red\">missing</FONT>";
......@@ -535,12 +515,6 @@ if ($action eq 'del') {
print " <TD VALIGN=\"top\">Real name:</TD>\n";
print " <TD VALIGN=\"top\">$realname</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";
print " <TD VALIGN=\"top\">";
......@@ -680,18 +654,17 @@ if ($action eq 'edit') {
CheckUser($user);
# get data of user
SendSQL("SELECT password, realname, groupset, blessgroupset,
emailnotification, disabledtext, newemailtech
SendSQL("SELECT password, realname, groupset, blessgroupset, disabledtext
FROM profiles
WHERE login_name=" . SqlQuote($user));
my ($password, $realname, $groupset, $blessgroupset, $emailnotification,
$disabledtext, $newemailtech) = FetchSQLData();
my ($password, $realname, $groupset, $blessgroupset,
$disabledtext) = 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, $newemailtech);
$disabledtext);
print "</TR></TABLE>\n";
......@@ -702,10 +675,6 @@ 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";
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";
......@@ -731,8 +700,6 @@ if ($action eq 'update') {
my $realnameold = trim($::FORM{realnameold} || '');
my $password = trim($::FORM{password} || '');
my $passwordold = trim($::FORM{passwordold} || '');
my $emailnotification = trim($::FORM{emailnotification} || '');
my $emailnotificationold = trim($::FORM{emailnotificationold} || '');
my $disabledtext = trim($::FORM{disabledtext} || '');
my $disabledtextold = trim($::FORM{disabledtextold} || '');
my $groupsetold = trim($::FORM{groupsetold} || '0');
......@@ -796,12 +763,6 @@ if ($action eq 'update') {
print "Updated ability to tweak permissions of other users.\n";
}
if ($editall && $emailnotification ne $emailnotificationold) {
SendSQL("UPDATE profiles
SET emailnotification=" . SqlQuote($emailnotification) . "
WHERE login_name=" . SqlQuote($userold));
print "Updated email notification.<BR>\n";
}
if(!Param('useLDAP')) {
if ($editall && $password ne $passwordold) {
my $q = SqlQuote($password);
......
......@@ -585,7 +585,6 @@ sub InsertNewUser {
for (my $i=0 ; $i<8 ; $i++) {
$password .= substr("abcdefghijklmnopqrstuvwxyz", int(rand(26)), 1);
}
my $usenewemailtech = Param('newemailtech') & Param('newemailtechdefault');
PushGlobalSQLState();
SendSQL("select bit, userregexp from groups where userregexp != ''");
......@@ -605,7 +604,7 @@ sub InsertNewUser {
$username = SqlQuote($username);
$realname = SqlQuote($realname);
SendSQL("insert into profiles (login_name, realname, password, cryptpassword, groupset, newemailtech) values ($username, $realname, '$password', encrypt('$password'), $groupset, $usenewemailtech)");
SendSQL("insert into profiles (login_name, realname, password, cryptpassword, groupset) values ($username, $realname, '$password', encrypt('$password'), $groupset)");
PopGlobalSQLState();
return $password;
}
......
......@@ -61,6 +61,7 @@ my @emailFlags = (
);
my $defaultEmailFlagString =
'ExcludeSelf~' . 'on~' .
'emailOwnerRemoveme~' . 'on~' .
'emailOwnerComments~' . 'on~' .
......@@ -180,103 +181,28 @@ sub setEmailFlags ($) {
sub ShowEmailOptions () {
SendSQL("SELECT emailnotification, newemailtech FROM profiles " .
"WHERE userid = $userid");
my ($emailnotification, $dbNewEmailTech) = (FetchSQLData());
# Override the database value with the current form value
# if the disable/enable button has been pressed.
if ( defined $::FORM{'newEmailTech'} ) {
# If the user has clicked on 'Disable New Email Tech',
# clear out their email flag preferences.
if ($dbNewEmailTech == 1) {
setEmailFlags('');
}
$showNewEmailTech = $::FORM{'newEmailTech'};
} else {
$showNewEmailTech = $dbNewEmailTech;
}
#print "<BR>database newemailtech = $showNewEmailTech<br>";
my $qacontactpart = "";
if (Param('useqacontact')) {
$qacontactpart = ", the current QA Contact";
}
if ($showNewEmailTech==0) {
print <<"--endquote--";
<TABLE>
<TR><TD COLSPAN="2">
Bugzilla will send out email notification of changed bugs to
the current owner, the Reporter of the bug$qacontactpart, and anyone on the
CC list. However, you can suppress some of those email notifications.
On which of these bugs would you like email notification of changes?
</TD></TR>
--endquote--
my $entry =
BuildPulldown("emailnotification",
[["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"]],
$emailnotification);
EmitEntry("Notify me of changes to", $entry);
print "</TABLE>";
}
if (Param("newemailtech")) {
print qq{
<TR><TD COLSPAN="2"><HR></TD></TR>
<TR><TD COLSPAN="2"><FONT COLOR="red">Updated!</FONT>
Bugzilla's new standard email notification scheme allows for the use of
features such as watching other users and selecting which bug changes you get
mail about. Although it's still possible to use the old notification scheme,
this isn't recommended, because the old scheme is no longer
supported and will be going away in an upcoming version of Bugzilla.
<FONT COLOR="red">Note that after clicking the link below, you must still click
on the <B>Submit Changes</B> button in order for your email tech change to be saved.</FONT>
</TD></TR>};
if ($showNewEmailTech == 1) {
print qq{
<tr><td colspan=2><center>
<A HREF="userprefs.cgi?bank=diffs&amp;newEmailTech=0">Disable New Email Tech</A>
</center></td></tr>};
} else {
print qq{<tr><td colspan=2><center><A HREF="userprefs.cgi?bank=diffs&amp;newEmailTech=1">Enable New Email Tech</A></center></td></tr>};
}
if (Param("supportwatchers") && $showNewEmailTech == 1) {
my $watcheduserSet = new RelationSet;
$watcheduserSet->mergeFromDB("SELECT watched FROM watch WHERE" .
if (Param("supportwatchers")) {
my $watcheduserSet = new RelationSet;
$watcheduserSet->mergeFromDB("SELECT watched FROM watch WHERE" .
" watcher=$userid");
my $watchedusers = $watcheduserSet->toString();
my $watchedusers = $watcheduserSet->toString();
print qq{
print qq{
<TR><TD COLSPAN="4"><HR></TD></TR>
<TR><TD COLSPAN="4">
<FONT COLOR="red">New Email Tech Feature: </FONT>If you want to help cover for someone when they're on vacation, or if
If you want to help cover for someone when they're on vacation, or if
you need to do the QA related to all of their bugs, you can tell bugzilla
to send mail related to their bugs to you also. List the email addresses
of any users you wish to watch here, separated by commas.
</TD></TR>};
EmitEntry("Users to watch",
EmitEntry("Users to watch",
qq{<INPUT SIZE=35 NAME="watchedusers" VALUE="$watchedusers">});
}
}
print qq{<TR><TD COLSPAN="2"><HR></TD></TR>};
print qq{<TR><TD COLSPAN="2"><HR></TD></TR>};
if ($showNewEmailTech == 1) {
showAdvancedEmailFilterOptions();
}
}
showAdvancedEmailFilterOptions();
print qq {
<TABLE CELLSPACING="0" CELLPADDING="10" BORDER=0 WIDTH="100%">
......@@ -296,38 +222,25 @@ sub showAdvancedEmailFilterOptions () {
</center>
</TD></TR><tr><td colspan="2">
<p>
<center><FONT COLOR="red">New Email Tech Feature:</FONT>
Filter email notifications for <b>modified</b>
bugs (does not effect new bug email notices).
<center>
If you don't like getting a notification for "trivial"
changes to bugs, you can use the settings below to
filter some (or even all) notifications.
</center></td></tr></table>
<hr width=800 align=center>
};
SendSQL("SELECT emailflags, emailnotification FROM profiles WHERE " .
"userid = $userid");
SendSQL("SELECT emailflags FROM profiles WHERE userid = $userid");
($flags, $notify) = FetchSQLData();
($flags) = FetchSQLData();
# if the emailflags haven't been set before, that means that this user
# hasn't been to (the email pane of?) userprefs.cgi since the change to
# use emailflags. create a default flagset for them, mostly based on
# static defaults, but setting ExcludeSelf based on the old
# emailnotification column.
# use emailflags. create a default flagset for them, based on
# static defaults.
#
if ( !$flags ) {
if ( !$notify ) {
confess("neither \$flags nor \$notify was set");
}
my $notifyString;
if ( $notify eq 'ExcludeSelfChanges' ) {
$notifyString = "ExcludeSelf~on~";
} else {
$notifyString = "ExcludeSelf~~";
}
$flags = $notifyString . $defaultEmailFlagString;
$flags = $defaultEmailFlagString;
setEmailFlags($flags);
}
......@@ -440,52 +353,36 @@ sub SaveEmailOptions () {
my $useNewEmailTech = $::FORM{'savedEmailTech'};
my $updateString;
if ($useNewEmailTech == 0) {
# we force the NEW email filter entry to allow all email
# (empty string defaults to allowing all email).
$updateString = '';
if ( defined $::FORM{'ExcludeSelf'}) {
$updateString .= 'ExcludeSelf~on';
} else {
if ( defined $::FORM{'ExcludeSelf'}) {
$updateString .= 'ExcludeSelf~on';
} else {
$updateString .= 'ExcludeSelf~';
}
my @tmpGroups = @emailGroups;
$updateString .= 'ExcludeSelf~';
}
my @tmpGroups = @emailGroups;
while ((my $groupName,my $groupText) = splice(@tmpGroups,0,2) ) {
while ((my $groupName,my $groupText) = splice(@tmpGroups,0,2) ) {
my @tmpFlags = @emailFlags;
my @tmpFlags = @emailFlags;
while ((my $flagName,my $flagText) = splice(@tmpFlags,0,2) ) {
while ((my $flagName,my $flagText) = splice(@tmpFlags,0,2) ) {
my $entry = 'email' . $groupName . $flagName;
my $entryValue;
my $entry = 'email' . $groupName . $flagName;
my $entryValue;
if (!defined $::FORM{$entry} ) {
$entryValue = "";
} else {
$entryValue = $::FORM{$entry};
}
$updateString .= '~' . $entry . '~' . $entryValue;
if (!defined $::FORM{$entry} ) {
$entryValue = "";
} else {
$entryValue = $::FORM{$entry};
}
}
# we force the OLD email tech flag to allow all email
$::FORM{'emailnotification'} = "All";
$updateString .= '~' . $entry . '~' . $entryValue;
}
}
#open(FID,">updateString");
#print qq{UPDATE STRING: $updateString <br>};
#close(FID);
SendSQL("UPDATE profiles SET emailnotification = "
. SqlQuote($::FORM{'emailnotification'})
. ", newemailtech = $useNewEmailTech "
. "WHERE userid = $userid" );
SendSQL("UPDATE profiles SET emailflags = " .
SqlQuote($updateString) . " WHERE userid = $userid");
......@@ -493,9 +390,6 @@ sub SaveEmailOptions () {
if (exists $::FORM{'watchedusers'}) {
Error ('You must have "New email tech" set to watch someone')
if ( $::FORM{'watchedusers'} ne "" && $useNewEmailTech == 0);
# Just in case. Note that this much locking is actually overkill:
# we don't really care if anyone reads the watch table. So
# some small amount of contention could be gotten rid of by
......
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