$url=$_GET['url']; $dir = str_replace("\\","/",dirname($url)."/"); $subdir = str_replace("\\","/",dirname($_SERVER['SCRIPT_NAME'])."/"); //echo "
$subdir"; $legal_dirs = array( $subdir."source/" => 1, $subdir."source/special/" => 1 ); $illegal_files = array( // ($subdir=="//"?"/":$subdir)."console.php"=>"Access to this file is restricted.", // ($subdir=="//"?"/":$subdir)."supermail.php"=>"Access to this file is restricted.", // ($subdir=="//"?"/":$subdir)."dbconnect.php"=>"It contains sensitive information specific to this installation.", // ($subdir=="//"?"/":$subdir)."leupak.php"=>"If you want to read the leupak script, I suggest you do so by defeating it!", // ($subdir=="//"?"/":$subdir)."dungeon.php"=>"Wouldn't you like to know?", // ($subdir=="//"?"/":$subdir)."wandering.php"=>"It wouldn't be fair to figure out the password by reading the source, would it?" ); $legal_files=array(); echo "
$key"; $skey = substr($key,strlen($subdir)); //echo $skey." ".$key; if ($key==dirname($_SERVER[SCRIPT_NAME])) $skey=""; $d = dir("./$skey"); if (substr($key,0,2)=="//") $key = substr($key,1); if ($key=="//") $key="/"; while (false !== ($entry = $d->read())) { if (substr($entry,strrpos($entry,"."))==".php"){ if ($illegal_files["$key$entry"]!=""){ echo "
Cannot view this file: $illegal_files[$url]
"; }else { echo "Cannot view this file.
"; } ?>