mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:07 +01:00
remove further private IPs from proxys
This commit is contained in:
parent
aad4db1617
commit
4622c28bb2
@ -1260,11 +1260,16 @@ class Session
|
||||
/**
|
||||
* Get the ip address of current users
|
||||
*
|
||||
* We remove further private IPs (from proxys) as they invalidate user
|
||||
* sessions, when they change because of multiple proxys.
|
||||
*
|
||||
* @return string ip address
|
||||
*/
|
||||
public static function getuser_ip()
|
||||
{
|
||||
return isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
|
||||
return isset($_SERVER['HTTP_X_FORWARDED_FOR']) ?
|
||||
preg_replace('/,10\..*$/', '', $_SERVER['HTTP_X_FORWARDED_FOR']) :
|
||||
$_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user