2008年7月31日星期四

[fw-auth] Error throwing in Custom_Controller_Plugin_Acl::preDispatch

Hello,

I'm centralizing all the error logging in the ErrorController and everything gets interted in the DB. Also the ErrorController will display an error message depending on the type of exception (DB Error, Unauthorized access, etc).
The user credentials are all checked in my Custom_Controller_Plugin_Acl::
preDispatch call, if the user doesn't the required credentials I throw an Exception of type Zend_Acl_Exception so it get loggued and later on all unauthorized access can be reviewed.

The problem is when the exception is thrown, the ErrorController get called and display the error but the flow continue and the called controller (Ex: adminController) is getting called anyway...

Should I log the exception in the preDispatch call and simply change the controller name and action name? Or is there a way to stop the script from executing?

Thanks

Ben

没有评论: