From 21ecbcefd0aef463bc02ece6968757b407ea38f1 Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Tue, 17 Apr 2012 16:44:25 +0000 Subject: [PATCH] Moved IP checking code to check_ip.php --- web/app_dev.php | 8 +------- web/check_ip.php | 11 +++++++++++ web/config.php | 8 +------- 3 files changed, 13 insertions(+), 14 deletions(-) create mode 100644 web/check_ip.php diff --git a/web/app_dev.php b/web/app_dev.php index 0ba2029..6b8d760 100644 --- a/web/app_dev.php +++ b/web/app_dev.php @@ -6,13 +6,7 @@ // this check prevents access to debug front controllers that are deployed by accident to production servers. // feel free to remove this, extend it, or make something more sophisticated. -if (!in_array(@$_SERVER['REMOTE_ADDR'], array( - '127.0.0.1', - '::1', -))) { - header('HTTP/1.0 403 Forbidden'); - exit('You (' . @$_SERVER['REMOTE_ADDR'] . ') are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); -} +require_once __DIR__.'/check_ip.php'; require_once __DIR__.'/../app/bootstrap.php.cache'; require_once __DIR__.'/../app/AppKernel.php'; diff --git a/web/check_ip.php b/web/check_ip.php new file mode 100644 index 0000000..7240642 --- /dev/null +++ b/web/check_ip.php @@ -0,0 +1,11 @@ +