hi Cake Community,

CakePHP 2.0.2
OS: Windows7
Configure::write('debug', 2);


Problem:
My Auth Component is not working and i dont know why. Need Help.



User Controller:

<?php

class UsersController extends AppController {
    
    public $components = array('Auth','Security');
        
    public function login() {
            if ($this->request->is('post')) {

                /* $this->Auth->User('usr') or $this->Auth->User('pwd') 
....also tried. Returns nothing. Dontknow why!?!?! */


                if ($this->Auth->Login()) {
                    $this->redirect(array('controller' => 
'PricerobotStoreEngines', 'action' => 'index'));
                } else {
                    $this->Session->setFlash(__('Username or password is 
incorrect'));
                    $this->redirect(array('controller' => 'users', 'action' => 
'login'));
                }
            }
            
    }
    public function logout() {
            $this->redirect($this->Auth->logout());
    }
    

    /*
     * tried,too ! Returns nothing. 
     *  

    public function beforeFilter(){
             //$this->Auth->User('usr') or $this->Auth->User('pwd') ....also 
tried. Returns nothing. Dontknow why!?!?! 

    }
     *
     *
     */  

}
?>

PricerobotStoreEnginesController Controller:

<?php

class PricerobotStoreEnginesController extends AppController {
    
        public $components = array(
            'Auth'=> array(
                'loginAction' => array(
                    'controller' => 'users',
                    'action' => 'login',
                )
            )
        );

       etc............ 

}
?>

Login View:

<?php
    echo $this->Form->create('');
    echo $this->Form->input('usr');   
    echo $this->Form->password('pwd');
    echo $this->Form->end('Login');
?>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to