Created
April 5, 2013 14:22
-
-
Save GromNaN/5319639 to your computer and use it in GitHub Desktop.
Implements symfony1 password encoding for Symfony2 security component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Security\Encoder; | |
use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder; | |
/** | |
* Implements symfony1 password encoding | |
* | |
* @see PluginsfGuardUser::checkPasswordByGuard() | |
* | |
* @author Jérôme TAMARELLE <jerome@tamarelle.net> | |
*/ | |
class Symfony1GuardPasswordEncoder extends MessageDigestPasswordEncoder | |
{ | |
public function __construct() | |
{ | |
parent::__construct('sha1', false, 1); | |
} | |
/** | |
* {@inheritDoc} | |
*/ | |
protected function mergePasswordAndSalt($password, $salt) | |
{ | |
return $salt . $password; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment