diff options
author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2015-06-18 15:03:50 +0200 |
---|---|---|
committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2015-06-18 15:03:50 +0200 |
commit | 75f6af14e12329fa92918ca9811dcf9d4016dba9 (patch) | |
tree | a06aae1e5362f8bae4d0d7fb952e2e30fe6f304c /Http/Firewall | |
parent | 6c71220d9a0f048d6cd091ea3c8aabfb12f62ff7 (diff) | |
parent | 8c1c6eff4059a084f7f60a13da604af074badd79 (diff) | |
download | symfony-security-75f6af14e12329fa92918ca9811dcf9d4016dba9.zip symfony-security-75f6af14e12329fa92918ca9811dcf9d4016dba9.tar.gz symfony-security-75f6af14e12329fa92918ca9811dcf9d4016dba9.tar.bz2 |
Merge branch '2.6' into 2.7
* 2.6:
Add test for HHVM FatalErrors
[2.6][Debug] Fix fatal-errors handling on HHVM
[2.3][Debug] Fix fatal-errors handling on HHVM
Standardize the name of the exception variables
[2.3] Static Code Analysis for Components
Remove duplicated paths
Conflicts:
src/Symfony/Component/Debug/ErrorHandler.php
src/Symfony/Component/Security/Http/Firewall/BasicAuthenticationListener.php
src/Symfony/Component/Security/Http/Firewall/ContextListener.php
src/Symfony/Component/Security/Http/Firewall/RememberMeListener.php
src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php
Diffstat (limited to 'Http/Firewall')
-rw-r--r-- | Http/Firewall/AbstractPreAuthenticatedListener.php | 8 | ||||
-rw-r--r-- | Http/Firewall/BasicAuthenticationListener.php | 6 | ||||
-rw-r--r-- | Http/Firewall/ContextListener.php | 6 | ||||
-rw-r--r-- | Http/Firewall/DigestAuthenticationListener.php | 2 | ||||
-rw-r--r-- | Http/Firewall/RememberMeListener.php | 4 |
5 files changed, 13 insertions, 13 deletions
diff --git a/Http/Firewall/AbstractPreAuthenticatedListener.php b/Http/Firewall/AbstractPreAuthenticatedListener.php index 5ed8aa7..b793310 100644 --- a/Http/Firewall/AbstractPreAuthenticatedListener.php +++ b/Http/Firewall/AbstractPreAuthenticatedListener.php @@ -58,8 +58,8 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface try { list($user, $credentials) = $this->getPreAuthenticatedData($request); - } catch (BadCredentialsException $exception) { - $this->clearToken($exception); + } catch (BadCredentialsException $e) { + $this->clearToken($e); return; } @@ -90,8 +90,8 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface $loginEvent = new InteractiveLoginEvent($request, $token); $this->dispatcher->dispatch(SecurityEvents::INTERACTIVE_LOGIN, $loginEvent); } - } catch (AuthenticationException $failed) { - $this->clearToken($failed); + } catch (AuthenticationException $e) { + $this->clearToken($e); } } diff --git a/Http/Firewall/BasicAuthenticationListener.php b/Http/Firewall/BasicAuthenticationListener.php index 11ae8f9..ebe96ea 100644 --- a/Http/Firewall/BasicAuthenticationListener.php +++ b/Http/Firewall/BasicAuthenticationListener.php @@ -73,21 +73,21 @@ class BasicAuthenticationListener implements ListenerInterface try { $token = $this->authenticationManager->authenticate(new UsernamePasswordToken($username, $request->headers->get('PHP_AUTH_PW'), $this->providerKey)); $this->tokenStorage->setToken($token); - } catch (AuthenticationException $failed) { + } catch (AuthenticationException $e) { $token = $this->tokenStorage->getToken(); if ($token instanceof UsernamePasswordToken && $this->providerKey === $token->getProviderKey()) { $this->tokenStorage->setToken(null); } if (null !== $this->logger) { - $this->logger->info('Basic authentication failed for user.', array('username' => $username, 'exception' => $failed)); + $this->logger->info('Basic authentication failed for user.', array('username' => $username, 'exception' => $e)); } if ($this->ignoreFailure) { return; } - $event->setResponse($this->authenticationEntryPoint->start($request, $failed)); + $event->setResponse($this->authenticationEntryPoint->start($request, $e)); } } } diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php index e1ec46d..9ac37cd 100644 --- a/Http/Firewall/ContextListener.php +++ b/Http/Firewall/ContextListener.php @@ -160,11 +160,11 @@ class ContextListener implements ListenerInterface } return $token; - } catch (UnsupportedUserException $unsupported) { + } catch (UnsupportedUserException $e) { // let's try the next user provider - } catch (UsernameNotFoundException $notFound) { + } catch (UsernameNotFoundException $e) { if (null !== $this->logger) { - $this->logger->warning('Username could not be found in the selected user provider.', array('username' => $notFound->getUsername(), 'provider' => get_class($provider))); + $this->logger->warning('Username could not be found in the selected user provider.', array('username' => $e->getUsername(), 'provider' => get_class($provider))); } return; diff --git a/Http/Firewall/DigestAuthenticationListener.php b/Http/Firewall/DigestAuthenticationListener.php index c5aaca3..9a6fbfe 100644 --- a/Http/Firewall/DigestAuthenticationListener.php +++ b/Http/Firewall/DigestAuthenticationListener.php @@ -93,7 +93,7 @@ class DigestAuthenticationListener implements ListenerInterface } $serverDigestMd5 = $digestAuth->calculateServerDigest($user->getPassword(), $request->getMethod()); - } catch (UsernameNotFoundException $notFound) { + } catch (UsernameNotFoundException $e) { $this->fail($event, $request, new BadCredentialsException(sprintf('Username %s not found.', $digestAuth->getUsername()))); return; diff --git a/Http/Firewall/RememberMeListener.php b/Http/Firewall/RememberMeListener.php index e34627c..7234c1d 100644 --- a/Http/Firewall/RememberMeListener.php +++ b/Http/Firewall/RememberMeListener.php @@ -83,12 +83,12 @@ class RememberMeListener implements ListenerInterface if (null !== $this->logger) { $this->logger->debug('Populated the token storage with a remember-me token.'); } - } catch (AuthenticationException $failed) { + } catch (AuthenticationException $e) { if (null !== $this->logger) { $this->logger->warning( 'The token storage was not populated with remember-me token as the' .' AuthenticationManager rejected the AuthenticationToken returned' - .' by the RememberMeServices.', array('exception' => $failed) + .' by the RememberMeServices.', array('exception' => $e) ); } |