What are you talking about here? "By default you would not go through the 
login
action before Auth will do, so your code is useless"

Did you read the recipe? If so, you'll learn that the intention is to handle 
the login *AFTER*
the Auth component processed and found no valid credentials, thus DEFAULTING 
to your
controller action.

Try this yourself:

class UsersController extends AppController {
    public $components = array('Auth');
    public function login() {
        if (
            !empty($this->data) && 
            !empty($this->Auth->data['User']['username']) && 
            !empty($this->Auth->data['User']['password'])
        ) {
            echo 'I should test this stuff before posting ;)';
            $this->_stop();
        }
    }
}

And then try logging in specifying user and password, but using a wrong 
username and/or wrong password.


On Wednesday, April 13, 2011 10:17:15 PM UTC-3, francky06l wrote:
>
> It mainly depend of the Auth setting. By default you would not go 
> trough the login action before Auth will do, so your code is useless 
> since Auth will handle the login before your login code (when $this- 
> >data is not empty). 
>

-- 
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