X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fsecurity.inc.php;h=9e9aa4526e7c6f5ce89da65ee6bbff987ebb3c3e;hb=e0ee31204dbb8e43870716190e4549257416fcb8;hp=e0b1d1485ccb4cca4ba9a6b23a8ff0ce3d759c72;hpb=63f06a435ff8e9c058b1dee1eb97fff99606d490;p=platal.git diff --git a/include/security.inc.php b/include/security.inc.php index e0b1d14..9e9aa45 100644 --- a/include/security.inc.php +++ b/include/security.inc.php @@ -1,6 +1,6 @@ $ip) { + $v = ip_to_uint($ip); + if (is_null($v)) { + unset($ips[$key]); + } else { + $ips[$key] = '(ip & mask) = (' . $v . '& mask)'; + } } $res = XDB::query('SELECT state, description FROM ip_watch @@ -80,7 +85,8 @@ function check_redirect($red = null) { require_once 'emails.inc.php'; if (is_null($red)) { - $red = new Redirect(S::v('uid')); + $user = S::user(); + $red = new Redirect($user); } if ($red->get_uid() == S::v('uid')) { $_SESSION['no_redirect'] = !$red->other_active('');