From d91691573f108422cc2080462af35ebd62dc93fb Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 8 Feb 2015 21:47:36 +0100 Subject: Add custom auth encoder & provider These custom classes allow Wallabag v2 to be compatible with Wallabag v1 salted password --- src/Wallabag/CoreBundle/Entity/User.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle/Entity') diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php index cfbd57f8..c83250c3 100644 --- a/src/Wallabag/CoreBundle/Entity/User.php +++ b/src/Wallabag/CoreBundle/Entity/User.php @@ -161,7 +161,11 @@ class User implements AdvancedUserInterface, \Serializable */ public function setPassword($password) { - $this->password = $password; + if (!$password && 0 === strlen($password)) { + return; + } + + $this->password = sha1($password.$this->getUsername().$this->getSalt()); return $this; } -- cgit v1.2.3