Re: Different layouts for different groups of users

2007-11-14 Thread francky06l

Maybe the best will to to hold the role (admin / user) in the Session
at login time.
The in your beforeRender() (app_controller.php or your controller),
you can check the role and set $this->layout to the desired layout.

Now to find the parent_id of an Aro, you need to read the Aro I
suppose.

$aro = $this->Acl->Aro->node(array('model' => 'User', foreign_key =>
'user_id'));

the parent_id is in $aro[0]['Aro']['parent_id'] but I think ( to
confirm) that you should get the parent Aro in $aro[1] ...

I think holding the role in Session is an easier solution.

hope this helps.

On Nov 14, 4:01 pm, plinto <[EMAIL PROTECTED]> wrote:
> Hi, I am not very good at this Acl, aro and aco stuff and am having a
> hard time getting it to work right.
> One of my problems is to set a different layout for the differnt types
> of users.
> My aro table has 2 parents, "Administrators" and "Users", and all the
> users, my question is: how can set one layout for the users and one
> for the administrators?
> I have no idea how to find the parent of user,( if the user logging in
> is a user or administrator).
>
> Thanks in advance, hope someone can help me


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---



Different layouts for different groups of users

2007-11-14 Thread plinto

Hi, I am not very good at this Acl, aro and aco stuff and am having a
hard time getting it to work right.
One of my problems is to set a different layout for the differnt types
of users.
My aro table has 2 parents, "Administrators" and "Users", and all the
users, my question is: how can set one layout for the users and one
for the administrators?
I have no idea how to find the parent of user,( if the user logging in
is a user or administrator).

Thanks in advance, hope someone can help me


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~--~~~~--~~--~--~---