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 From e5f85442a4fc5413b2d345e66d63e21dce2bc7a3 Mon Sep 17 00:00:00 2001 From: cassio Date: Fri, 2 Nov 2018 17:47:44 +0100 Subject: remove last mod line --- src/admin/report/header.php | 1 - 1 file changed, 1 deletion(-) (limited to 'src/admin/report/header.php') diff --git a/src/admin/report/header.php b/src/admin/report/header.php index 7764527..05375bd 100644 --- a/src/admin/report/header.php +++ b/src/admin/report/header.php @@ -15,7 +15,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . //////////////////////////////////////////////////////////////////////////////// -// Last modified 05/aug/2012 by cassio@ime.usp.br ob_start(); session_start(); -- cgit v1.2.3 From a9dec1f8e0d0d244b63dd75502c54a4f76efe22f Mon Sep 17 00:00:00 2001 From: cassio Date: Fri, 2 Nov 2018 18:06:12 +0100 Subject: bf --- src/admin/report/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/admin/report/header.php') diff --git a/src/admin/report/header.php b/src/admin/report/header.php index 05375bd..50c36af 100644 --- a/src/admin/report/header.php +++ b/src/admin/report/header.php @@ -26,7 +26,6 @@ header ("Pragma: no-cache"); //$loc = $_SESSION['loc']; $loc = $locr = "../.."; -require $locr.'/version.php'; require_once($locr . "/globals.php"); require_once($locr."/db.php"); require_once($locr."/freport.php"); @@ -37,6 +36,7 @@ if(isset($_GET['webcastcode']) && ctype_alnum($_GET['webcastcode'])) { ob_end_flush(); } else { header ("Content-Type: text/html; charset=utf-8"); + require $locr.'/version.php'; if(!ValidSession()) { InvalidSession($_SERVER['PHP_SELF']); ForceLoad($loc."/index.php"); -- cgit v1.2.3 From 336e0c032cc0f9e9547853f814ebffdfd00c5e2d Mon Sep 17 00:00:00 2001 From: cassio Date: Fri, 2 Nov 2018 18:08:02 +0100 Subject: post instead of get --- src/admin/report/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/admin/report/header.php') diff --git a/src/admin/report/header.php b/src/admin/report/header.php index 50c36af..77e524a 100644 --- a/src/admin/report/header.php +++ b/src/admin/report/header.php @@ -30,7 +30,7 @@ require_once($locr . "/globals.php"); require_once($locr."/db.php"); require_once($locr."/freport.php"); -if(isset($_GET['webcastcode']) && ctype_alnum($_GET['webcastcode'])) { +if(isset($_POST['webcastcode']) && ctype_alnum($_POST['webcastcode'])) { header ("Content-transfer-encoding: binary\n"); header ("Content-type: application/force-download"); ob_end_flush(); -- cgit v1.2.3