Re: Auth 1.3.0 Auth->loginAction

2010-06-30 Thread cricket
On Wed, Jun 30, 2010 at 6:27 AM, brianclark...@btconnect.com
 wrote:
> Hi
>
> I have configured the Auth component and its working fine. I need to
> save a User associated model in the session.
> I assume the best way to do this is to catch the successful login and
> then add the associated model to the session.
> I have set Auth->loginAction = users/login. Auth->login is called in
> the Auth->startup method and never calls users/login.

AppController::beforeFilter()

$this->Auth->loginAction = array(
'controller' => 'users',
'action' => 'login'
);
$this->Auth->loginRedirect = array(
// somewhere you want users to go after login
);

/* tell Cake that you want to do something in login() before redirecting
 */
$this->Auth->autoRedirect = false;


UsersController:
public function login()
{
if (!empty($this->data) && $user = $this->Auth->user())
{
/* do what you need to do ...
 */

$this->redirect($this->Auth->redirect());
}
}

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Auth 1.3.0 Auth->loginAction

2010-06-30 Thread Shaz
Are you following:

http://book.cakephp.org/view/172/Authentication

?

On Jun 30, 11:27 am, "brianclark...@btconnect.com"
 wrote:
> Hi
>
> I have configured the Auth component and its working fine. I need to
> save a User associated model in the session.
> I assume the best way to do this is to catch the successful login and
> then add the associated model to the session.
> I have set Auth->loginAction = users/login. Auth->login is called in
> the Auth->startup method and never calls users/login.
>
> Am I missing something. Any help would be appreciated.
>
> Brian..

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Auth 1.3.0 Auth->loginAction

2010-06-30 Thread brianclark...@btconnect.com
Hi

I have configured the Auth component and its working fine. I need to
save a User associated model in the session.
I assume the best way to do this is to catch the successful login and
then add the associated model to the session.
I have set Auth->loginAction = users/login. Auth->login is called in
the Auth->startup method and never calls users/login.

Am I missing something. Any help would be appreciated.

Brian..

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en