if (!empty($this->params[CAKE_ADMIN]) || $this->params['url'] == "admin")
That should do it, the admin route that you created bypasses the CAKE_ADMIN
feature so you have to explicitly test for it.
Geoff
On 8/23/07, rtanz <[EMAIL PROTECTED]> wrote:
>
>
> this is how im doing my check
>
> if (!empty($this->params[CAKE_ADMIN])){
> $user = $this->Session->read('User');
> $result = $this->User->findByUsername($user['username']);
> //print_r($result['User']['user_level']);
> //$user = $this->Entry->User->read(null,
> $user['id']);
> if ($result['User']['user_level'] <> 'admin') {
> $this->Session->setFlash('Access
> Denied.');
> $this->redirect('/');
> }
> // set our layout based on admin routing vars
> $this->layout = "admin";
>
> as you said im using params, how can i modify to also trap the manual
> route?
>
> thnx
>
>
> >
>
--
http://lemoncake.wordpress.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---