瀏覽代碼

[Security] fixed event names

Fabien Potencier 14 年之前
父節點
當前提交
d7220f0c1a

+ 1 - 1
src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php

@@ -221,7 +221,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
 
         if (null !== $this->dispatcher) {
             $loginEvent = new InteractiveLoginEvent($request, $token);
-            $this->dispatcher->dispatch(SecurityEvents::interactiveLogin, $loginEvent);
+            $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent);
         }
 
         if (null !== $this->successHandler) {

+ 1 - 1
src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php

@@ -82,7 +82,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface
 
             if (null !== $this->dispatcher) {
                 $loginEvent = new InteractiveLoginEvent($request, $token);
-                $this->dispatcher->dispatch(SecurityEvents::interactiveLogin, $loginEvent);
+                $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent);
             }
         } catch (AuthenticationException $failed) {
             $this->securityContext->setToken(null);

+ 1 - 1
src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php

@@ -80,7 +80,7 @@ class RememberMeListener implements ListenerInterface
 
             if (null !== $this->dispatcher) {
                 $loginEvent = new InteractiveLoginEvent($request, $token);
-                $this->dispatcher->dispatch(SecurityEvents::interactiveLogin, $loginEvent);
+                $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent);
             }
 
             if (null !== $this->logger) {

+ 2 - 2
src/Symfony/Component/Security/Http/Firewall/SwitchUserListener.php

@@ -133,7 +133,7 @@ class SwitchUserListener implements ListenerInterface
 
         if (null !== $this->dispatcher) {
             $switchEvent = new SwitchUserEvent($request, $token->getUser());
-            $this->dispatcher->dispatch(SecurityEvents::switchUser, $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(SecurityEvents::switchUser, $switchEvent);
+            $this->dispatcher->dispatch(SecurityEvents::SWITCH_USER, $switchEvent);
         }
 
         return $original;

+ 2 - 2
src/Symfony/Component/Security/Http/SecurityEvents.php

@@ -13,7 +13,7 @@ namespace Symfony\Component\Security\Http;
 
 final class SecurityEvents
 {
-    const interactiveLogin = 'security.interactive_login';
+    const INTERACTIVE_LOGIN = 'security.interactive_login';
 
-    const switchUser = 'security.switch_user';
+    const SWITCH_USER = 'security.switch_user';
 }