diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-23 20:56:09 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-23 20:56:09 +0100 |
commit | 0e7971d8354b0923d2e8f38690b9fe46e695dd93 (patch) | |
tree | 7026acde83f5d38a9ad94d92f926d880aa233dbe /src/Wallabag/CoreBundle/Entity/User.php | |
parent | 2f6a596760c62efd9e43602f787fa44400d522b3 (diff) | |
parent | c641baad0ec52198d77f2018c7bf8acdfe5957ce (diff) | |
download | wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.tar.gz wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.tar.zst wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.zip |
Merge pull request #1095 from wallabag/v2-config
V2 config
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/User.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/User.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/User.php b/src/Wallabag/CoreBundle/Entity/User.php index c83250c3..193dfebc 100644 --- a/src/Wallabag/CoreBundle/Entity/User.php +++ b/src/Wallabag/CoreBundle/Entity/User.php | |||
@@ -6,6 +6,7 @@ use Doctrine\Common\Collections\ArrayCollection; | |||
6 | use Doctrine\ORM\Mapping as ORM; | 6 | use Doctrine\ORM\Mapping as ORM; |
7 | use Symfony\Component\Security\Core\User\UserInterface; | 7 | use Symfony\Component\Security\Core\User\UserInterface; |
8 | use Symfony\Component\Security\Core\User\AdvancedUserInterface; | 8 | use Symfony\Component\Security\Core\User\AdvancedUserInterface; |
9 | use Symfony\Component\Validator\Constraints as Assert; | ||
9 | 10 | ||
10 | /** | 11 | /** |
11 | * User | 12 | * User |
@@ -29,6 +30,11 @@ class User implements AdvancedUserInterface, \Serializable | |||
29 | * @var string | 30 | * @var string |
30 | * | 31 | * |
31 | * @ORM\Column(name="username", type="text") | 32 | * @ORM\Column(name="username", type="text") |
33 | * @Assert\NotBlank() | ||
34 | * @Assert\Length( | ||
35 | * min = "3", | ||
36 | * max = "255" | ||
37 | * ) | ||
32 | */ | 38 | */ |
33 | private $username; | 39 | private $username; |
34 | 40 | ||
@@ -56,14 +62,16 @@ class User implements AdvancedUserInterface, \Serializable | |||
56 | /** | 62 | /** |
57 | * @var string | 63 | * @var string |
58 | * | 64 | * |
59 | * @ORM\Column(name="email", type="text", nullable=true) | 65 | * @ORM\Column(name="email", type="text", nullable=false) |
66 | * @Assert\Email() | ||
67 | * @Assert\NotBlank() | ||
60 | */ | 68 | */ |
61 | private $email; | 69 | private $email; |
62 | 70 | ||
63 | /** | 71 | /** |
64 | * @ORM\Column(name="is_active", type="boolean") | 72 | * @ORM\Column(name="is_active", type="boolean", nullable=false) |
65 | */ | 73 | */ |
66 | private $isActive; | 74 | private $isActive = true; |
67 | 75 | ||
68 | /** | 76 | /** |
69 | * @var date | 77 | * @var date |
@@ -86,9 +94,8 @@ class User implements AdvancedUserInterface, \Serializable | |||
86 | 94 | ||
87 | public function __construct() | 95 | public function __construct() |
88 | { | 96 | { |
89 | $this->isActive = true; | 97 | $this->salt = md5(uniqid(null, true)); |
90 | $this->salt = md5(uniqid(null, true)); | 98 | $this->entries = new ArrayCollection(); |
91 | $this->entries = new ArrayCollection(); | ||
92 | } | 99 | } |
93 | 100 | ||
94 | /** | 101 | /** |