Monday, January 5, 2009

Auth Login Component not working :(

Hi I am trying to return a rendered element so I have to customize the
login() function on the controller I am using, however its not running
the query right even though the fields it is supposed to process are
defined in the model.

Here is the beforeRender code:
PHP Code:


function beforeFilter() {

$this->Auth->loginAction = array(

'controller' => 'users',

'action' => 'login_form'

);

$this->Auth->allow(array(

'login_form',

'login',

'logout'

));

$this->Auth->redirectLogin = array(

'controller' => 'users',

'action' => 'index'

);

}

Here is my login function:
PHP Code:


function login() {

$this->layout = null;

if ($this->Auth->login($this->data['User'])) {

$this->render('login_success', 'ajax');

} else {

$this->render('login_failure', 'ajax');

}

}

The data in the form is named as
data['User']['username'] and data['User']['password']

Does anyone know why the login function won't correctly process this?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: