Skip to content

Instantly share code, notes, and snippets.

@davedevelopment
Created September 11, 2012 19:06
Show Gist options
  • Select an option

  • Save davedevelopment/3701011 to your computer and use it in GitHub Desktop.

Select an option

Save davedevelopment/3701011 to your computer and use it in GitHub Desktop.
Migrating passwords to Symfony's Password encoder
<?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