diff options
| author | cassiopc <cassiopc@gmail.com> | 2013-10-28 10:48:47 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2013-10-28 10:48:47 +0000 |
| commit | d753a1aaf9cb31d3e9d48bfe97ea3900e55b5b03 (patch) | |
| tree | 703201fc9e560db4ed095d4b7e722c02382e4363 | |
| parent | b5a167f70dc84391c6a4aaafeff044b80b65dad6 (diff) | |
| download | boca-d753a1aaf9cb31d3e9d48bfe97ea3900e55b5b03.tar.gz boca-d753a1aaf9cb31d3e9d48bfe97ea3900e55b5b03.zip | |
allow config of main url to accept user/password
| -rw-r--r-- | src/fextdata.php | 13 | ||||
| -rw-r--r-- | src/site/index.php | 16 | ||||
| -rw-r--r-- | 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 <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -// 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 <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -// 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 "<html><head><title>Site Page</title>\n"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n"; echo "<link rel=stylesheet href=\"../Css.php\" type=\"text/css\">\n"; @@ -117,10 +127,8 @@ Cannot access main server. Check IP address,<br> password and internet connectio <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="+1"> <?php if($id==$idextra) { - $contest=$_SESSION["usertable"]["contestnumber"]; - $ct = DBContestInfo($contest); echo "Credentials to connect to main server<br>"; - echo "at URL: " . $ct['contestmainsiteurl']; + echo "at URL: " . $mainsiteurl[0]; } else echo "<u>Status</u>: initial connection established<br><br>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 @@ <?php //////////////////////////////////////////////////////////////////////////////// //BOCA Online Contest Administrator -// Copyright (C) 2003-2012 by BOCA Development Team (bocasystem@gmail.com) +// Copyright (C) 2003-2013 by BOCA Development Team (bocasystem@gmail.com) // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -// 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 .= "<br><br><center><b>To submit a program, just fill in the following f " <td width=\"75%\">\n". " <select name=\"problem\" onclick=\"Arquivo()\">\n"; $prob = DBGetProblems($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usertype"]=='judge'); -$strtmp .= "<option value=\"-1\"></option>\n"; +$strtmp .= "<option value=\"-1\"> -- </option>\n"; for ($i=0;$i<count($prob);$i++) $strtmp .= "<option value=\"" . $prob[$i]["number"] . "\">" . $prob[$i]["problem"] . "</option>\n"; $strtmp .= " </select>\n". @@ -147,7 +147,7 @@ $strtmp .= " </select>\n". " <td width=\"75%\"> \n". " <select name=\"language\" onclick=\"Arquivo()\">\n"; $lang = DBGetLanguages($_SESSION["usertable"]["contestnumber"]); -$strtmp .= "<option value=\"-1\"></option>\n"; +$strtmp .= "<option value=\"-1\"> -- </option>\n"; for ($i=0;$i<count($lang);$i++) $strtmp .= "<option value=\"" . $lang[$i]["number"] . "\">" . $lang[$i]["name"] . "</option>\n"; $strtmp .= " </select>\n". |