diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2013-12-30 22:49:15 +0100 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2013-12-31 11:55:25 +0100 |
commit | f3427fa7d44637866e038bf49ae336509e99800b (patch) | |
tree | 9c05b8561074da10ab033cc31e7b63652fea6f65 /Core/User | |
parent | 47a99c77ac4ea45ab1e20b3d95450cd39204e123 (diff) | |
download | symfony-security-f3427fa7d44637866e038bf49ae336509e99800b.zip symfony-security-f3427fa7d44637866e038bf49ae336509e99800b.tar.gz symfony-security-f3427fa7d44637866e038bf49ae336509e99800b.tar.bz2 |
[Security] fixed pre/post authentication checks
Diffstat (limited to 'Core/User')
-rw-r--r-- | Core/User/UserChecker.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Core/User/UserChecker.php b/Core/User/UserChecker.php index 8dde3a6..ac577a3 100644 --- a/Core/User/UserChecker.php +++ b/Core/User/UserChecker.php @@ -32,22 +32,6 @@ class UserChecker implements UserCheckerInterface return; } - if (!$user->isCredentialsNonExpired()) { - $ex = new CredentialsExpiredException('User credentials have expired.'); - $ex->setUser($user); - throw $ex; - } - } - - /** - * {@inheritdoc} - */ - public function checkPostAuth(UserInterface $user) - { - if (!$user instanceof AdvancedUserInterface) { - return; - } - if (!$user->isAccountNonLocked()) { $ex = new LockedException('User account is locked.'); $ex->setUser($user); @@ -66,4 +50,20 @@ class UserChecker implements UserCheckerInterface throw $ex; } } + + /** + * {@inheritdoc} + */ + public function checkPostAuth(UserInterface $user) + { + if (!$user instanceof AdvancedUserInterface) { + return; + } + + if (!$user->isCredentialsNonExpired()) { + $ex = new CredentialsExpiredException('User credentials have expired.'); + $ex->setUser($user); + throw $ex; + } + } } |