验证码不显示,疑似与accessControl冲突 [ 未指定版本 ]
在我的站点里, 只有当我注释掉filters() 方法后,验证码才会显示, PHP GD支持也都打开了。
而且如果我直接请求user/captcha , 只会显示一个空边框,没有内容(类似于图裂了)
另外我使用了自定义的WebUser。会有关系么?因为我再config里取消WebUser,就正确了。
下面是一些 UserController 里的代码:
public function actions()
{
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
'minLength' => 4,
'maxLength' => 4,
'testLimit' => 99999
)
);
}public function filters()
{
// return the filter configuration for this controller, e.g.:
return array(
"accessControl",
);
}public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('captcha'),
'users'=>array('*'),
),
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','login','signup'),
'expression'=>'Yii::app()->user->isGuest',
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('cpassword','info','logout'),
'expression'=>'!Yii::app()->user->isGuest',
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'users'=>array('admin@example.com'),
),
array('deny', // deny all users
'users'=>array('*'),
'message'=>'Access Denied.',
),
);
}共 0 个回答
没有找到数据。
iLeoDo
注册时间:2013-12-12
最后登录:2013-12-22
在线时长:0小时10分
最后登录:2013-12-22
在线时长:0小时10分
- 粉丝0
- 金钱0
- 威望0
- 积分0