projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adds address edition in entreprise validation.
[platal.git]
/
include
/
security.inc.php
diff --git
a/include/security.inc.php
b/include/security.inc.php
index
e0b1d14
..
9e9aa45
100644
(file)
--- a/
include/security.inc.php
+++ b/
include/security.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
8
Polytechnique.org *
+ * Copyright (C) 2003-200
9
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-34,8
+34,13
@@
function check_ip($level)
$ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
}
$ips[] = $_SERVER['REMOTE_ADDR'];
$ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
}
$ips[] = $_SERVER['REMOTE_ADDR'];
- foreach ($ips as &$ip) {
- $ip = '(ip & mask) = (' . ip_to_uint($ip) . '& mask)';
+ foreach ($ips as $key=>$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
}
$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)) {
{
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('');
}
if ($red->get_uid() == S::v('uid')) {
$_SESSION['no_redirect'] = !$red->other_active('');