Moved development IP address list to dev-ips.php

Signed-off-by: Gergely POLONKAI (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
Polonkai Gergely
2012-06-14 23:38:42 +02:00
parent 38e6384018
commit 476b71f470
19 changed files with 72 additions and 8 deletions

View File

@@ -1,5 +1,7 @@
<?php
require 'dev-ips.php';
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
@@ -8,10 +10,7 @@
// feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
))
|| !in_array(@$_SERVER['REMOTE_ADDR'], $dev_ips)
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');

View File

@@ -1,13 +1,12 @@
<?php
require 'dev-ips.php';
if (!isset($_SERVER['HTTP_HOST'])) {
exit('This script cannot be run from the CLI. Run it from a browser.');
}
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
))) {
if (!in_array(@$_SERVER['REMOTE_ADDR'], $dev_ips)) {
header('HTTP/1.0 403 Forbidden');
exit('This script is only accessible from localhost.');
}

6
web/dev-ips.php Normal file
View File

@@ -0,0 +1,6 @@
<?php
$dev_ips = array(
'127.0.0.1',
'::1',
);