aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-11-09 11:50:20 +0000
committercassiopc <cassiopc@gmail.com>2012-11-09 11:50:20 +0000
commited3268aac571a73410da657c7b1318533e9c1f0f (patch)
tree3dc11889288a35215ac439de62d5a61bc07db355
parent987375d85eb88fd1a974b7d99e5288fe3f796b21 (diff)
downloadboca-ed3268aac571a73410da657c7b1318533e9c1f0f.tar.gz
boca-ed3268aac571a73410da657c7b1318533e9c1f0f.zip
fixed issue to limit access by IP for teams
-rw-r--r--boca-1.5.2/src/frun.php3
-rwxr-xr-x[-rw-r--r--]boca-1.5.2/src/globals.php5
-rw-r--r--boca-1.5.2/tools/icpc.etc.tgzbin9525 -> 9525 bytes
3 files changed, 5 insertions, 3 deletions
diff --git a/boca-1.5.2/src/frun.php b/boca-1.5.2/src/frun.php
index 97abd1d..14395e3 100644
--- a/boca-1.5.2/src/frun.php
+++ b/boca-1.5.2/src/frun.php
@@ -1015,8 +1015,7 @@ function exitmsg($retval) {
$retval = 3; // runtime error
}
else if($retval==9) {
- $answer="Runtime error";
- $retval = 3; // runtime error
+ $answer="Runtime error (or possible java class name mismatch)";
} else {
$answer="Unknown autojudge status";
$retval = 7;
diff --git a/boca-1.5.2/src/globals.php b/boca-1.5.2/src/globals.php
index fc83e11..66047ef 100644..100755
--- a/boca-1.5.2/src/globals.php
+++ b/boca-1.5.2/src/globals.php
@@ -311,9 +311,12 @@ function match_network ($nets, $ip) {
$ip_arr = explode('/', $net);
$net_long = ip2long(trim($ip_arr[0]));
+ if(trim($ip_arr[1]) != '') {
$x = ip2long(trim($ip_arr[1]));
$mask = long2ip($x) == ((int) trim($ip_arr[1])) ? $x : 0xffffffff << (32 - ((int) trim($ip_arr[1])));
- $ip_long = ip2long($ip);
+ } else { $mask=0xffffffff;
+ }
+ $ip_long = ip2long($ip);
if ($rev) {
if (($ip_long & $mask) != ($net_long & $mask)) return true;
diff --git a/boca-1.5.2/tools/icpc.etc.tgz b/boca-1.5.2/tools/icpc.etc.tgz
index 31b46cb..0f7a4e6 100644
--- a/boca-1.5.2/tools/icpc.etc.tgz
+++ b/boca-1.5.2/tools/icpc.etc.tgz
Binary files differ