Odyssey
tfiles.prg
1 <?php
2 $monLibrary= dirname(__FILE__) . "/../library";
3 require_once("$monLibrary/cu_top.i");
4 require_once("$monLibrary/ck_hticket.i");
5 
6  if (!CheckPerm($link, $Hu, basename($_SERVER['SCRIPT_NAME']), $_SERVER['REMOTE_ADDR'])) {
7  // ** Permissions failed
8  // ** redirect to new page
9  header("Location: /hcuadm/hcu_noperm.prg");
10  exit;
11  }
12 
13 $protectdir = "/home";
14 
15 $filename = $protectdir . $_SERVER['PATH_INFO'];
16 if (is_readable($filename)) {
17  print "<HTML><HEAD><TITLE>Show</TITLE></HEAD><BODY><b>$filename</b><br><PRE>";
18  readfile($filename);
19  print "</PRE></BODY></HTML>";
20 } else {
21  header("Status: 404 Not Found");
22  print <<<EOF
23 <HTML><HEAD>
24 <TITLE>404 Not Found</TITLE>
25 </HEAD><BODY>
26 <H1>Not Found</H1>
27 The requested URL ${_SERVER['PHP_SELF']} was not found on this server.<P>
28 <HR>
29 <ADDRESS>${_SERVER['SERVER_SIGNATURE']}</ADDRESS>
30 </BODY></HTML>
31 EOF;
32 }
33 ?>