I am trying to set up additional admin routes.
 
I want to add 'manage' to selected controllers.
 
So in core.php 
Configure::write('Routing.manage', 'manage');
 
in app_controller beforeFilter
 
$manage = Configure::read('Routing.manage');
          if (isset($this->params[$manage]) && $this->params[$manage]) {
              $this->__checkUserSession();
              $this->layout = 'default';
          }
 
 
 
function __checkUserSession()
      {
          if ($this->Auth->user('role') == 'buyer') {
              $this->Session->destroy();
              $this->redirect('/users/login');
              exit();
          }
      }
 
I have manage_functionName in my controllers where needed.
 
But the only way it seems to connect to these new manage functions is to
make a custom route for each and ever action. Which seems like alot
considering my admin_functions did not need any.
 
Router::connect('/manage/', array('controller' => 'users', 'action' =>
'index', 'prefix'=>'manage'));
Router::connect('/manage/personal',array('controller' => 'users', 'action'
=> 'personal', 'prefix'=>'manage'),array('user_slug' =>
'[-_A-Za-z0-9]+','pass' => array('user_slug')));
 
Am I missing something here?
 
How come I can't connect to my manage functions just as easy as i do with my
admin?
 
Dave 

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

Reply via email to