2008年8月8日星期五

Re: [fw-mvc] Prevent action from being executed

Is there a way to know which route the router matched to the requested path? For example something like this could be very useful:

<?php

class IndexController extends Zend_Controller_Action
{
    public function preDispatch()
    {
        $routeName = $this->_request->getRouteName();
        $actionName = $this->_request->getActionName();
        if ($actionName == 'menu' && $routename == 'default') {
            // handle appropriately
        }
   
}
}


-Hector


Giorgio Sironi wrote:
2008/8/8 Greg Freeman <greg@imagize.com.au>:   
How do you prevent an action from being called directly? I have an action that is used to render a menu response segment for the layout. I don't want people to be able to call it directly via a URL.     
 Where is the problem, if you don't publish a link, people cannot guess the action name.. And even if they guess they only see a broken page, no security exploits.    

没有评论: