New forbidroot plugin to forbid rootdir listing
This commit is contained in:
parent
093fc25ad0
commit
4011c2a635
2 changed files with 12 additions and 0 deletions
|
@ -77,6 +77,8 @@ if (dirname($simplePath) !== '')
|
||||||
else
|
else
|
||||||
$parentLink = "";
|
$parentLink = "";
|
||||||
|
|
||||||
|
plugins_include("before_tpl.php");
|
||||||
|
|
||||||
///// template starts here /////
|
///// template starts here /////
|
||||||
header('Content-Type: text/html; charset=utf-8');
|
header('Content-Type: text/html; charset=utf-8');
|
||||||
header('Cache-Control: max-age=3600');
|
header('Cache-Control: max-age=3600');
|
||||||
|
|
10
plugins/forbidroot/before_tpl.php
Normal file
10
plugins/forbidroot/before_tpl.php
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if ($GLOBALS['simplePath'] === "") {
|
||||||
|
header("HTTP/1.1 403 Forbidden");
|
||||||
|
die("Forbdidden directory");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dirname($GLOBALS['simplePath']) === "/") {
|
||||||
|
$GLOBALS['parentLink'] = "";
|
||||||
|
}
|
Loading…
Reference in a new issue