2013-04-06 93 views
0

我有一个onKernelResponse侦听器。 在我的代码中,我想知道用户是否请求防火墙URL。 我想设置我的变量$ isRequestToAProtectedUrl如何知道一个请求是否被保护的url

... 
if($isAjaxRequest && !$isAuthenticated && $isRequestToAProtectedUrl){ 
    $this->container->get("session")->invalidate(); 
    header('NOT_AUTHORIZED: 499'); //modifiy header(must be catch in client) 
    exit(); 
} 
... 

在此先感谢

回答