Added login and posting functionality
Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
23
src/GergelyPolonkai/FrontBundle/Service/CryptEncoder.php
Normal file
23
src/GergelyPolonkai/FrontBundle/Service/CryptEncoder.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace GergelyPolonkai\FrontBundle\Service;
|
||||
|
||||
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
|
||||
use JMS\DiExtraBundle\Annotation as DI;
|
||||
|
||||
/**
|
||||
* Description of CryptEncoder
|
||||
*
|
||||
* @author polonkai.gergely
|
||||
*
|
||||
* @DI\Service("gergely_polonkai_front.service.crypt_encoder")
|
||||
*/
|
||||
class CryptEncoder implements PasswordEncoderInterface
|
||||
{
|
||||
public function encodePassword($raw, $salt) {
|
||||
return crypt($raw);
|
||||
}
|
||||
|
||||
public function isPasswordValid($encoded, $raw, $salt) {
|
||||
return (crypt($raw, $encoded) === $encoded);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user