Michael Sheakoski wrote:
Of course this is only one way to do it. I could do the checking in index.php, or in a FrontController plugin too, etc... My main thing is to try and minimize the amount of code repeated. In my current method I would have to duplicate the same code in the preRun() method of every ActionController.

My application has only a very few ( 5, I think ) actions that someone
who is not logged in can access so I did it as a FrontController plugin.
 In the preDispatch method I have a list of the 5 places anonymous
people can go.

1) Is this action object ( controller/action pair ) trying to get to one
of the 5?  If so, return it and on they go.
2) Ok, didn't return there so lets check if they are logged in.
3) If so, return the action object so they can go on their way.
4) If not, return new Zend_Controller_Dispatcher_Token to send them to
the must be logged in error page and beyond for login.

Michael
[ sorry for the dupe, Mods.. forgot to change my From: address ]

Reply via email to