&html_print_credentials;
print "<SELECT NAME=\"decision_$file\">
<OPTION VALUE=\"approve\">Approve</OPTION>
-<OPTION VALUE=\"leave\">Put to back of queue</OPTION>
+<OPTION VALUE=\"leave\" SELECTED>Put to back of queue</OPTION>
<OPTION VALUE=\"consider\">Back of queue, adding mark requesting further consideration</OPTION>
";
my $num= sub {
local ($_) = @_;
return $forwards * (
- m/^errs$/ ? -1 :
- m/^errs\.(\d+)(?:\.gz$)$/ ? $1 :
- undef
+ m/^errs$/ ? 1 :
+ m/^errs\.(\d+)(?:\.gz)?$/ ? ($1+2) :
+ 0
);
};
foreach my $leaf (
sort { $num->($a) <=> $num->($b) }
- grep { defined $num->($_) }
+ grep { $num->($_) }
readdir LOGSDIR
) {
my $file= "$dir/$leaf";
- if ($file =~ m/\.gz$/) {
- open LOGFILE, "zcat $file |" or die "zcat $file $!";
+ if ($file =~ m/\/errs.*\.gz$/) {
+ open LOGFILE, "zcat $file | tac |" or die "zcat $file | tac $!";
+ } elsif ($file =~ /errs/) {
+ open LOGFILE, "tac $file |" or die "tac $file $!";
} else {
- open LOGFILE, "< $file" or die "$file $!";
- }
+ die "Unexpected filename in scanlogs: $file";
+ }
while (<LOGFILE>) {
my $tgot= $callback->();
next unless $tgot;
if ($request{'download_logs'}) {
print "<h2>Complete log download</h2>\n";
$min= 2;
- } elsif ($request{'messagenum'} =~ m/^(\d+)$/) {
+ } elsif ($request{'messagenum'} =~ m/^\s*(\d+)\s*$/) {
$reqnum= $1;
$forwards= -1;
$min= 1;
my @vals = split / \| /, $';
return 0 unless @vals >= 5;
my $subj= pop @vals;
- my ($group,$dir,$act,$reason) = @vals;
+ my ($group,$dir,$act,$reason,$timet) = @vals;
+ my $date= $timet ? (strftime "%Y-%m-%d %H:%M:%S GMT", gmtime $timet)
+ : "(unknown)";
return 0 unless $group eq $request{'newsgroup'};
return 0 unless $subj =~ m,/(\d+)$,;
my $treqnum= $1;
return 0 if defined($reqnum) and $treqnum ne $reqnum;
- print "<table rules=all><tr><th>Reference<th>Disposal<th>Reason</tr>\n"
+ print "<table rules=all><tr><th>Date<th>Reference<th>Disposal<th>Reason</tr>\n"
unless $sofar;
- print "<tr>", (map { "<td>".escapeHTML($_) } $treqnum,$act,$reason);
+ print "<tr>", (map { "<td>".escapeHTML($_) }
+ $date,$treqnum,$act,$reason);
print "</tr>\n";
return defined($reqnum) ? 2 : 1;
});
print "</table>" if $sofar;
print "\n";
} else {
- print "Reference not found.";
+ print "Reference not found.".
+ " (Perhaps message has expired, or is still in the queue?)";
}
&end_html;
}