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

45
.gitmodules vendored Normal file
View File

@@ -0,0 +1,45 @@
[submodule "vendor/symfony"]
path = vendor/symfony
url = http://github.com/symfony/symfony.git
[submodule "vendor/twig"]
path = vendor/twig
url = http://github.com/fabpot/Twig.git
[submodule "vendor/monolog"]
path = vendor/monolog
url = http://github.com/Seldaek/monolog.git
[submodule "vendor/doctrine-common"]
path = vendor/doctrine-common
url = http://github.com/doctrine/common.git
[submodule "vendor/doctrine-dbal"]
path = vendor/doctrine-dbal
url = http://github.com/doctrine/dbal.git
[submodule "vendor/doctrine"]
path = vendor/doctrine
url = http://github.com/doctrine/doctrine2.git
[submodule "vendor/swiftmailer"]
path = vendor/swiftmailer
url = http://github.com/swiftmailer/swiftmailer.git
[submodule "vendor/assetic"]
path = vendor/assetic
url = http://github.com/kriswallsmith/assetic.git
[submodule "vendor/twig-extensions"]
path = vendor/twig-extensions
url = http://github.com/fabpot/Twig-extensions.git
[submodule "vendor/metadata"]
path = vendor/metadata
url = http://github.com/schmittjoh/metadata.git
[submodule "vendor/bundles/Sensio/Bundle/FrameworkExtraBundle"]
path = vendor/bundles/Sensio/Bundle/FrameworkExtraBundle
url = http://github.com/sensio/SensioFrameworkExtraBundle.git
[submodule "vendor/bundles/JMS/SecurityExtraBundle"]
path = vendor/bundles/JMS/SecurityExtraBundle
url = http://github.com/schmittjoh/JMSSecurityExtraBundle.git
[submodule "vendor/bundles/Sensio/Bundle/DistributionBundle"]
path = vendor/bundles/Sensio/Bundle/DistributionBundle
url = http://github.com/sensio/SensioDistributionBundle.git
[submodule "vendor/bundles/Sensio/Bundle/GeneratorBundle"]
path = vendor/bundles/Sensio/Bundle/GeneratorBundle
url = http://github.com/sensio/SensioGeneratorBundle.git
[submodule "vendor/bundles/Symfony/Bundle/AsseticBundle"]
path = vendor/bundles/Symfony/Bundle/AsseticBundle
url = http://github.com/symfony/AsseticBundle.git

1
vendor/assetic vendored Submodule

Submodule vendor/assetic added at d6f89a3170

1
vendor/doctrine vendored Submodule

Submodule vendor/doctrine added at 91ffd30f52

1
vendor/doctrine-common vendored Submodule

Submodule vendor/doctrine-common added at 80838882ab

1
vendor/doctrine-dbal vendored Submodule

Submodule vendor/doctrine-dbal added at 2cac730bf4

1
vendor/metadata vendored Submodule

Submodule vendor/metadata added at dbfbb15b3f

1
vendor/monolog vendored Submodule

Submodule vendor/monolog added at da33c84d07

1
vendor/swiftmailer vendored Submodule

Submodule vendor/swiftmailer added at d33d54cc8a

1
vendor/symfony vendored Submodule

Submodule vendor/symfony added at 7c91ee5755

1
vendor/twig vendored Submodule

Submodule vendor/twig added at 4c9e394c38

1
vendor/twig-extensions vendored Submodule

Submodule vendor/twig-extensions added at feb6d3f10c

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',
);