New forbidroot plugin to forbid rootdir listing
[bizou.git] / plugins / forbidroot / before_tpl.php
diff --git a/plugins/forbidroot/before_tpl.php b/plugins/forbidroot/before_tpl.php
new file mode 100644 (file)
index 0000000..b9b5361
--- /dev/null
@@ -0,0 +1,10 @@
+<?php
+
+if ($GLOBALS['simplePath'] === "") {
+        header("HTTP/1.1 403 Forbidden");
+        die("Forbdidden directory");
+}
+
+if (dirname($GLOBALS['simplePath']) === "/") {
+       $GLOBALS['parentLink'] = "";
+}