There shouldn't be any need to pass anything because you can get the
id from the session. Just make sure that this action is not available
without logging in (don't include it in $this->Auth->allow(...)).

public function view_summary()
{
        $user_id = $this->Auth->user('id');
        ...
}

On Wed, Sep 23, 2009 at 5:45 AM, Brian Lee <[email protected]> wrote:
>
> Upon login, users should redirect to /users/view_summary/<user_id>.
>
> I'm getting the user_id from the Session component. I tried just
> concatenate or pass extra variable to $this->Auth->loginRedirect, but
> all my ideas have failed. Is this something we can do in cakephp?
>
> This is my AppController::beforeFilter():
>
>    function beforeFilter() {
>        $this->Auth->allow('display');
>
>        //$this->Auth->authorize = 'actions';
>        $this->Auth->actionPath = 'controllers/';
>
>        $this->Auth->loginAction = array('controller' => 'users',
> 'action' => 'login');
>        $this->Auth->logoutRedirect = array('controller' => 'users',
> 'action' => 'login');
>
>        $user = $this->Session->read('Auth.User');
>        $this->Auth->loginRedirect = array('controller' => 'users',
> 'action' => 'view_summary', $user['id']);
>    }
>
> This is my User::beforeFilter():
>
>        function beforeFilter() {
>                parent::beforeFilter();
>        }
>
> I tried following ways:
>
>        $this->Auth->loginRedirect = array('controller' => 'users',
> 'action' => 'view_summary', $user['id']);
>        $this->Auth->loginRedirect = array('controller' => 'users',
> 'action' => 'view_summary/' . $user['id']);
>
> All of them just redirect users to /users/view_summary without any
> params.
> Someone please help me.
>
> Thanks,
> Brian
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to