2013-12-12 11:34:10 3148次浏览 0条回答 0 悬赏 20 金钱

在我的站点里, 只有当我注释掉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.',
        ),
    );
}


    没有找到数据。
您需要登录后才可以回答。登录 | 立即注册
iLeoDo
实习生

iLeoDo

注册时间:2013-12-12
最后登录:2013-12-22
在线时长:0小时10分
  • 粉丝0
  • 金钱0
  • 威望0
  • 积分0

热门问题