Skip to content

Commit

Permalink
uprevo: redonu 404 kiam arĥivo ne ekzistas
Browse files Browse the repository at this point in the history
  • Loading branch information
wdiestel committed Jun 16, 2024
1 parent 74feffe commit 60f421e
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions cgi/admin/uprevo.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@
my $exitcode;
my $db_verbose = 1;

my $homedir = "/hp/af/ag/ri";
my $htmldir = "$homedir/www";
my $revodir = "$htmldir/revo";
my $xmldir = "$revodir/xml";

my $fname = param('fname');
# kontrolu ĉu la malpakenda arĥivdosiero ekzistas
if (! -s "$htmldir/alveno/$fname") {
print header(-status => '404 Not Found', -type => 'text/html');
exit;
}

print header,
start_html('Sendu sxangxitajn pagxojn'),
h1('fname='.param('fname'));


my $fname = param('fname');

my $homedir = "/hp/af/ag/ri";
#print h1("homedir = $homedir");
open LOG, ">>$homedir/files/log/uprevo.log" or die("ne eblas skribi log");
autoflush LOG 1;
Expand All @@ -30,16 +38,13 @@
print LOG "du -> $exitcode\n$ret\n";
print pre($ret);

my $htmldir = "$homedir/www";
my $revodir = "$htmldir/revo";
my $xmldir = "$revodir/xml";

$ENV{'LD_LIBRARY_PATH'} = "$homedir/files/lib";
#print h1("LD_LIBRARY_PATH = ".$ENV{'LD_LIBRARY_PATH'});
$ENV{'PATH'} = $ENV{'PATH'}.":$homedir/files/bin";
#print h1("PATH = ".$ENV{'PATH'});

print LOG "uprevo started at ".localtime()." with fname=$fname\n";
print LOG "uprevo eko je ".localtime()." kun fname=$fname\n";
unless ($fname =~ /^revo-\d\d\d\d\d\d\d\d_\d\d\d\d\d\d\.tgz$/) {
print LOG "Nevalidaj parametroj\n\n";
print h1("Nevalidaj parametroj"), end_html;
Expand Down

0 comments on commit 60f421e

Please sign in to comment.