diff options
Diffstat (limited to 'mirror.php')
-rw-r--r-- | mirror.php | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -19,16 +19,20 @@ $ea = fopen($wurzel."erlaubteAdressen","r"); while (! feof($ea)) { $zeile = trim(fgets($ea)); - if ($zeile == "") { - print $_SERVER["REMOTE_ADDR"]; - die(); - } if ($zeile == $_SERVER["REMOTE_ADDR"]) break; } + if ($zeile != $_SERVER["REMOTE_ADDR"]) { + header("Status: 403 Forbidden"); + print "Error 403: Access Forbidden for " . $_SERVER["REMOTE_ADDR"] . "\n"; + die(); + } - if (substr($quelle,0,1) != "/") - die("Ungültiger Pfad!"); + if (substr($quelle,0,1) != "/") { + header("Status: 404 Not Found"); + print "Error 403: Invalid path\n"; + die(); + } $quelle = substr($quelle,1); @@ -69,5 +73,3 @@ } exec("find /srv/sourceMirror/ -type f -size 0c -delete"); - -?> |