Source of file PlaintextPasswordEncoder.php
Size: 1,271 Bytes - Last Modified: 2013-07-17T08:22:21+02:00
/home/theseer/Downloads/Symfony/vendor/symfony/symfony/src/Symfony/Component/Security/Core/Encoder/PlaintextPasswordEncoder.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 | <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\Encoder; /** * PlaintextPasswordEncoder does not do any encoding. * * @author Fabien Potencier <fabien@symfony.com> */ class PlaintextPasswordEncoder extends BasePasswordEncoder { private $ignorePasswordCase; /** * Constructor. * * @param Boolean $ignorePasswordCase Compare password case-insensitive */ public function __construct($ignorePasswordCase = false) { $this->ignorePasswordCase = $ignorePasswordCase; } /** * {@inheritdoc} */ public function encodePassword($raw, $salt) { return $this->mergePasswordAndSalt($raw, $salt); } /** * {@inheritdoc} */ public function isPasswordValid($encoded, $raw, $salt) { $pass2 = $this->mergePasswordAndSalt($raw, $salt); if (!$this->ignorePasswordCase) { return $this->comparePasswords($encoded, $pass2); } return $this->comparePasswords(strtolower($encoded), strtolower($pass2)); } } |