<?php

class LimitAdminAccessExtension extends Extension {
	
	function onBeforeInit() {
		if(Config::inst()->get('IpAccess', 'enabled')) {
			$ipAccess = new IpAccess($this->owner->getRequest()->getIP(), Config::inst()->get('IpAccess', 'allowed_ips'));
				
			if(!$ipAccess->hasAccess()) {
				$reponse = '';
				if(class_exists('ErrorPage', true)) {
					$response = ErrorPage::response_for(404);
				}
				return $this->owner->httpError(404, $response ? $response : 'The requested page could not be found.');
			}
		}
	}
}
<?php

class LimitAdminAccessExtension extends Extension {
	
	function onBeforeInit() {
		if(Config::inst()->get('IpAccess', 'enabled')) {
			$ipAccess = new IpAccess($this->owner->getRequest()->getIP(), Config::inst()->get('IpAccess', 'allowed_ips'));
				
			if(!$ipAccess->hasAccess()) {
				if(class_exists('ErrorPage', true)) {
					$response = ErrorPage::response_for(403);
				}

				$response = ($response) ? $response : 'The requested page could not be found.';

				return $this->owner->httpError(403, $response);
			}
		}
	}
}
Return a 403 Forbidden error page rather than 404
Return a 403 Forbidden error page rather than 404
