New forbidroot plugin to forbid rootdir listing

This commit is contained in:
Marc MAURICE 2013-11-11 12:15:55 +01:00
parent 093fc25ad0
commit 4011c2a635
2 changed files with 12 additions and 0 deletions

View file

@ -77,6 +77,8 @@ if (dirname($simplePath) !== '')
else
$parentLink = "";
plugins_include("before_tpl.php");
///// template starts here /////
header('Content-Type: text/html; charset=utf-8');
header('Cache-Control: max-age=3600');

View file

@ -0,0 +1,10 @@
<?php
if ($GLOBALS['simplePath'] === "") {
header("HTTP/1.1 403 Forbidden");
die("Forbdidden directory");
}
if (dirname($GLOBALS['simplePath']) === "/") {
$GLOBALS['parentLink'] = "";
}