Changeset 35415 for trunk/dvodist/www-util
- Timestamp:
- Apr 19, 2013, 4:16:39 PM (13 years ago)
- Location:
- trunk/dvodist/www-util
- Files:
-
- 3 edited
-
dvodist.page.mkd (modified) (2 diffs)
-
ipp.php (modified) (7 diffs)
-
ippdata.page.mkd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dvodist/www-util/dvodist.page.mkd
r34748 r35415 12 12 $fromProxy = $_SERVER['HTTP_X_FORWARDED_FOR'] && ($_SERVER['REMOTE_ADDR'] == $ifaProxy); 13 13 if ($fromProxy) { 14 $rootdir = " ";14 $rootdir = "@ROOTWWW@"; 15 15 } else { 16 $rootdir = "@ROOT DIR@";16 $rootdir = "@ROOTWWW@@ROOTDIR@"; 17 17 } 18 18 … … 20 20 21 21 $script = basename($_SERVER[SCRIPT_NAME]); 22 do_markdown ($script );22 do_markdown ($script, $rootdir); 23 23 24 24 menu_end(); -
trunk/dvodist/www-util/ipp.php
r35238 r35415 1 1 <?php 2 3 global $rootdir;4 2 5 3 function head ($title) { … … 22 20 echo "<body>\n"; 23 21 22 echo "<!-- Start eXTReMe Pro Tracker Code V3/7\n"; 23 echo "Login: emagnier\n"; 24 echo "Help: https://www.extremetracking.com\n"; 25 echo "Installation instructions:\n"; 26 echo "Copy and paste this code between the two body tags into the\n"; 27 echo "*source* of your pages or in your footer/template. Best is\n"; 28 echo "to use a normal text editor such as notepad. -->\n"; 29 echo "<script type=\"text/javascript\"><!--\n"; 30 echo "EXd=document;location.protocol==\"https:\"?EXp=\"https\":EXp=\"http\";EXs=\"src\";\n"; 31 echo "EXd.write(\"<img \"+EXs+\"=\"+EXp+\"://nht-2.extreme-dm.com/n2.g?login=emagnier\",\n"; 32 echo "\"&url=\"+escape(EXd.URL)+\"&jv=\"+navigator.javaEnabled()+\"&\",\n"; 33 echo "\"d=\"+screen.width+\"x\"+screen.height+\"&c=\"+screen.colorDepth+\"\",\n"; 34 echo "\"&l=\"+escape(EXd.referrer)+\" width=0 height=0>\");//-->\n"; 35 echo "</script><noscript><img height=\"1\" width=\"1\" alt=\"\"\n"; 36 echo "src=\"http://nht-2.extreme-dm.com/n2.g?login=emagnier&url=nojs\">\n"; 37 echo "</noscript>\n"; 38 echo "<!-- End eXTReMe Pro Tracker Code -->\n"; 39 24 40 if (! $project) { $project = "none"; } 25 41 26 // echo "<p style=\"font-size:50%\">host: $ WWWHOST, db: $DBHOST</p>\n";42 // echo "<p style=\"font-size:50%\">host: $root</p>\n"; 27 43 echo "<table class=page cellspacing=10px><tr><td valign=top>\n"; 28 44 echo "<table class=menu cellspacing=0px>\n"; … … 76 92 } 77 93 78 global $rootdir;79 80 94 // hi-lite the current page (use select-style, not style) 81 95 $thisname = $_SERVER[SCRIPT_NAME]; 82 $page = $root dir. $base;96 $page = $root . $base; 83 97 if ($page == $thisname) { 84 98 $style = trim($line[1]); … … 92 106 break; 93 107 case 'picture': 94 // prepend the root dirif needed (reference to /)108 // prepend the root if needed (reference to /) 95 109 if ($name[0] == '/') { 96 110 $name = $root . $name; … … 99 113 break; 100 114 case 'piclink': 101 // prepend the root dirif needed (reference to /)115 // prepend the root if needed (reference to /) 102 116 if ($name[0] == '/') { 103 117 $name = $root . $name; … … 249 263 250 264 // lines which start with @ are processed by 'dirlist', all others are processed by Markdown 251 function do_markdown ($source) { 265 function do_markdown ($source, $root) { 266 252 267 if (!file_exists($source)) return; 253 268 … … 258 273 $to_dirlist = ""; 259 274 while ($line = fgets ($file, 1024)) { 275 // replace @WWWHOST@ with $root 276 $line = str_replace ("@WWWHOST@", $root, $line); 277 260 278 // echo "line: $line"; 261 279 if (!strncmp($line, "@", 1)) { -
trunk/dvodist/www-util/ippdata.page.mkd
r34748 r35415 7 7 // if we come in directly, the top-level directory should be /dvodist 8 8 // if we come in from the ippops1 proxy, we need to set the root to / 9 $ ifaProxy = "128.171.227.208";9 $realHost = "ipp.ifa.hawaii.edu"; 10 10 11 // is the request coming from our proxY? 12 $fromProxy = $_SERVER['HTTP_X_FORWARDED_FOR'] && ($_SERVER['REMOTE_ADDR'] == $ifaProxy); 13 if ($fromProxy) { 14 $rootdir = ""; 15 } else { 16 $rootdir = "@ROOTDIR@"; 17 } 11 // is the request coming from our proxy? 12 if ($_SERVER['SERVER_NAME'] == $realHost) { 13 $rootdir = "@ROOTWWW@"; 14 } else { 15 $rootdir = "@ROOTWWW@@ROOTDIR@"; 16 } 18 17 19 18 menu("$utils/ippdata.menu.dat", 'Pan-STARRS 1 Data Distribution Server', $rootdir, "$rootdir/ipp.css", '', ''); 20 19 21 20 $script = basename($_SERVER[SCRIPT_NAME]); 22 do_markdown ($script );21 do_markdown ($script, $rootdir); 23 22 24 23 menu_end(); 25 24 ?> 26 27 // generic proxy detection28 // if ( $_SERVER['HTTP_X_FORWARDED_FOR']29 // || $_SERVER['HTTP_X_FORWARDED']30 // || $_SERVER['HTTP_FORWARDED_FOR']31 // || $_SERVER['HTTP_CLIENT_IP']32 // || $_SERVER['HTTP_VIA']33 // || in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))34 // || @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30))35 // {36 // exit('Proxy detected');37 // }38 39 // list server info:40 // $varlist = array ('SCRIPT_NAME', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_VIA', 'REMOTE_ADDR');41 //42 // foreach ($varlist as $name) {43 // echo "$name : $_SERVER[$name]<br>\n";44 // }45 //46 // echo "get list<br>\n";47 // foreach ($_GET as $key => $value) {48 // echo "$key : $value<br>\n";49 // }50
Note:
See TracChangeset
for help on using the changeset viewer.
