diff options
author | Jeremy <jeremy.benoist@gmail.com> | 2015-03-28 00:10:39 +0100 |
---|---|---|
committer | Jeremy <jeremy.benoist@gmail.com> | 2015-04-01 21:23:27 +0200 |
commit | c844dc0c50bb4f1044154401310af25eb21b0f11 (patch) | |
tree | a4572193af600a8170b220c0c186bc46d6dd3d8e /src/Wallabag/CoreBundle/Entity/User.php | |
parent | 1a93ee423b072ec3bcb0c437cbf9b488bdea245c (diff) | |
download | wallabag-c844dc0c50bb4f1044154401310af25eb21b0f11.tar.gz wallabag-c844dc0c50bb4f1044154401310af25eb21b0f11.tar.zst wallabag-c844dc0c50bb4f1044154401310af25eb21b0f11.zip |
Remove ability to change username
Since password are linked to username it was hard to change username while checking that the password is the good one.
Instead of doing crazy things to achieve that, I act that user won't be able to update username.
Also, username (and email) must be unique, since people logged in using username and can request a new password using email.
This should fix #1149
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/User.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/User.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php index e75e3a83..63ec072c 100644 --- a/src/Wallabag/CoreBundle/Entity/User.php +++ b/src/Wallabag/CoreBundle/Entity/User.php | |||
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Entity; | |||
4 | 4 | ||
5 | use Doctrine\Common\Collections\ArrayCollection; | 5 | use Doctrine\Common\Collections\ArrayCollection; |
6 | use Doctrine\ORM\Mapping as ORM; | 6 | use Doctrine\ORM\Mapping as ORM; |
7 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; | ||
7 | use Symfony\Component\Security\Core\User\UserInterface; | 8 | use Symfony\Component\Security\Core\User\UserInterface; |
8 | use Symfony\Component\Security\Core\User\AdvancedUserInterface; | 9 | use Symfony\Component\Security\Core\User\AdvancedUserInterface; |
9 | use Symfony\Component\Validator\Constraints as Assert; | 10 | use Symfony\Component\Validator\Constraints as Assert; |
@@ -17,6 +18,9 @@ use JMS\Serializer\Annotation\Expose; | |||
17 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\UserRepository") | 18 | * @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\UserRepository") |
18 | * @ORM\HasLifecycleCallbacks() | 19 | * @ORM\HasLifecycleCallbacks() |
19 | * @ExclusionPolicy("all") | 20 | * @ExclusionPolicy("all") |
21 | * | ||
22 | * @UniqueEntity("email") | ||
23 | * @UniqueEntity("username") | ||
20 | */ | 24 | */ |
21 | class User implements AdvancedUserInterface, \Serializable | 25 | class User implements AdvancedUserInterface, \Serializable |
22 | { | 26 | { |