UserCheckerInterface.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Security\Core\User;
  11. use Symfony\Component\Security\Core\Exception\AccountStatusException;
  12. /**
  13. * Implement to throw AccountStatusException during the authentication process.
  14. *
  15. * Can be used when you want to check the account status, e.g when the account is
  16. * disabled or blocked. This should not be used to make authentication decisions.
  17. *
  18. * @author Fabien Potencier <fabien@symfony.com>
  19. */
  20. interface UserCheckerInterface
  21. {
  22. /**
  23. * Checks the user account before authentication.
  24. *
  25. * @throws AccountStatusException
  26. */
  27. public function checkPreAuth(UserInterface $user);
  28. /**
  29. * Checks the user account after authentication.
  30. *
  31. * @throws AccountStatusException
  32. */
  33. public function checkPostAuth(UserInterface $user);
  34. }