Skip to content

Instantly share code, notes, and snippets.

@GromNaN
Created April 5, 2013 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GromNaN/5319639 to your computer and use it in GitHub Desktop.
Save GromNaN/5319639 to your computer and use it in GitHub Desktop.
Implements symfony1 password encoding for Symfony2 security component
<?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