ok so now i modified as follows but still this is not working, i
checked using debug and url is indeed shown as admin however user is
still allowed access to this page
function beforeFilter()
{
$this->checkSession();
//debug($this->params['url']);
if (!empty($this->params[CAKE_ADMIN]) || $this->params['url'] ==
"admin") {
//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']);
//debug($result);
if ($result['User']['user_level'] <> 'admin') {
$this->Session->setFlash('Access Denied.');
$this->redirect('/');
//$this->layout = "default";
}
// set our layout based on admin routing vars
$this->layout = "admin";
}
}
any other ideas?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---