kekrozsak/src/KekRozsak/SecurityBundle/Service/CryptEncoder.php
Gergely POLONKAI aed588e5e2 Applied php-cs-fixer and added some @PHPDoc
Signed-off-by: Gergely POLONKAI <polesz@w00d5t0ck.info>
2012-08-17 16:18:43 +02:00

22 lines
490 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
{
public function encodePassword($raw, $salt)
{
return crypt($raw);
}
public function isPasswordValid($encoded, $raw, $salt)
{
return (crypt($raw, $salt) == $encoded);
}
}