Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Foo\FooBundleBundle\Listener;
- use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
- use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
- use Symfony\Component\Routing\Router;
- use Symfony\Component\HttpFoundation\RedirectResponse;
- use Symfony\Component\Security\Core\SecurityContext;
- /**
- * SecurityListener.
- *
- * @author Dustin Dobervich
- */
- class SecurityListener
- {
- /**
- * @var Router $router
- */
- private $router;
- /**
- * @var SecurityContext $security
- */
- private $security;
- /**
- * Constructs a new instance of SecurityListener.
- *
- * @param Router $router The router
- * @param SecurityContext $security The security context
- */
- public function __construct(Router $router, SecurityContext $security)
- {
- $this->router = $router;
- $this->security = $security;
- }
- /**
- * Invoked after a successful login.
- *
- * @param InteractiveLoginEvent $event The event
- */
- public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
- {
- // do some stuff with $this->router and $this->security
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment