【发布时间】:2011-11-22 21:50:47
【问题描述】:
我正在将 CakePHP 1.3 应用升级到 2.0.3。
以前,我可以使用 Auth 组件来登录用户,并使用 Security 组件来模拟 Basic HTTP 身份验证。 (好像我设置了一个 .htaccess 文件来密码保护页面)
我曾经这样做过:
$this->Security->loginOptions = array('type'=>'basic','realm'=>'training');
$this->Security->loginUsers = array("student"=>"student2010");
$this->Security->requireLogin();
现在看来,即使我使用:
public $components = array(
'Auth' => array(
'authenticate' => array('Basic')
)
);
它仍然想使用我的用户模型和数据库。我错过了什么吗?
【问题讨论】:
标签: .htaccess cakephp authentication