我在我创建的symfony.com文档后面有一个简单的SecurityBundle:
UserProviderInterface
UserInterface
和EquatableInterface
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
问题是我在登出时无法控制,登录操作因为防火墙捕获这些并且我不知道如何修改
答案 0 :(得分:2)