i guess, problem might be here :
in app_controller you define login redirect (according to standart use of
Auth from tutorial)
$this->Auth->loginRedirect = array('controller' => 'projects', 'action' =>
'index');
you should take care of login redirect here (maybe edit it or bypass)
2011/1/7 eldorado2768 <[email protected]>
> I am trying to redirect to different locations depending on which
> group a user belongs to after logging in. The problem I am having is
> that it keeps going to the redirect for group 1 even when it should be
> going to the redirect for group 2:
>
> function login()
> {
> $this->layout = 'login';
> if ($this->Auth->user())
> {
> $groupmember = $this->Session->read('Auth.User.group_id');
> if($groupmember==1)
> $this->Auth->loginRedirect = array('controller' => 'users', 'action'
> => 'index');
> else
> $this->Auth->loginRedirect = array('controller' => 'tenants', 'action'
> => 'tenantview');
> }
>
> }
>
> I have confirmed that the group_id is being picked up by the session
> variable by displaying it on the redirected view so I know at least
> the variable is not empty.
>
> Anyone have a clue what I am doing wrong here?
>
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
> more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
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 [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