I migrate an old system of Users with symfony 2.4, i want to plenty use the FOSUserBundle and the encodePassword function to use some properties of a user (for example, its id) but i don't find a way to insert $myUserObject into this MyPasswordEncoder class.
namespace Tykayn\MeluzineBundle\Services;
class MyPasswordEncoder extends \Symfony\Component\Security\Core\Encoder\BasePasswordEncoder
{
public function encodePassword($raw, $salt, **$myUserObject** )
{
return sha1('blahblah' . $raw . 'blehbleh'. $salt. $myUserObject->id ) ;
}
public function isPasswordValid($encoded, $raw, $salt)
{
return $this->comparePasswords($encoded, $this->encodePassword($raw, $salt));
}
}