Hi everybody!
I have seen in the class_core.php there is a proxy detection implemented in vBulletin. I use pound as software load balancer, which delivers the client IP as HTTP_X_FORWARDED_FOR.
But the alt_ip = ip code doesn't work.
All my users&visitors get the ip of pound (REMOTE_ADDR)
And I get password false trouble for all users (because only one IP for all visitors/users)
Perhaps there is a bug? My load balancer does have a 87.1xx.xx.xx IP - not an interal IP.
Perhaps you see a solution or if there is a bug - please correkt it
I have seen in the class_core.php there is a proxy detection implemented in vBulletin. I use pound as software load balancer, which delivers the client IP as HTTP_X_FORWARDED_FOR.
But the alt_ip = ip code doesn't work.
All my users&visitors get the ip of pound (REMOTE_ADDR)
And I get password false trouble for all users (because only one IP for all visitors/users)
Perhaps there is a bug? My load balancer does have a 87.1xx.xx.xx IP - not an interal IP.
Perhaps you see a solution or if there is a bug - please correkt it
Code:
/** * Fetches an alternate IP address of the current visitor, attempting to detect proxies etc. * * @return string */ function fetch_alt_ip() { if (isset($_SERVER['HTTP_CLIENT_IP'])) { $alt_ip = $_SERVER['HTTP_CLIENT_IP']; } else if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND preg_match_all('#\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}#s', $_SERVER['HTTP_X_FORWARDED_FOR'], $matches)) { // make sure we dont pick up an internal IP defined by RFC1918 foreach ($matches[0] AS $ip) { if (!preg_match("#^(10|172\.16|192\.168)\.#", $ip)) { $alt_ip = $ip; break; } } } else if (isset($_SERVER['HTTP_FROM'])) { $alt_ip = $_SERVER['HTTP_FROM']; } else { $alt_ip = $_SERVER['REMOTE_ADDR']; } return $alt_ip; } }
Comment