Answer the question
In order to leave comments, you need to log in
Yii. IP filter. How to disable authorization?
It is necessary to allow access to certain pages only from certain IPs. Wrote this code:
public function filters()
{
return array('accessControl'); // perform access control for CRUD operations
}
public function accessRules()
{
return array(
array('allow',
'actions'=>array('manage'),
'users'=>array('?'),
'ips'=>array('139.45.125.33'),
),
array('deny',
'actions'=>array('manage'),
'users'=>array('*'),
'ips'=>array('*'),
),
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question