Odyssey
tlines.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 
14 $protectdir = "/home";
15 
16 $filename = $protectdir . $_SERVER['PATH_INFO'];
17 if (is_readable($filename)) {
18  $fp = popen ("/usr/bin/tail -30 $filename", "r");
19  print "<HTML><HEAD><TITLE>Tail</TITLE></HEAD><BODY><b>tail -30 $filename</b><br>
20 <PRE>";
21  fpassthru($fp);
22  print "</PRE></BODY></HTML>";
23 } else {
24  header("Status: 404 Not Found");
25  print <<<EOF
26 <HTML><HEAD>
27 <TITLE>404 Not Found</TITLE>
28 </HEAD><BODY>
29 <H1>Not Found</H1>
30 The requested URL ${_SERVER['PHP_SELF']} was not found on this server.<P>
31 <HR>
32 <ADDRESS>${_SERVER['SERVER_SIGNATURE']}</ADDRESS>
33 </BODY></HTML>
34 EOF;
35 }
36 ?>