tags:

views:

184

answers:

1

I'm having a hard time understanding how the CakePHP admin system works.

  • Should all controllers who has an action which requires login include AuthComponent or just the one who handles the login/logout?
  • Let's say I want to protect the add action of a controller. First I create admin_add() in the controller and then in the beforeFilter() method I check if $this->Session->check('Auth.User') is set a redirect based on this? Turns out it was better to just controll this with $this->Auth->allow()
  • What is the easiest way to return to the URL the user was trying to access? Is there a better way than setting a session variable? Turns out it does this automagically :)

If someone has a good tutorial for this I would happily read it :) I've already read this tutorial but I found it to be a little to basic and the CakePHP-docs are not that great on this topic either.

+1  A: 

There is no Cake admin system as such. There is Authentication component and there is Access Control List component. You can use only Authentication component if you wish or you can use both of them. If you want to create your admin system from scratch follow this tutorial. Or you can try already created admin panel - PoundCake Control Panel.

bancer