0
我在网站上完成了用户系统。 在我UsersController.php我有这样的方法:登录前检查字段
public function login()
{
if($this->request->is('post')) {
if($this->Auth->login()) {
$this->Session->setFlash('Connexion établie', 'flash_success');
$this->redirect($this->Auth->redirectUrl());
} else {
$this->Session->setFlash("Nom d'user ou mot de passe invalide, réessayer", 'flash_error');
$this->redirect(array('controller' => 'indexes', 'action' => 'index'));
}
}
}
它工作得很好,但我需要改变它。在我的数据库中,我有一个字段“验证”,它是一个布尔值。 在登录时,如果字段为true,我想记录用户,但如果字段为false,我不想记录他。
感谢您的帮助
的可能重复的[cakephp的认证基本只有合法的用户(http://stackoverflow.com/questions/21932483/cakephp-authenticate-basic-only-valid-users) – ndm