From d753a1aaf9cb31d3e9d48bfe97ea3900e55b5b03 Mon Sep 17 00:00:00 2001 From: cassiopc Date: Mon, 28 Oct 2013 11:48:47 +0100 Subject: allow config of main url to accept user/password --- src/fextdata.php | 13 ++++++++++++- src/site/index.php | 16 ++++++++++++---- src/team/run.php | 8 ++++---- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/fextdata.php b/src/fextdata.php index 37e0c9f..d0a272b 100644 --- a/src/fextdata.php +++ b/src/fextdata.php @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . //////////////////////////////////////////////////////////////////////////////// -// Last modified 02/sep/2013 by cassio@ime.usp.br +// Last modified 28/oct/2013 by cassio@ime.usp.br function scoretransfer($putname, $localsite) { $ds = DIRECTORY_SEPARATOR; @@ -24,6 +24,17 @@ function scoretransfer($putname, $localsite) { if(!is_readable($privatedir . $ds . 'remotescores' . $ds . "otherservers")) return; $localfile = "score_site" . $localsite . "_" . $localsite . "_x.dat"; $remotesite = @file($privatedir . $ds . 'remotescores' . $ds . "otherservers"); + + $contest=$_SESSION["usertable"]["contestnumber"]; + if($contest != '' && ($ct = DBContestInfo($contest)) != null) { + if(trim($ct['contestmainsiteurl']) != '') { + $tmp = explode(' ',$ct['contestmainsiteurl']); + if(count($tmp) == 3) { + $remotesite[count($remotesite)] = $ct['contestmainsiteurl']; + } + } + } + for($i = 0; $i < count($remotesite); $i++) { $sitedata = explode(' ', $remotesite[$i]); if(count($sitedata) < 3) continue; diff --git a/src/site/index.php b/src/site/index.php index 0afc7e4..4e3f20d 100644 --- a/src/site/index.php +++ b/src/site/index.php @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . //////////////////////////////////////////////////////////////////////////////// -// Last modified 02/sep/2013 by cassio@ime.usp.br +// Last modified 28/oct/2013 by cassio@ime.usp.br require('header.php'); if(isset($_GET['mainuser']) && isset($_GET['mainpass']) && $_GET['mainuser']!="" && $_GET['mainpass']!="") { $_SESSION['mainuser'] = $_GET['mainuser']; @@ -32,6 +32,16 @@ $smp = isset($_SESSION['mainpass'])? $_SESSION['mainpass']: ""; $smc = isset($_SESSION['check'])? $_SESSION['check']: ""; //MSGError("id=".$smi." user=".$smu." pass=".$smp. " check=".$smc); +$contest=$_SESSION["usertable"]["contestnumber"]; +if($contest != '' && is_numeric($contest)) { + $ct = DBContestInfo($contest); + $mainsiteurl = explode(' ',$ct['contestmainsiteurl']); +// if(count($mainsiteurl)==3) { +// if($smu == '') $smu = $mainsiteurl[1]; +// if($smp == '') $smp = myhash($mainsiteurl[2]); +// } +} + echo "Site Page\n"; echo "\n"; echo "\n"; @@ -117,10 +127,8 @@ Cannot access main server. Check IP address,
password and internet connectio
"; - echo "at URL: " . $ct['contestmainsiteurl']; + echo "at URL: " . $mainsiteurl[0]; } else echo "Status: initial connection established

To guarantee an encrypted connection, please type the same password again:"; ?> diff --git a/src/team/run.php b/src/team/run.php index 270a672..9ae5cd2 100644 --- a/src/team/run.php +++ b/src/team/run.php @@ -1,7 +1,7 @@ . //////////////////////////////////////////////////////////////////////////////// -// Last modified 21/jul/2012 by cassio@ime.usp.br +// Last modified 28/oct/2013 by cassio@ime.usp.br require('header.php'); if (isset($_FILES["sourcefile"]) && isset($_POST["problem"]) && isset($_POST["Submit"]) && isset($_POST["language"]) && @@ -136,7 +136,7 @@ $strtmp .= "

To submit a program, just fill in the following f " \n". " \n". @@ -147,7 +147,7 @@ $strtmp .= " \n". " \n". " \n". -- cgit v1.2.3