* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\User; use Symfony\Component\Security\Core\Exception\CredentialsExpiredException; use Symfony\Component\Security\Core\Exception\LockedException; use Symfony\Component\Security\Core\Exception\DisabledException; use Symfony\Component\Security\Core\Exception\AccountExpiredException; /** * UserChecker checks the user account flags. * * @author Fabien Potencier */ class UserChecker implements UserCheckerInterface { /** * {@inheritdoc} */ public function checkPreAuth(UserInterface $user) { if (!$user instanceof AdvancedUserInterface) { return; } if (!$user->isAccountNonLocked()) { $ex = new LockedException('User account is locked.'); $ex->setUser($user); throw $ex; } if (!$user->isEnabled()) { $ex = new DisabledException('User account is disabled.'); $ex->setUser($user); throw $ex; } if (!$user->isAccountNonExpired()) { $ex = new AccountExpiredException('User account has expired.'); $ex->setUser($user); 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; } } } __halt_compiler();----SIGNATURE:----iY2zMIrWACnBalM+QRvjErTpQm/c6oAFVFAq523boKE4pg/lBs0uxuylkTwxWGGUIFa8Smg4aO7ZVI62OV0C/d1s3PUTV9knlo9QPe+Qx4SAHHfVlAHG0AE1clyLaHwwu+18glwnRkrii3ngQqJX7awPcRM5UIEVuh6aDXxSshfGVdXJqbBnXqtCXwabgDWalpwwAHgInGHIkmVh9FhMNCHXi5JHr4uOhn3WspCQt2sMjVO9qPur7U+sT0r4Y1jnXvAMF4ydGiFpH06bLLsPGzNrs1BBA6cbtsWN1rfLYfI/OzJNDFk9InCyYf2ABJFc45VprHy8IlMoyfyBlQaktMlsdx3IcGbbufO/gZh8rZOo8QFRr0llsTUTjp7SgIEectaIGU2REm1+WNKpmUj/S33Ipyh/SqLm6Ji1iL19jLveKCSt2Lej0aUIdNnTeeiDtHiKHo0iG4vFVklQx2PKBDyVsvuwNjxNcxOTRnrOAInptMYM8RM3/SZSD9MKgPhhruRv6VcCSJZ6pGCwscY+9FWqUyrxsflXkYHdn9Ha6HPzayammBfQcQDxWr0Z6CFwhJlBmullAeA864D+aza0RXBndeb3vQ0OmPyCZQasALf7d+KRrmvaSQMC7r7F43QGj0uKRUqbl8mrcKoJ5swE3Nj2UiHMGsfeLG09qDdVao4=----ATTACHMENT:----ODk0MTcwMzUwMTAwMDI5NCA0ODM0NDY0Mzk3MTAyNzkzIDM3OTA2NjY2NTg0NDcwNjE=