2012-07-02 20:41:06 +00:00
|
|
|
<?php
|
|
|
|
namespace KekRozsak\SecurityBundle\Service;
|
|
|
|
|
|
|
|
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
|
|
|
|
|
|
|
|
class CryptEncoder implements PasswordEncoderInterface
|
|
|
|
{
|
2012-08-16 13:52:41 +00:00
|
|
|
function encodePassword($raw, $salt)
|
|
|
|
{
|
|
|
|
return crypt($raw);
|
|
|
|
}
|
2012-07-02 20:41:06 +00:00
|
|
|
|
2012-08-16 13:52:41 +00:00
|
|
|
function isPasswordValid($encoded, $raw, $salt)
|
|
|
|
{
|
|
|
|
return (crypt($raw, $salt) == $encoded);
|
|
|
|
}
|
2012-07-02 20:41:06 +00:00
|
|
|
}
|
|
|
|
|