Created
September 11, 2012 19:06
-
-
Save davedevelopment/3701011 to your computer and use it in GitHub Desktop.
Migrating passwords to Symfony's Password encoder
This file contains hidden or 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 | |
| use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder as SyMessageDigestPasswordEncoder; | |
| /** | |
| * Used to allow for use of existing passwords that were just sha1 in the db, | |
| */ | |
| class Sha1MessageDigestPasswordEncoder extends SyMessageDigestPasswordEncoder | |
| { | |
| public function encodePassword($raw, $salt) | |
| { | |
| return parent::encodePassword(sha1($raw), $salt); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment