用yiic webapp生成的第一个应用,用户登录是怎么验证admin/admin & demo/demo的?怎么在代码中都没有找到相关的验证?
用yiic webapp生成的第一个应用,用户登录是怎么验证admin/admin & demo/demo的?怎么在代码中都没有找到相关的验证?
在controller里面的accessRules
如:
public function accessRules()
{
return array(
// array('allow', // allow all users to perform 'index' and 'view' actions
// 'actions'=>array('index','view'),
// 'users'=>array('*'),
// ),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('detail','editdetail','changepwd'),
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete','index','create','update','changeuserpwd','view'),
'users'=>array('admin'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
详细的说明 可以参看 http://www.yiiframework.net/index.php/chapter/tree?id=1&title=blog开发向导(1.1.1)-添加和更新文章&articleid=23 中的操作权限说明
thank for your answer!!
我觉得我回答错了 那里是权限的控制,用户验证是在UserIdentity里面的 参看这里把 呵呵 http://yiiframework.net/index.php/chapter/tree?id=1&title=blog开发向导(1.1.1)-用户认证&articleid=20