"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php" between
symfony-4.4.14.tar.gz and symfony-4.4.15.tar.gz

About: Symfony is a web application framework for PHP projects. Source code (4.4 series).

DoctrineTokenProvider.php  (symfony-4.4.14):DoctrineTokenProvider.php  (symfony-4.4.15)
skipping to change at line 15 skipping to change at line 15
* *
* (c) Fabien Potencier <fabien@symfony.com> * (c) Fabien Potencier <fabien@symfony.com>
* *
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Symfony\Bridge\Doctrine\Security\RememberMe; namespace Symfony\Bridge\Doctrine\Security\RememberMe;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\Result; use Doctrine\DBAL\Driver\Result as DriverResult;
use Doctrine\DBAL\Result;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types; use Doctrine\DBAL\Types\Types;
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken; use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken;
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInt erface; use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentTokenInt erface;
use Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInter face; use Symfony\Component\Security\Core\Authentication\RememberMe\TokenProviderInter face;
use Symfony\Component\Security\Core\Exception\TokenNotFoundException; use Symfony\Component\Security\Core\Exception\TokenNotFoundException;
/** /**
* This class provides storage for the tokens that is set in "remember me" * This class provides storage for the tokens that is set in "remember me"
* cookies. This way no password secrets will be stored in the cookies on * cookies. This way no password secrets will be stored in the cookies on
skipping to change at line 67 skipping to change at line 68
* {@inheritdoc} * {@inheritdoc}
*/ */
public function loadTokenBySeries($series) public function loadTokenBySeries($series)
{ {
// the alias for lastUsed works around case insensitivity in PostgreSQL // the alias for lastUsed works around case insensitivity in PostgreSQL
$sql = 'SELECT class, username, value, lastUsed AS last_used' $sql = 'SELECT class, username, value, lastUsed AS last_used'
.' FROM rememberme_token WHERE series=:series'; .' FROM rememberme_token WHERE series=:series';
$paramValues = ['series' => $series]; $paramValues = ['series' => $series];
$paramTypes = ['series' => \PDO::PARAM_STR]; $paramTypes = ['series' => \PDO::PARAM_STR];
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes); $stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
$row = $stmt instanceof Result ? $stmt->fetchAssociative() : $stmt->fetc h(\PDO::FETCH_ASSOC); $row = $stmt instanceof Result || $stmt instanceof DriverResult ? $stmt- >fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC);
if ($row) { if ($row) {
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used'])); return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));
} }
throw new TokenNotFoundException('No token found.'); throw new TokenNotFoundException('No token found.');
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
 End of changes. 2 change blocks. 
2 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)