The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

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
master
Polonkai Gergely 11 years ago
parent 8d4c9bc5bc
commit aa453242df
  1. 4
      src/KekRozsak/FrontBundle/Form/Type/ForumPostType.php
  2. 3
      src/KekRozsak/SecurityBundle/Resources/config/services.xml
  3. 10
      src/KekRozsak/SecurityBundle/Security/AuthSuccess.php

@ -17,10 +17,6 @@ class ForumPostType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('createdAt', 'hidden', array(
'label' => 'Időpont',
'data' => new \DateTime('now')
));
$builder->add('text', null, array(
'label' => ' ',
));

@ -4,8 +4,9 @@
<services>
<service id="kek_rozsak_security.encoder.crypt" class="KekRozsak\SecurityBundle\Service\CryptEncoder">
</service>
<service id="security.authentication.success_handler" class="KekRozsak\SecurityBundle\Security\AuthSuccess">
<service id="kek_rozsak_security.auth.success" class="KekRozsak\SecurityBundle\Security\AuthSuccess">
<argument type="service" id="doctrine" />
<tag name="kernel.event_listener" event="security.authentication.success" />
</service>
</services>
</container>

@ -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();

Loading…
Cancel
Save