diff --git a/code/MaintenanceModeExtension.php b/code/MaintenanceModeExtension.php index 3296349..2659917 100755 --- a/code/MaintenanceModeExtension.php +++ b/code/MaintenanceModeExtension.php @@ -84,22 +84,7 @@ public function hasAllowedIP() { * @return string */ public function getClientIP() { - if (isset($_SERVER['HTTP_CLIENT_IP'])) { - $ipaddress = $_SERVER['HTTP_CLIENT_IP']; - } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { - $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; - } elseif (isset($_SERVER['HTTP_X_FORWARDED'])) { - $ipaddress = $_SERVER['HTTP_X_FORWARDED']; - } elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) { - $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; - } elseif (isset($_SERVER['HTTP_FORWARDED'])) { - $ipaddress = $_SERVER['HTTP_FORWARDED']; - } elseif (isset($_SERVER['REMOTE_ADDR'])) { - $ipaddress = $_SERVER['REMOTE_ADDR']; - } else { - $ipaddress = 'Unknown'; - } - return $ipaddress; + return $this->owner->getRequest()->getIP(); } }//end class MaintenanceMode_Page_ControllerExtension