CakePHP -自定义登录检查


CakePHP - Custom login check

我使用CakePHP的默认$this->Auth->login()脚本登录用户。这工作得很好,我只是想扩展操作,以便它检查在DB中,如果用户的字段为is_active设置为1。如果是0,我想把它踢到一个错误页面,不让他们登录。

实现这一点的最佳方法是什么?

我正在运行CakePHP v. 2.2.0

有个东西叫作用域:http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html configuring-authentication-handlers

甚至在文档中也有同样的例子