diff options
-rw-r--r-- | Http/Firewall/AbstractAuthenticationListener.php | 6 | ||||
-rw-r--r-- | Http/Firewall/AbstractPreAuthenticatedListener.php | 6 | ||||
-rw-r--r-- | Http/Firewall/AccessListener.php | 1 | ||||
-rw-r--r-- | Http/Firewall/AnonymousAuthenticationListener.php | 1 | ||||
-rw-r--r-- | Http/Firewall/BasicAuthenticationListener.php | 1 | ||||
-rw-r--r-- | Http/Firewall/ChannelListener.php | 1 | ||||
-rw-r--r-- | Http/Firewall/ContextListener.php | 4 | ||||
-rw-r--r-- | Http/Firewall/DigestAuthenticationListener.php | 1 | ||||
-rw-r--r-- | Http/Firewall/ExceptionListener.php | 4 | ||||
-rw-r--r-- | Http/Firewall/LogoutListener.php | 1 | ||||
-rw-r--r-- | Http/Firewall/RememberMeListener.php | 6 | ||||
-rw-r--r-- | Http/Firewall/SwitchUserListener.php | 6 | ||||
-rw-r--r-- | Http/SecurityEvents.php (renamed from Http/Events.php) | 6 |
13 files changed, 19 insertions, 25 deletions
diff --git a/Http/Firewall/AbstractAuthenticationListener.php b/Http/Firewall/AbstractAuthenticationListener.php index 6a1adfa..f2be84e 100644 --- a/Http/Firewall/AbstractAuthenticationListener.php +++ b/Http/Firewall/AbstractAuthenticationListener.php @@ -21,7 +21,7 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\SessionUnavailableException; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Events as KernelEvents; +use Symfony\Component\HttpKernel\CoreEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -29,7 +29,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; -use Symfony\Component\Security\Http\Events; +use Symfony\Component\Security\Http\SecurityEvents; /** * The AbstractAuthenticationListener is the preferred base class for all @@ -230,7 +230,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface if (null !== $this->dispatcher) { $loginEvent = new InteractiveLoginEvent($request, $token); - $this->dispatcher->dispatch(Events::onSecurityInteractiveLogin, $loginEvent); + $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent); } if (null !== $this->successHandler) { diff --git a/Http/Firewall/AbstractPreAuthenticatedListener.php b/Http/Firewall/AbstractPreAuthenticatedListener.php index 88faa27..93c161a 100644 --- a/Http/Firewall/AbstractPreAuthenticatedListener.php +++ b/Http/Firewall/AbstractPreAuthenticatedListener.php @@ -16,9 +16,9 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterfac use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; -use Symfony\Component\Security\Http\Events; +use Symfony\Component\Security\Http\SecurityEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Events as KernelEvents; +use Symfony\Component\HttpKernel\CoreEvents; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -82,7 +82,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface if (null !== $this->dispatcher) { $loginEvent = new InteractiveLoginEvent($request, $token); - $this->dispatcher->dispatch(Events::onSecurityInteractiveLogin, $loginEvent); + $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent); } } catch (AuthenticationException $failed) { $this->securityContext->setToken(null); diff --git a/Http/Firewall/AccessListener.php b/Http/Firewall/AccessListener.php index bbcd932..0cb45ac 100644 --- a/Http/Firewall/AccessListener.php +++ b/Http/Firewall/AccessListener.php @@ -17,7 +17,6 @@ use Symfony\Component\Security\Http\AccessMap; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Events; use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; use Symfony\Component\Security\Core\Exception\AccessDeniedException; diff --git a/Http/Firewall/AnonymousAuthenticationListener.php b/Http/Firewall/AnonymousAuthenticationListener.php index 36cf878..a6f8742 100644 --- a/Http/Firewall/AnonymousAuthenticationListener.php +++ b/Http/Firewall/AnonymousAuthenticationListener.php @@ -14,7 +14,6 @@ namespace Symfony\Component\Security\Http\Firewall; use Symfony\Component\Security\Core\SecurityContextInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Events; use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken; /** diff --git a/Http/Firewall/BasicAuthenticationListener.php b/Http/Firewall/BasicAuthenticationListener.php index d35d8d5..72df041 100644 --- a/Http/Firewall/BasicAuthenticationListener.php +++ b/Http/Firewall/BasicAuthenticationListener.php @@ -16,7 +16,6 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterfac use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Events; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Exception\AuthenticationException; diff --git a/Http/Firewall/ChannelListener.php b/Http/Firewall/ChannelListener.php index 1677a02..73bb076 100644 --- a/Http/Firewall/ChannelListener.php +++ b/Http/Firewall/ChannelListener.php @@ -15,7 +15,6 @@ use Symfony\Component\Security\Http\AccessMap; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Events; /** * ChannelListener switches the HTTP protocol based on the access control diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php index b018487..dccbd5c 100644 --- a/Http/Firewall/ContextListener.php +++ b/Http/Firewall/ContextListener.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\Events; +use Symfony\Component\HttpKernel\CoreEvents; use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; @@ -50,7 +50,7 @@ class ContextListener implements ListenerInterface $this->logger = $logger; if (null !== $dispatcher) { - $dispatcher->addListener(Events::onCoreResponse, $this); + $dispatcher->addListener(CoreEvents::RESPONSE, array($this, 'onCoreResponse')); } } diff --git a/Http/Firewall/DigestAuthenticationListener.php b/Http/Firewall/DigestAuthenticationListener.php index 867899e..f2e1f9e 100644 --- a/Http/Firewall/DigestAuthenticationListener.php +++ b/Http/Firewall/DigestAuthenticationListener.php @@ -16,7 +16,6 @@ use Symfony\Component\Security\Core\User\UserProviderInterface; use Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Events; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Exception\BadCredentialsException; use Symfony\Component\Security\Core\Exception\AuthenticationServiceException; diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php index 4840a63..b4d2b6f 100644 --- a/Http/Firewall/ExceptionListener.php +++ b/Http/Firewall/ExceptionListener.php @@ -23,7 +23,7 @@ use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken; use Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Events; +use Symfony\Component\HttpKernel\CoreEvents; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -59,7 +59,7 @@ class ExceptionListener */ public function register(EventDispatcherInterface $dispatcher) { - $dispatcher->addListener(Events::onCoreException, $this); + $dispatcher->addListener(CoreEvents::EXCEPTION, array($this, 'onCoreException')); } /** diff --git a/Http/Firewall/LogoutListener.php b/Http/Firewall/LogoutListener.php index 8ff9c8b..0155371 100644 --- a/Http/Firewall/LogoutListener.php +++ b/Http/Firewall/LogoutListener.php @@ -18,7 +18,6 @@ use Symfony\Component\Security\Core\SecurityContextInterface; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\Events; /** * LogoutListener logout users. diff --git a/Http/Firewall/RememberMeListener.php b/Http/Firewall/RememberMeListener.php index 10ed8c6..09f974e 100644 --- a/Http/Firewall/RememberMeListener.php +++ b/Http/Firewall/RememberMeListener.php @@ -6,7 +6,7 @@ use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\Events as KernelEvents; +use Symfony\Component\HttpKernel\CoreEvents; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; @@ -15,7 +15,7 @@ use Symfony\Component\Security\Core\Exception\CookieTheftException; use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; -use Symfony\Component\Security\Http\Events; +use Symfony\Component\Security\Http\SecurityEvents; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /* @@ -80,7 +80,7 @@ class RememberMeListener implements ListenerInterface if (null !== $this->dispatcher) { $loginEvent = new InteractiveLoginEvent($request, $token); - $this->dispatcher->dispatch(Events::onSecurityInteractiveLogin, $loginEvent); + $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent); } if (null !== $this->logger) { diff --git a/Http/Firewall/SwitchUserListener.php b/Http/Firewall/SwitchUserListener.php index 0977cb1..c3c46e5 100644 --- a/Http/Firewall/SwitchUserListener.php +++ b/Http/Firewall/SwitchUserListener.php @@ -27,7 +27,7 @@ use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Http\Event\SwitchUserEvent; -use Symfony\Component\Security\Http\Events; +use Symfony\Component\Security\Http\SecurityEvents; use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** @@ -133,7 +133,7 @@ class SwitchUserListener implements ListenerInterface if (null !== $this->dispatcher) { $switchEvent = new SwitchUserEvent($request, $token->getUser()); - $this->dispatcher->dispatch(Events::onSecuritySwitchUser, $switchEvent); + $this->dispatcher->dispatch(SecurityEvents::SWITCH_USER, $switchEvent); } return $token; @@ -154,7 +154,7 @@ class SwitchUserListener implements ListenerInterface if (null !== $this->dispatcher) { $switchEvent = new SwitchUserEvent($request, $original->getUser()); - $this->dispatcher->dispatch(Events::onSecuritySwitchUser, $switchEvent); + $this->dispatcher->dispatch(SecurityEvents::SWITCH_USER, $switchEvent); } return $original; diff --git a/Http/Events.php b/Http/SecurityEvents.php index c0aa65d..9c335a1 100644 --- a/Http/Events.php +++ b/Http/SecurityEvents.php @@ -11,9 +11,9 @@ namespace Symfony\Component\Security\Http; -final class Events +final class SecurityEvents { - const onSecurityInteractiveLogin = 'onSecurityInteractiveLogin'; + const INTERACTIVE_LOGIN = 'security.interactive_login'; - const onSecuritySwitchUser = 'onSecuritySwitchUser'; + const SWITCH_USER = 'security.switch_user'; }
\ No newline at end of file |