aboutsummaryrefslogtreecommitdiff
path: root/src/globals.php
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2017-08-10 10:49:24 +0000
committerCassio de Campos <cassiopc@gmail.com>2017-08-10 10:49:24 +0000
commite926ad94df156c2a58e35e24d25229e0ab041aae (patch)
tree38db549a3337693aefe30e99582383d5e853e2f9 /src/globals.php
parent02b4aacc81613792b0fa618692145dc1e2989e42 (diff)
parent94c6cd12dacf9de46051c57e6f6bf216e86c8df8 (diff)
downloadboca-e926ad94df156c2a58e35e24d25229e0ab041aae.tar.gz
boca-e926ad94df156c2a58e35e24d25229e0ab041aae.zip
Merge branch 'master' of github.com:cassiopc/boca
Diffstat (limited to 'src/globals.php')
-rwxr-xr-xsrc/globals.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/globals.php b/src/globals.php
index 1936ad1..ed04bd7 100755
--- a/src/globals.php
+++ b/src/globals.php
@@ -222,14 +222,19 @@ function IntrusionNotify($where) {
function ValidSession() {
if (!isset($_SESSION["usertable"])) return(FALSE);
$gip = getIP();
- if ($_SESSION["usertable"]["userip"] != $gip ||
- $_SESSION["usertable"]["usersession"] != session_id()) return(FALSE);
+ // cassiopc: sites that use multiple IP addresses to go out create a serious problem to check IPs...
+// if(substr($_SESSION["usertable"]["userip"],0,6) != '157.92') {
+// if ($_SESSION["usertable"]["userip"] != $gip ||
+// $_SESSION["usertable"]["usersession"] != session_id()) return(FALSE);
+ // } else {
+ if($_SESSION["usertable"]["usersession"] != session_id()) return(FALSE);
+ // }
if($_SESSION["usertable"]["usermultilogin"] == 't') return(TRUE);
$tmp = DBUserInfo($_SESSION["usertable"]["contestnumber"],
$_SESSION["usertable"]["usersitenumber"],
$_SESSION["usertable"]["usernumber"]);
- if ($tmp["userip"] != $gip) return(FALSE);
+ if ($tmp["userip"] != $gip) return(FALSE); //cassiopc: they may create a problem here too...
return(TRUE);
}
// grava erro no arquivo de log
@@ -350,7 +355,7 @@ function match_network ($nets, $ip) {
$ip_arr = explode('/', $net);
$net_long = ip2long(trim($ip_arr[0]));
- if(trim($ip_arr[1]) != '') {
+ if(count($ip_arr) > 1 && 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])));
} else {