From c27afe5f261386bcf219738dcc8c9d5dce7cf93a Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 11 Mar 2003 12:02:28 +0000 Subject: [PATCH] fixed ip retrieval code --- lib/session/Session.inc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/session/Session.inc b/lib/session/Session.inc index fb34503..4c2fe28 100644 --- a/lib/session/Session.inc +++ b/lib/session/Session.inc @@ -160,16 +160,16 @@ class Session { * Retrieves and returns the IP address of the current user */ function getClientIP() { - // get client ip - if(getenv("HTTP_CLIENT_IP")) { - $ip = getenv("HTTP_CLIENT_IP"); + // get client ip + if (getenv("REMOTE_ADDR")) { + $ip = getenv("REMOTE_ADDR"); } elseif(getenv("HTTP_X_FORWARDED_FOR")) { $forwardedip = getenv("HTTP_X_FORWARDED_FOR"); list($ip,$ip2,$ip3,$ip4)= split (",", $forwardedip); - } else { - $ip = getenv("REMOTE_ADDR"); + } elseif (getenv("HTTP_CLIENT_IP")) { + $ip = getenv("HTTP_CLIENT_IP"); } return $ip; - } + } } ?> -- libgit2 0.21.4