add email to user and allow to connect through email or username

This commit is contained in:
2018-07-10 12:53:44 +02:00
parent 45a9937dbb
commit 25d00877ae
12 changed files with 395 additions and 0 deletions

View File

@@ -14,6 +14,21 @@ Chill\MainBundle\Entity\User:
username:
type: string
length: 80
usernameCanonical:
name: username_canonical
type: string
length: 80
unique: true
email:
type: string
length: 150
nullable: true
emailCanonical:
name: email_canonical
type: string
length: 150
nullable: true
unique: true
password:
type: string
length: 255

View File

@@ -9,4 +9,9 @@ services:
chill.main.role_provider:
class: Chill\MainBundle\Security\RoleProvider
chill.main.user_provider:
class: Chill\MainBundle\Security\UserProvider\UserProvider
arguments:
$em: '@Doctrine\ORM\EntityManagerInterface'

View File

@@ -5,3 +5,9 @@ services:
- "@chill.main.security.authorization.helper"
tags:
- { name: "validator.constraint_validator" }
Chill\MainBundle\Validation\Validator\UserUniqueEmailAndUsername:
arguments:
$em: '@Doctrine\ORM\EntityManagerInterface'
tags:
- { name: "validator.constraint_validator" }

View File

@@ -16,9 +16,12 @@ Chill\MainBundle\Entity\User:
- Length:
max: 70
min: 3
email:
- Email: ~
constraints:
- Callback:
callback: isGroupCenterPresentOnce
- \Chill\MainBundle\Validation\Constraint\UserUniqueEmailAndUsernameConstraint: ~
Chill\MainBundle\Entity\RoleScope:
constraints: