アクティブ化されたユーザーがログインできるシステムでログインを作成しましたが、アカウントがアクティブ化されていないユーザーはログインできません。問題は、ユーザーが非アクティブ化されたアカウントでログインしようとすると、フラッシュ メッセージが出力されないことです。であるため、ログイン ページでページが更新され続ける理由がユーザーにわかりません。
ここに私のログイン機能があります
if ($this->request->is('post')){
if ($this->request->data['User']['password'] == 'qazwsx'){
if ($this->Auth->login()){
$username = $this->request->data['User']['username'];
if (0 === $this->User->find('count',array('conditions'=>array('activated'=>1,'username'=> $username)))) {
$this->Session->setFlash('Sorry, your account is not validated yet.');
$this->redirect($this->referer());
}
$this->Auth->user('id');
$this->redirect($this->Auth->redirect('eboxs/home'));
}
}
else {
$this->Session->setFlash('Username or password is incorrect');
}
}else{
$this->Session->setFlash('Welcome, please login');
}
}
これまでのところ、呼び出しを行う必要がなかったフラッシュ メッセージにビューの原因を含めていません。