CakePHP登录系统
|
我正在编辑某人使用CakePHP创建的网站,但是我以前没有任何使用Cake的经验。我正在阅读手册,但是很难理解,所以我想在这里发布一个问题,看看是否能快速得到答案。
我认为此代码用于显示登录框,并且只能使用用户名test和密码123123登录
var $components = array(\"Auth\", \"Acl\");
function beforeFilter(){
$this->Security->loginOptions = array(
\'type\' => \'basic\',
\'realm\' => \'Authenticate Emergency Response Center\'
);
$this->Security->loginCredentials = array(
\'test\' => \'123123\'
);
$this->Security->requireLogin();
$this->_bindToSite();
parent::beforeFilter();
}
我希望登录框仍然显示,但是我想用数据库中的信息自动填充loginCredentials数组。我有一个名为\'operators \'的表,其中包含字段'user_id \'和\'password \'。
有人可以告诉我如何更改上面的代码以允许操作员表中存储的任何用户名/密码登录吗?
谢谢你的帮助
没有找到相关结果
已邀请:
2 个回复
谦响局豢报
撵穆
中进行设置即可。最好的位置可能是
目录中的
。