say '';
-if (not $source) {
- print "<h1>Source files</h1>";
+if (not $source or -d $source) {
+ PLP_START {
+ print "<h1>Source files</h1>";
+ };
+
+ if ($source and $source ne 'tools') {
+ Abort("Directory index not permitted", '403 source not allowed');
+ }
print "<p>Project code distributed under the AGPL. Please contribute back.</p>";
say '<ul>';
- for (glob '*.plp') {
- chomp;
+ for (glob($source ? "$source/*" : '*.plp')) {
say '<li>', showlink($_, "/source/$_");
}
say "</ul>\n";
say '</pre>';
exit;
}
+ -e or mkdir for $cachefile =~ s{[^/]+\z}{}r; # dirname
open my $cache, '>', $cachefile
or Alert("Could not save cache", "Opening $cachefile failed: $!");;