in your app_controller::beforeFilter(){
$this->Auth->loginRedirect=array
('controller'=>'users','action'=>'home');
}
in users_controller::home(){
$userinfo=$this->Auth->user(); // assuming the group is in there
switch($userinf['User']['Group']){
case 'admin': $url=array('controller'=>'users',
'admin'=>true);
break;
case 'user': $url=array('controller'=>'users');
break;
default: $url='/users';
}
$this->redirect($url);
}
How something like that?
-teh
On May 26, 9:15 am, draikin <[email protected]> wrote:
> Hi,
>
> for my cakePHP application I use the acl to handle authentication and
> authorisation. For this purpose I have 3 groups who have different
> rights for the application.
> Now I want to redirect the user after successful login, dependent on
> his group, to different actions in my application.
> And I don't know how to do this. I try to do it in the app_controller
> and the users_controller with no success. I try to get the group and
> then redirect to the specific action. But this doesn't work.
> What is the right or the cake way to do this simple thing? I think I
> miss something, but I don't find anything on this issue. Any help or
> hint would be appreciated. A code example would be very nice.
>
> Thank you for your help, and sorry for my bad English
> draikin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---