Dr. Byte - hope you can help - the server company came back and gave my customer the following: The told him to replace server array code with:
PHP Code:
HTTP_X_CLUSTER_CLIENT_IP
I looked up the "Get IP function and found the following -
(I'm pulling this from the functions_general.php file around line 756)
PHP Code:
////
function zen_get_ip_address() {
if (isset($_SERVER)) {
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
} else {
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} elseif (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP');
} else {
$ip = getenv('REMOTE_ADDR');
}
}
return $ip;
}
Is the following what they are asking me to do and does it makes sense to you? As I tried it and nothing changed -
PHP Code:
function zen_get_ip_address() {
if (isset($_SERVER)) {
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif (isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP '])) {
$ip = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP '];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
} else {
if (getenv('HTTP_X_FORWARDED_FOR')) {
$ip = getenv('HTTP_X_FORWARDED_FOR');
} elseif (getenv('HTTP_X_CLUSTER_CLIENT_IP ')) {
$ip = getenv('HTTP_X_CLUSTER_CLIENT_IP ');
} else {
$ip = getenv('REMOTE_ADDR');
}
}
return $ip;
}
I'm really unfamiliar with what they are trying to do here, but the company fully admitted it was their setup that was blocking the IP detection. (Why they are doing this as standard practice is beyond me - one more reason I have my own servers - arghhh)-.
Is there somewhere else I need to change this code. I saw a similar line of code in the "Who online" file - I think I'm a bit outside of my expertise here.
Ruth