Gergely POLONKAI 1d0a513ea2 Now injecting services with JMSDiExtraBundle
Signed-off-by: Gergely POLONKAI <polesz@w00d5t0ck.info>
2012-08-16 19:06:00 +02:00

22 lines
476 B
PHP

<?php
namespace KekRozsak\SecurityBundle\Service;
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
use JMS\DiExtraBundle\Annotation as DI;
/**
* @DI\Service("kek_rozsak_security.encoder.crypt")
*/
class CryptEncoder implements PasswordEncoderInterface
{
function encodePassword($raw, $salt)
{
return crypt($raw);
}
function isPasswordValid($encoded, $raw, $salt)
{
return (crypt($raw, $salt) == $encoded);
}
}