在我创建的symfony.com文档之后,我有一个简单的 SecurityBundle :
- UserRepository 实现
UserProviderInterface
- UserEntity 实现
UserInterface
和EquatableInterface
- SecurityController 有一个
loginAction
- 使用登录、登录检查、注销路由设置路由
- 设置我的防火墙设置
public function loginAction()
{
$request = $this->getRequest();
$session = $request->getSession();
if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
$error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
} else {
$error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
$session->remove(SecurityContext::AUTHENTICATION_ERROR);
}
return $this->render('MySecurityBundle:Security:login.html.twig', array(
'last_username' => $session->get(SecurityContext::LAST_USERNAME),
'error' => $error,
));
}
一切正常,但我需要为用户的每个操作添加一个记录器,例如:USER:username, DO:erase file XXXXX, AT:2013-08-08.15-03-43
问题是我无法控制注销、登录操作,因为防火墙捕获了这些,我不知道如何修改