DragonPrime.", true); output("You may then work with that code within the restrictions of its license."); output("`n`nHopefully this will help put an end to actions like the following:"); rawoutput(""); popup_footer(); } else { $legal_start_dirs = array( "" => 1, "lib/*" => 1, "modules/*" => 1, "modules/avatar" => 0, // No PHP files, so don't show ); if ($url) { $dirname = dirname($url); foreach ($legal_start_dirs as $dirs=>$value) { if (strpos($dirs,"/") === false || !$value) { continue; } if (strpos($dirs,"/*")) { $ghjkl = str_replace("/*","",$dirs); $dirname = preg_replace("!".$ghjkl."/?\\w*/?!","",$dirname); }else { $ghjkl = str_replace("/","",$dirs); $dirname = preg_replace("!".$ghjkl."/?!","",$dirname); } } $dirname = preg_replace("/\\A\\./","",$dirname); $length = strlen($dirname); $url = substr($url,$length); if (strpos($url,"/") === 0) { $url = substr($url,1); } } $select_dir = httpget("dir"); if (!$select_dir) { $select_dir = ""; } $select_dir = "./$select_dir"; $illegal_files = array( "dbconnect.php"=>"Contains sensitive information specific to this installation.", "dragon.php"=>"If you want to read the dragon script, I suggest you do so by defeating it!", "output_translator.php"=>"X", // hidden "pavilion.php"=>"Not released at least for now.", "source.php"=>"X", //hide completely -- so that people can't see the names of the other completely hidden files. "remotebackup.php"=>"X", // hide completely "remotequery.php"=>"X", // hide completely "lib/datatable.php"=>"X", // hide completely "lib/dbremote.php"=>"X", //hide completely "lib/smsnotify.php"=>"X", //hide completely "modules/battlearena.php"=>"X", // not for dist "modules/blog.php"=>"X", // not for dist "modules/clues.php"=>"X", // hidden "modules/lycanthropy.php"=>"X", // hidden "modules/mutagens.php"=>"X", // hidden "modules/privacy.php"=>"X", // hidden "modules/store.php"=>"X", // not for dist "modules/tournament.php"=>"X", // hide ); $legal_files=array(); rawoutput("

"); output("View Source: "); output_notl("%s", htmlentities($url, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); rawoutput("

"); if($url) output("Click here for the source, OR`n", true); output("`bOther files that you may wish to view the source of:`b"); rawoutput(""); if ($url) { rawoutput("

"); output("Source of: %s", htmlentities($url, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))); rawoutput("

"); $page_name = $url; if (substr($page_name,0,1)=="/") $page_name=substr($page_name,1); if ($legal_files[$url]){ rawoutput(""); rawoutput("
"); rawoutput(""); ob_start(); show_source($page_name); $t = ob_get_contents(); ob_end_clean(); rawoutput($t); rawoutput("", true); rawoutput("
", true); }else if ($illegal_files[$url]!="" && $illegal_files[$url]!="X"){ $reason = translate_inline($illegal_files[$url]); output("`nCannot view this file: %s`n", $reason); }else { output("`nCannot view this file.`n"); } } popup_footer(); } ?>