* * 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:----Zlel7K6gqqa/Htr+WAxrm0bwFkwocK3Z5deTGkcwrwgzsUmnEEfVDfX52BulNy+WpsunxN4YFnJrO+kWjtd4FJy0WhbSO6X/HN5oOcaF1uYCmtcOhw7poahfNd6WaEq4SjkWK+QXWYv81NROwPNQJGVEb6ZO3bYLWcqmtZJNMYP91lDaQg+r06H/jeNn2glUORqk48TJRSy/3b4k3YZRzxDtq2cPbqYZjrwJoYhIeC7GN8sm3YYCC3eMBOLsjxpCuCALw4yCtUf0G1L6Q5mXwQXKpifECWIMOTx692unBCLcWX+2M8kBLMHCmboeFpxGk0tVpbJFfm0GuJuMEQlnbLnia/J2ypBDfue4VZjNHtK8NRa+RuzaB2JMqjmLBXC30T9aEAB9dYmXcXLad+UKmb/03RQUj2oAnUuaD7MXomhBaoH73ur5u3H+WVTUjS4FUynD5dEjuPQzImKuKtAUwn0Mv8zgtBjgxOT7QwE4unMFbA8C3tNG7j9oOn2CfGqBKjPTIpqwR3yK/GfjyypH01rpGFKaxb4nv6bsJoj41UisUGhI4xekZ7A0pBGJLRnb2H9x20Tt26vFSV8yU3dSyycQzxfOZmdLRwGCAb0InxUCbdvyHqNQtV1EHncV2p4lrHEMVEe0mgTuSln5fMtci/ypshGdsjwRLYBCwnTRvi4=----ATTACHMENT:----MzU0MDg3NzIwMTkyNjY3NyA4MDUyNzIzMzc1MjMyNjE0IDc4NTkwMDI5MDAyMDY5MDg=