On Tue, May 26, 2009 at 3:57 PM, draikin <[email protected]> wrote:
>
> This doesn't work for me. I added the redirekt in app_controller and
> create a new function home() in users_controller:
>
>        function home()
>        {
>                $userinfo = $this->Auth->user(); // assuming the group is in 
> there
>                switch($userinfo['User']['group_id'])
>                {
>                        case '1': $this->redirect(array (
>                                                'controller' => 'members', 
> 'action' => 'index'), null, true);
>                                break;
>
>                case '4': $this->redirect(array (
>                                                'controller' => 'members', 
> 'action' => 'otherList'), null,
> true);
>                                break;
>
>                default: $this->redirect(array (
>                                                'controller' => 'members', 
> 'action' => 'index'), null, true);
>        }
>        }
>
> If I first login as member of group '4', all the redirection is
> correct. After logout and login as member of group '1' I get the same
> redirection as before. Not the  expected redirection to /members/
> index.
>
> Whats going wrong here?

Not sure. But you're still adding an extra redirect if you do it from home().

I'm also not sure what happened to my other post. This is what I'm using:

AppController::beforeFilter()

$this->Auth->loginRedirect = array('controller' => 'pages', 'action'
=> 'display', 'home');

UsersController::login()

if ($this->Auth->user('group_id') > 3)
{
        ...
        $this->redirect($this->Auth->loginRedirect);
}
...
$this->redirect(
        array(
                'controller' => 'sections',
                'action' => 'index',
                'admin' => 1
        )
);

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