diff options
author | Johannes Schmitt <schmittjoh@gmail.com> | 2011-03-07 18:17:46 +0100 |
---|---|---|
committer | Johannes M. Schmitt <schmittjoh@gmail.com> | 2011-03-10 10:25:32 +0100 |
commit | f0335ae722034233c2f49179bc6a9bf8ada62633 (patch) | |
tree | 677ee84bc31216f3a7998e62fdc7838a2076fe4c /Core/Authentication/Provider/RememberMeAuthenticationProvider.php | |
parent | c224430de65547bc9a25293b6a8caf2b9029f05c (diff) | |
download | symfony-security-f0335ae722034233c2f49179bc6a9bf8ada62633.zip symfony-security-f0335ae722034233c2f49179bc6a9bf8ada62633.tar.gz symfony-security-f0335ae722034233c2f49179bc6a9bf8ada62633.tar.bz2 |
[Security] various changes, see below
- visibility changes from protected to private
- AccountInterface -> UserInterface
- SecurityContext::vote() -> SecurityContext::isGranted()
Diffstat (limited to 'Core/Authentication/Provider/RememberMeAuthenticationProvider.php')
-rw-r--r-- | Core/Authentication/Provider/RememberMeAuthenticationProvider.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Core/Authentication/Provider/RememberMeAuthenticationProvider.php b/Core/Authentication/Provider/RememberMeAuthenticationProvider.php index 95ee588..940288b 100644 --- a/Core/Authentication/Provider/RememberMeAuthenticationProvider.php +++ b/Core/Authentication/Provider/RememberMeAuthenticationProvider.php @@ -1,21 +1,21 @@ <?php namespace Symfony\Component\Security\Core\Authentication\Provider; -use Symfony\Component\Security\Core\User\AccountCheckerInterface; -use Symfony\Component\Security\Core\User\AccountInterface; +use Symfony\Component\Security\Core\User\UserCheckerInterface; +use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken; use Symfony\Component\Security\Core\Exception\BadCredentialsException; class RememberMeAuthenticationProvider implements AuthenticationProviderInterface { - protected $accountChecker; - protected $key; - protected $providerKey; + private $userChecker; + private $key; + private $providerKey; - public function __construct(AccountCheckerInterface $accountChecker, $key, $providerKey) + public function __construct(UserCheckerInterface $userChecker, $key, $providerKey) { - $this->accountChecker = $accountChecker; + $this->userChecker = $userChecker; $this->key = $key; $this->providerKey = $providerKey; } @@ -31,11 +31,12 @@ class RememberMeAuthenticationProvider implements AuthenticationProviderInterfac } $user = $token->getUser(); - $this->accountChecker->checkPreAuth($user); - $this->accountChecker->checkPostAuth($user); - $token->setAuthenticated(true); + $this->userChecker->checkPostAuth($user); - return $token; + $authenticatedToken = new RememberMeToken($user, $this->providerKey, $this->key); + $authenticatedToken->setAttributes($token->getAttributes()); + + return $authenticatedToken; } public function supports(TokenInterface $token) |