From 1210dae10589515d6f3824c75639342c5e1d52dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 2 Oct 2015 14:51:41 +0200 Subject: remove old implementation for login/register/recover --- .../Validator/WallabagUserPasswordValidator.php | 51 ---------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/Wallabag/CoreBundle/Security/Validator/WallabagUserPasswordValidator.php (limited to 'src/Wallabag/CoreBundle/Security/Validator') diff --git a/src/Wallabag/CoreBundle/Security/Validator/WallabagUserPasswordValidator.php b/src/Wallabag/CoreBundle/Security/Validator/WallabagUserPasswordValidator.php deleted file mode 100644 index 52062773..00000000 --- a/src/Wallabag/CoreBundle/Security/Validator/WallabagUserPasswordValidator.php +++ /dev/null @@ -1,51 +0,0 @@ -tokenStorage = $tokenStorage; - $this->encoderFactory = $encoderFactory; - } - - /** - * {@inheritdoc} - */ - public function validate($password, Constraint $constraint) - { - if (!$constraint instanceof UserPassword) { - throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\UserPassword'); - } - - $user = $this->tokenStorage->getToken()->getUser(); - - if (!$user instanceof UserInterface) { - throw new ConstraintDefinitionException('The User object must implement the UserInterface interface.'); - } - - // give username, it's used to hash the password - $encoder = $this->encoderFactory->getEncoder($user); - $encoder->setUsername($user->getUsername()); - - if (!$encoder->isPasswordValid($user->getPassword(), $password, $user->getSalt())) { - $this->context->addViolation($constraint->message); - } - } -} -- cgit v1.2.3