From f0e351b90165ae0eba03aec0c3de934d8377f737 Mon Sep 17 00:00:00 2001 From: duplabe Date: Wed, 18 Aug 2010 06:03:53 +0800 Subject: [PATCH] Added allowedIPs option. Default value: array('127.0.0.1') --- XWebDebugRouter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/XWebDebugRouter.php b/XWebDebugRouter.php index 34f686b..a8f037b 100644 --- a/XWebDebugRouter.php +++ b/XWebDebugRouter.php @@ -438,6 +438,7 @@ public static function getInfo($data, $config = null) class XWebDebugRouter extends CLogRoute { public $config = ''; + public $allowedIPs = array('127.0.0.1'); public function collectLogs($logger, $processLogs = false) { @@ -450,6 +451,9 @@ public function processLogs($logs) { $app=Yii::app(); $config = array(); + + if( !in_array($app->request->getUserHostAddress(), $this->allowedIPs) ) return; + foreach (explode(',', $this->config) as $value) { $value = trim($value);