Using Yii 1.1.15. I want to restrict the login and logout actions by ip rule. I have this inside the controller:
public function accessRules()
{
return [
[
'allow',
'actions' => ['index', 'error'],
'users' => ['*'],
],
[
'allow',
'actions' => ['login'],
'users' => ['*'],
'ips' => ['xx.yy.zz.qq'],
],
[
'allow',
'actions' => ['logout'],
'users' => ['@'],
'ips' => ['xx.yy.zz.qq'],
],
[
'deny', // deny all users
'users' => ['*'],
],
];
}
But when I call the login action in the browser, the browser enters a redirect loop. If I comment out the ips rule, it works. What is wrong with the above code?