From a9aa438ea0558eb0044cf1e54a9190ddb41b65e5 Mon Sep 17 00:00:00 2001 From: cassio Date: Tue, 2 Jul 2013 09:44:46 +0400 Subject: restructuring of boca's git --- boca-1.5.2/src/filewindow.php | 120 ------------------------------------------ 1 file changed, 120 deletions(-) delete mode 100644 boca-1.5.2/src/filewindow.php (limited to 'boca-1.5.2/src/filewindow.php') diff --git a/boca-1.5.2/src/filewindow.php b/boca-1.5.2/src/filewindow.php deleted file mode 100644 index 594e483..0000000 --- a/boca-1.5.2/src/filewindow.php +++ /dev/null @@ -1,120 +0,0 @@ -. -//////////////////////////////////////////////////////////////////////////////// -// modified 21/july/2011 by cassio@ime.usp.br -ob_start(); -session_start(); -require_once("globals.php"); - -if(!ValidSession()) { - echo "View Page"; - InvalidSession("filewindow.php"); - echo ""; - exit; -} - -if(!isset($_GET["oid"]) || !is_numeric($_GET["oid"]) || !isset($_GET["filename"]) || - !isset($_GET["check"]) || $_GET["check"]=="") { - echo "View Page"; - IntrusionNotify("Bad parameters in filewindow.php"); - echo ""; - exit; -} - -$cf = globalconf(); -$fname = decryptData(rawurldecode($_GET["filename"]), session_id() . $cf["key"]); -$msg = ''; -if(isset($_GET["msg"])) - $msg = rawurldecode($_GET["msg"]); - -$p = myhash($_GET["oid"] . $fname . $msg . session_id() . $cf["key"]); - -if($p != $_GET["check"]) { - echo "View Page"; - IntrusionNotify("Parameters modified in filewindow.php"); - echo ""; - exit; -} - -require_once("db.php"); - -if ($_GET["oid"]>=0) { - $c = DBConnect(); - DBExec($c, "begin work"); - - if (($lo = DB_lo_open ($c, $_GET["oid"], "r")) === false) { - echo "View Page"; - DBExec($c, "rollback work"); - LOGError ("Unable to download file (" . basename($fname) . ")"); - MSGError ("Unable to download file (" . basename($fname) . ")"); - echo ""; - exit; - } - - header ("Expires: " . gmdate("D, d M Y H:i:s") . " GMT"); - header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header ("Cache-Control: no-cache, must-revalidate"); - header ("Pragma: no-cache"); - header ("Content-type: text/plain"); - -// echo "\n"; - if($msg != '') { -// echo "

".$_GET["msg"]."

"; - echo $msg ."\n"; - echo $msg ."\n"; - echo $msg ."\n\n\n"; - } -// echo "
\n";
-  if (DB_lo_read_tobrowser ($_SESSION["usertable"]["contestnumber"],$lo) === false) {
-        header ("Content-type: text/html");
-	echo "View Page";
-	DBExec($c, "rollback work");
-	LOGError ("Unable to open file (" . basename($fname) . ")");
-	MSGError ("Unable to open file (" . basename($fname) . ")");
-	echo "";
-	exit;
-  }
-  ob_end_flush();
-//  echo "
\n"; - DB_lo_close($lo); - if($msg != '') { -// echo "

".$_GET["msg"]."

"; - echo "\n\n\n".$msg ."\n"; - echo $msg ."\n"; - echo $msg ."\n"; - } - - DBExec($c, "commit work"); - DBClose($c); -} else { - header ("Expires: " . gmdate("D, d M Y H:i:s") . " GMT"); - header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header ("Cache-Control: no-cache, must-revalidate"); - header ("Pragma: no-cache"); - if (($str = file_get_contents($fname))===false) { - header ("Content-type: text/html"); - echo "View Page"; - MSGError ("Unable to open file (" . basename($fname) . ")"); - LOGError ("Unable to open file (" . basename($fname) . ")"); - echo ""; - exit; - } - header ("Content-type: text/plain"); - echo decryptData($str, $cf["key"]); - ob_end_flush(); -} -?> -- cgit v1.2.3