Hi guys,

I just wanted to tell you what I did to get this working, and wanted to know how you felt about my solution:

I created the plugin as Padraic suggested. Which monitors the REQUEST_URI.

If $path[1] == 'admin' I do the following:

Set the controller directory to '/controllers/admin/';

I also check if the user is authorised in this plugin, if he isn't then I create a new token action and dispatch it to the /admin/auth/ controller.

Otherwise I create a route:

$router->addRoute('admin', '/admin/:controller/:action', array('controller' = 'index', 'action' => 'index'));

The only problem that I'm having is making the dispatcher stop looping after it has redirected to the /admin/auth controller, it seems to call up indexController::indexAction() as well.

My temporary solution was to place an exit; after the dispatch. I'm sure there must be a method that tells the dispatcher to shutdown after it's been dispatched, or perhaps I'm misunderstanding the process.

Kind regards,
Peter Pistorius







Reply via email to