From aa629c7e4b35d0cd40f8191348a57ef69324c2a5 Mon Sep 17 00:00:00 2001 From: cassio Date: Fri, 2 Nov 2018 17:41:47 +0100 Subject: improving webcast sharing --- src/admin/report/header.php | 64 +++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 29 deletions(-) (limited to 'src/admin/report/header.php') diff --git a/src/admin/report/header.php b/src/admin/report/header.php index 1d191de..7764527 100644 --- a/src/admin/report/header.php +++ b/src/admin/report/header.php @@ -18,48 +18,54 @@ // Last modified 05/aug/2012 by cassio@ime.usp.br ob_start(); +session_start(); 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/html; charset=utf-8"); -session_start(); -ob_end_flush(); //$locr = $_SESSION['locr']; //$loc = $_SESSION['loc']; $loc = $locr = "../.."; require $locr.'/version.php'; require_once($locr . "/globals.php"); -if(!ValidSession()) { - InvalidSession($_SERVER['PHP_SELF']); - ForceLoad($loc."/index.php"); -} -if($_SESSION["usertable"]["usertype"] != "admin") { - IntrusionNotify($_SERVER['PHP_SELF']); - ForceLoad($loc."/index.php"); -} - require_once($locr."/db.php"); require_once($locr."/freport.php"); -echo "Report Page\n"; -echo "\n"; +if(isset($_GET['webcastcode']) && ctype_alnum($_GET['webcastcode'])) { + header ("Content-transfer-encoding: binary\n"); + header ("Content-type: application/force-download"); + ob_end_flush(); +} else { + header ("Content-Type: text/html; charset=utf-8"); + if(!ValidSession()) { + InvalidSession($_SERVER['PHP_SELF']); + ForceLoad($loc."/index.php"); + } + if($_SESSION["usertable"]["usertype"] != "admin") { + IntrusionNotify($_SERVER['PHP_SELF']); + ForceLoad($loc."/index.php"); + } + ob_end_flush(); -echo "\n"; + echo "Report Page\n"; + echo "\n"; -$contest=$_SESSION["usertable"]["contestnumber"]; -if(($ct = DBContestInfo($contest)) == null) - ForceLoad($loc."/index.php"); -$site=$_SESSION["usertable"]["usersitenumber"]; -if(($st = DBSiteInfo($contest,$site)) == null) - ForceLoad($loc."/index.php"); + echo "\n"; -echo "\n"; -echo "\n"; -echo "
"; -echo "\"\""; -echo "BOCA"; -echo "\n"; -echo $ct["contestname"] . " - " . $st["sitename"] . "
\n"; -?> + $contest=$_SESSION["usertable"]["contestnumber"]; + if(($ct = DBContestInfo($contest)) == null) + ForceLoad($loc."/index.php"); + $site=$_SESSION["usertable"]["usersitenumber"]; + if(($st = DBSiteInfo($contest,$site)) == null) + ForceLoad($loc."/index.php"); + + echo "\n"; + echo "\n"; + echo "
"; + echo "\"\""; + echo "BOCA"; + echo "\n"; + echo $ct["contestname"] . " - " . $st["sitename"] . "
\n"; +} +?> \ No newline at end of file -- cgit v1.2.3