From 912579a9a09562930845c80dcfae3cfd8da18414 Mon Sep 17 00:00:00 2001 From: cassiopc Date: Thu, 6 Nov 2014 10:54:24 +0000 Subject: possibility of automatic login of a user using indexscore.php --- src/indexscore.php | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 src/indexscore.php (limited to 'src') diff --git a/src/indexscore.php b/src/indexscore.php new file mode 100644 index 0000000..9ec2d1d --- /dev/null +++ b/src/indexscore.php @@ -0,0 +1,149 @@ +. +//////////////////////////////////////////////////////////////////////////////// +// Last modified 05/aug/2012 by cassio@ime.usp.br + +ob_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(); +$_SESSION["loc"] = dirname($_SERVER['PHP_SELF']); +if($_SESSION["loc"]=="/") $_SESSION["loc"] = ""; +$_SESSION["locr"] = dirname(__FILE__); +if($_SESSION["locr"]=="/") $_SESSION["locr"] = ""; + +require_once("globals.php"); +require_once("db.php"); + +if (!isset($_GET["name"])) { + if (ValidSession()) + DBLogOut($_SESSION["usertable"]["contestnumber"], + $_SESSION["usertable"]["usersitenumber"], $_SESSION["usertable"]["usernumber"], + $_SESSION["usertable"]["username"]=='admin'); + session_unset(); + session_destroy(); + session_start(); + $_SESSION["loc"] = dirname($_SERVER['PHP_SELF']); + if($_SESSION["loc"]=="/") $_SESSION["loc"] = ""; + $_SESSION["locr"] = dirname(__FILE__); + if($_SESSION["locr"]=="/") $_SESSION["locr"] = ""; +} +if(isset($_GET["getsessionid"])) { + echo session_id(); + exit; +} +ob_end_flush(); + +require_once('version.php'); + +?> +BOCA Online Contest Administrator <?php echo $BOCAVERSION; ?> - Login + + + + + +\n"; + echo "document.location='" . $_SESSION["usertable"]["usertype"] . "/index.php';\n"; + echo "\n"; + } + exit; + } + } +} else { + echo "\n"; +} +?> + + + + + + +
+
+
+ + + + + + + +
+
+ BOCA Login
+
+ + + + + + + + + +
+ Name + + +
Password + +
+ +
+
+
+
+ -- cgit v1.2.3