coar 97/11/14 14:18:37
Modified: . bugdb.cgi
Log:
Add a 30-minute Expires: response header field, and include some
instructions about how to get replies into the bugdb in mail
sent on updates.
Submitted by: Dirk-Willem van Gulik
Revision Changes Path
1.21 +38 -2 apache-site/bugdb.cgi
Index: bugdb.cgi
===================================================================
RCS file: /export/home/cvs/apache-site/bugdb.cgi,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- bugdb.cgi 1997/11/13 21:56:39 1.20
+++ bugdb.cgi 1997/11/14 22:18:36 1.21
@@ -3,6 +3,7 @@
# Thanks to Larry Wall, CERN, and NCSA for Perl, WWW, and Mosaic!
require "/usr/local/lib/gnats/libgnats.pl";
+use POSIX;
#### Configuration begins here
@@ -11,6 +12,15 @@
$databasetitle = "$software Problem Report Database";
$EDITOR_FILE = "$GNATS_LIB/gnats-db/gnats-adm/responsible";
+# Lifetime (in seconds) of displayed info before it expires.
+$life_time = 30 * 60;
+$CCNOTE = <<EOT;
+[In order for any reply to be added to the PR database, ]
+[you need to include <[EMAIL PROTECTED]> in the Cc line ]
+[and leave the subject line UNCHANGED. This is not done]
+[automatically because of the potential for mail loops. ]
+EOT
+
# Outside commands
$MAILER = "/usr/sbin/sendmail -oi -t";
$DATEPROG = "/bin/date";
@@ -62,6 +72,9 @@
# new database value and the old subject line.
# 11/13/1997 Ken Coar - Add another button for "closing due to no response,"
# and fix a mis-set Class value from one of the other buttons.
+# 11/14/1997 Ken Coar - Add a note to mail messages about how to get
+# replies to go into the database. Also add an Expires: header field
+# (Dirk-Willem van Gulik).
#
### End Modification log
@@ -222,6 +235,24 @@
exit(0);
#################### Miscellaneous functions
+# Format a date according to RFC 822 rules.
+sub RFC822_date
+{
+ local ($s) = @_;
+ local (@fdate) = gmtime ($s);
+ local (@MNAME) = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
+ local (@WDAY) = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
+
+ $fdate[5] += ($fdate[5] > 90) ? 1900 : 2000;
+ return sprintf ("%s, %02d %s %04d %02d:%02d:%02d GMT",
+ $WDAY[$fdate[6]],
+ $fdate[3],
+ $MNAME[$fdate[4]],
+ $fdate[5], $fdate[2], $fdate[1],
+ $fdate[0]);
+}
+
# Dumps the environment
sub dumpenv
{
@@ -234,7 +265,7 @@
}
#
-# Emits either a rredirect or the preamble to some HTML.
+# Emits either a redirect or the preamble to some HTML.
#
sub emit_preamble {
local ($redirect, $target, $oldsel) = @_;
@@ -244,7 +275,8 @@
if ($redirect) {
print "Location: $target\n\n";
} else {
- print "Content-type: text/html\n\n";
+ print "Content-type: text/html\n";
+ print "Expires: " . &RFC822_date (time + $life_time) . "\n\n";
print "<HTML>\n";
}
$| = 0;
@@ -377,6 +409,8 @@
Reply-To: $fieldvalues{"emailaddr"}
X-send-pr-version: $GNATS_VER
+$CCNOTE
+
$prtext
EOM
close(MAIL);
@@ -822,6 +856,8 @@
"To: $mail_to
From: $input{'Editor'}
Subject: Re: $input{'Category'}/$pr: $oldsyn
+
+$CCNOTE
Synopsis: $oldsyn