Fixed bugs came with 2.1 BETA3 upgrade
ForumPostType had a hidden field with a DateTime data, which could not be rendered Security authentication success handler could not run
This commit is contained in:
@@ -6,6 +6,7 @@ use Doctrine\ORM\EntityManager;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Bridge\Doctrine\RegistryInterface;
|
||||
use Symfony\Component\Security\Core\Event\AuthenticationEvent;
|
||||
|
||||
class AuthSuccess implements AuthenticationSuccessHandlerInterface
|
||||
{
|
||||
@@ -16,6 +17,15 @@ class AuthSuccess implements AuthenticationSuccessHandlerInterface
|
||||
$this->doctrine = $doctrine;
|
||||
}
|
||||
|
||||
public function onSecurityAuthenticationSuccess(AuthenticationEvent $event)
|
||||
{
|
||||
$user = $event->getAuthenticationToken()->getUser();
|
||||
$em = $this->doctrine->getEntityManager();
|
||||
$user->setLastLoginAt(new \DateTime('now'));
|
||||
$em->persist($user);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
public function onAuthenticationSuccess(Request $request, TokenInterface $token)
|
||||
{
|
||||
$user = $token->getUser();
|
||||
|
Reference in New Issue
Block a user