Guest User

Untitled

a guest
May 19th, 2011
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.19 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Foo\FooBundleBundle\Listener;
  4.  
  5. use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
  6. use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
  7. use Symfony\Component\Routing\Router;
  8. use Symfony\Component\HttpFoundation\RedirectResponse;
  9. use Symfony\Component\Security\Core\SecurityContext;
  10.  
  11. /**
  12.  * SecurityListener.
  13.  *
  14.  * @author Dustin Dobervich
  15.  */
  16. class SecurityListener
  17. {  
  18.     /**
  19.      * @var Router $router
  20.      */
  21.     private $router;
  22.    
  23.     /**
  24.      * @var SecurityContext $security
  25.      */
  26.     private $security;
  27.    
  28.     /**
  29.      * Constructs a new instance of SecurityListener.
  30.      *
  31.      * @param Router $router The router
  32.      * @param SecurityContext $security The security context
  33.      */
  34.     public function __construct(Router $router, SecurityContext $security)
  35.     {
  36.         $this->router = $router;
  37.         $this->security = $security;
  38.     }
  39.    
  40.     /**
  41.      * Invoked after a successful login.
  42.      *
  43.      * @param InteractiveLoginEvent $event The event
  44.      */
  45.     public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
  46.     {
  47.         // do some stuff with $this->router and $this->security
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment