From 39466a8dbd6ff0698464ce0694bee495efcdd30e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 19 Aug 2013 10:34:03 +0200 Subject: [PATCH] moved ip whitelist to options --- index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index f849fac..169221b 100644 --- a/index.php +++ b/index.php @@ -3,6 +3,8 @@ $options = array( // which string should represent a tab for indentation 'tabsize' => 4, + // whitelist of IPs which don't need to be authenticated + 'ip_whitelist' => array('127.0.0.1', '::1'), ); /** @@ -18,7 +20,7 @@ $options = array( * * Source on Github http://github.com/Seldaek/php-console */ -if (!in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'), true)) { +if (!in_array($_SERVER['REMOTE_ADDR'], $options['ip_whitelist'], true)) { header('HTTP/1.1 401 Access unauthorized'); die('ERR/401 Go Away'); }