Admin section in CakePHP
Posted
by Nicklas Ansman
on Stack Overflow
See other posts from Stack Overflow
or by Nicklas Ansman
Published on 2010-06-07T17:04:20Z
Indexed on
2010/06/08
11:02 UTC
Read the original article
Hit count: 323
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 createTurns out it was better to just controll this withadmin_add()
in the controller and then in thebeforeFilter()
method I check if$this->Session->check('Auth.User')
is set a redirect based on this?$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.
© Stack Overflow or respective owner