基本的なログイン ページの作成 - 機能していましたが、データベースを変更したため、リダイレクトが機能しなくなりました。
ログインしようとすると、サイトがデータベースに対してチェックしているSQLコードをチェックした後、ユーザー名/パスワードが間違っていると言ってサイトが戻ってきます-正しい情報を送信していますが、ログインを許可していません.
ユーザーがサイトにログインしたときに、ebox (コントローラー) のホーム (ビュー) にリダイレクトされるようにします。
これは、ログインするためのコントローラーのコードです
    public function login(){
    $this->set('title_for_layout', 'Individual Registration');
    $this->set('stylesheet_used', 'style');
    $this->set('image_used', 'eBOXLogo.jpg');
    if ($this->request->is('post')){
        if ($this->Auth->login()){
            $username = $this->request->data['User']['username'];
            if (0 === $this->User->find('count',array('conditions'=>array('activated'=>true,'username'=> $username)))){
                $this->Session->setFlash('Sorry, your account is not validated yet.');
                $this->redirect($this->referer());
                } 
            else{
                $this->Auth->user('id');
                $this->redirect( array('controller' => 'Eboxs','action' => 'home'));
                }
        }  
        else{
            $this->Session->setFlash('Username or password is incorrect');
        }
    }else{
        $this->Session->setFlash('Welcome, please login');
    }
}
ここにビューのコードがあります
<?php    
         echo $this->Form->create('User', array('action' => 'login'));
         echo $this->Form->input('username');
         echo $this->Form->input('password');
         echo $this->Form->end('Login');
     ?>