Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ticket 10242 rememberme checkpreauth #11057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG-2.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ in 2.4 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.4.0...v2.4.1

* 2.4.6 (2014-05-31)

* bug #11014 [Validator] Remove property and method targets from the optional and required constraints (jakzal)
* bug #10983 [DomCrawler] Fixed charset detection in html5 meta charset tag (77web)
* Merge branch '2.3' into 2.4
* bug #10979 Make rootPath part of regex greedy (artursvonda)
* bug #10995 [TwigBridge][Trans]set %count% only on transChoice from the current context. (aitboudad)
* bug #10987 [DomCrawler] Fixed a forgotten case of complex XPath queries (stof)

* 2.4.5 (2014-05-22)

* bug #10849 [WIP][Finder] Fix wrong implementation on sortable callback comparator (ProPheT777)
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/HttpKernel/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ abstract class Kernel implements KernelInterface, TerminableInterface
protected $startTime;
protected $loadClassCache;

const VERSION = '2.4.6-DEV';
const VERSION_ID = '20406';
const VERSION = '2.4.7-DEV';
const VERSION_ID = '20407';
const MAJOR_VERSION = '2';
const MINOR_VERSION = '4';
const RELEASE_VERSION = '6';
const RELEASE_VERSION = '7';
const EXTRA_VERSION = 'DEV';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function authenticate(TokenInterface $token)
}

$user = $token->getUser();
$this->userChecker->checkPreAuth($user);
$this->userChecker->checkPostAuth($user);

$authenticatedToken = new RememberMeToken($user, $this->providerKey, $this->key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Component\Security\Core\Tests\Authentication\Provider;

use Symfony\Component\Security\Core\Authentication\Provider\RememberMeAuthenticationProvider;
use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken;
use Symfony\Component\Security\Core\Exception\DisabledException;
use Symfony\Component\Security\Core\Role\Role;

class RememberMeAuthenticationProviderTest extends \PHPUnit_Framework_TestCase
Expand Down Expand Up @@ -44,6 +44,22 @@ public function testAuthenticateWhenKeysDoNotMatch()
$provider->authenticate($token);
}

/**
* @expectedException \Symfony\Component\Security\Core\Exception\DisabledException
*/
public function testAuthenticateWhenPreChecksFails()
{
$userChecker = $this->getMock('Symfony\Component\Security\Core\User\UserCheckerInterface');
$userChecker->expects($this->once())
->method('checkPreAuth')
->will($this->throwException(new DisabledException()))
;

$provider = $this->getProvider($userChecker);

$provider->authenticate($this->getSupportedToken());
}

/**
* @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException
*/
Expand Down