I want to add my Yii Project IP filtering capabilities.. Below code add this capabilities to me actually (it helps).. But I want to add this capabilities in the run time, after the my program (yii project) is running, user may add another IP addresses into allow ip list (whitelist), and deny some others to block list (like blacklist).. Could you help me about how chould I add these functionalities into my project..
Thanks from now,
#in the SiteController
public function accessRules() {
return array(
array('allow',
'actions' => array('index','view', 'create', 'update', 'manage'),
'ips' => Yii::app()->params['allowIps'],//updated to pull list from Yii
),
array('deny',
'actions' => array('index','view', 'create', 'update', 'manage'),
'ips' => array('*'),
),
);
}
in /protected/config/main.php
'params'=>array(
// this is used in contact page
'allowedIps'=>array('22.150.133.177'),
),