Hi,  I've actuall just sussed this out so i'm going to post the
solution here incase anyone else searches on this problem:

I put this in my app_controller inside function beforeFilter:

//this first line tests to see if the user is in the admin group - in
this case with the ID of 1
 if ($this->Auth->user('group_id') == 1) {
    //user is admin:
    $this->Auth->loginRedirect = array('controller' => 'admin/
MYCONTOLLERNAME');
                }else{
                //user is user:
                $this->Auth->loginRedirect = array('controller' =>
'MYCONTROLLERNAME');
    }

Which handily redirects admin users to admin screens and normal users
to normal view screens,  for example the difference between admin rout
index and a standard index view:

function admin_index() {}
function index() {}

these simple things can take hours to suss out when they shouldnt :)
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to