X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=public_html%2Fcgi-bin%2Fpostget.php;h=244f682cb1e04c83a2d1b65a65cbb5c8a3d06daf;hp=5d5e7d59eaa199ddf6d0302690542d906d438780;hb=951fcecb34c766ab1330f88efa8dd095618c0bf6;hpb=a6b490e7f3ea6e866d1786d6e6307f0ba462561e diff --git a/public_html/cgi-bin/postget.php b/public_html/cgi-bin/postget.php index 5d5e7d5..244f682 100644 --- a/public_html/cgi-bin/postget.php +++ b/public_html/cgi-bin/postget.php @@ -1,21 +1,55 @@ $val) { + if (ereg("^_priv_(postget.*)\$",$val,$matched)) { + $permit=array("127.0.0.1"=>1,"192.168.192.1"=>1,"192.168.90.11"=>1); + if (!$permit[$HTTP_SERVER_VARS["REMOTE_ADDR"]]) + print("Forbidden:" + ." REMOTE_ADDR=".htmlspecialchars($HTTP_SERVER_VARS["REMOTE_ADDR"]) + .",key=".htmlspecialchars($key) + .",val=".htmlspecialchars($val) + ."
" + ); + else + $HTTP_GET_VARS[$key]=chop(join(" ",file("/home/short/priv/".$matched[1],false/*use_include_path*/))); + } + } + + if ($getget) { + $first='?'; + foreach ($HTTP_GET_VARS as $key=>$val) { + $where.="${first}".urlencode($key)."=".urlencode($val); + $first='&'; + } + header("Location: $where"); + } header("Content-type: text/html"); print(''."\n"); ?> -postget +postget

\n"); - unset($HTTP_GET_VARS["_postget"]); - foreach ($HTTP_GET_VARS as $key=>$val) { - if (ereg("^_priv_(postget.*)\$",$val,$matched)) - $val=chop(join(" ",file("/home/short/priv/".$matched[1],false/*use_include_path*/))); - print("\n"); + if ($getget) { + print("" + ."

\n" + ."get\n" + ."

\n"); + } + else { + print("" + ."\n" + ."

\n"); + foreach ($HTTP_GET_VARS as $key=>$val) + print("\n"); + print("\n"); + print("

\n"); } - print("\n"); - print("

\n"); ?> - +