Firstly when I use the accessControl filter in my controller ,captcha in login page is not displaying and here goes my code in controller
public function actions()
{
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xF8F8F8,
'foreColor'=>0x000000,
),
// page action renders "static" pages stored under 'protected/views/site/pages'
// They can be accessed via: index.php?r=site/page&view=FileName
'page'=>array(
'class'=>'CViewAction',
),
);
}
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
// 'postOnly + delete', // we only allow deletion via POST request
);
}
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('actions'),
'users'=>array('*'),
),
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','captcha',),
'users'=>array('*'),
)
)
}
here is my code in view
$this->widget('CCaptcha', array( 'showRefreshButton'=>true,'buttonOptions'=>array('id'=>'refreshCaptcha','title'=>'Get a new code') ));
For me login screen is in view index.php
and the captcha
I have pasted is from the index.php
and still nothing works out well
Where did I make mistake.Please suggest me the right way to sort out this issue of conflicting captcha with accessControl . Thanks in advance