have a look at these. check the role in the isAuthorized function

http://book.cakephp.org/view/396/authorize

I would not have a separate table for admins (maybe others might disagree
with me here; it may be suited to your intentions to do so) I would prevent
them based on their role

more info
http://www.littlehart.net/atthekeyboard/2007/07/28/two-headed-application-authentication-in-cakephp-12/
http://www.studiocanaria.com/articles/cakephp_auth_component_users_groups_permissions_1

- S

2008/8/23 mario <[EMAIL PROTECTED]>

>
> Hello everyone,
>
> I just learn cakephp and I'm having trouble creating the admin section
> of my app.
>
> These are what I've done so far.
>
> 1. I've created a user section with the capabilities of login/logout
> and signup.
> 2. I've created a "users" table for it.
> 3. I've overriden the app_controller and define the Auth component.
> I've also
>   created its' own beforeFilter() function.
>
>    Here is a snippet of my app_controller.php code:
>
> <?php
> class AppController extends Controller {
>        var $components = array('Auth');
>        function beforeFilter()
>        {
>                $this->Auth->loginRedirect = array('controller' =>
> 'mainpage',
> 'action' => 'home');
>                $this->Auth->logoutRedirect = array('controller' =>
> 'mainpage',
> 'action' => 'home');
>                $this->Auth->allow('signup','home');
>                $this->Auth->authorize = 'controller';
>                $this->set('loggedIn', $this->Auth->user('id'));
>           }
>           function isAuthorized()
>           {
>                 return true;
>           }
> }
> ?>
>
> Now, i've decided to create an admin section that could
> edit,view,delete users.
> I've created a separate table for the admin, namely, "admins" table.
> I've also
> created its' own model,view, and controller.
>
> Now I'm stuck in implementing the admins' login/logout feature because
> my main problem
> is that the app_controller that I made is already "specific" to my
> user's controller.
>
> Please advise me on what to do.
>
>
>
> Thanks,
>
> Mario
>
> >
>

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