mirror of
https://github.com/symfony/recipes-contrib.git
synced 2026-09-11 15:16:55 +03:00
Merge pull request #929
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
enigma972_user:
|
||||
# if this value equal true, the User should confirm theire mail
|
||||
check_mail: false
|
||||
# The validity duration in secondes, 4 houres by default (14,400 sec)
|
||||
reset_password_code_validity: 14400
|
||||
# where to redirect after login
|
||||
target: home
|
||||
# the no reply email for this app
|
||||
no_reply_mail: no-reply@mail.com
|
||||
not_send_welcome_mail: true
|
||||
@@ -0,0 +1,3 @@
|
||||
enigma972_user:
|
||||
resource: '@Enigma972UserBundle/Controller/'
|
||||
type: annotation
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"bundles": {
|
||||
"Enigma972\\UserBundle\\Enigma972UserBundle": ["all"]
|
||||
},
|
||||
"copy-from-recipe": {
|
||||
"config/": "%CONFIG_DIR%/",
|
||||
"src/": "%SRC_DIR%/"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<bg=blue;fg=white> </>
|
||||
<bg=blue;fg=white> Next: UserBundle Configuration </>
|
||||
<bg=blue;fg=white> </>
|
||||
|
||||
* Create an User entity and extend Enigma972\UserBundle\Entity\User class
|
||||
|
||||
* And add all properties and methods you needs, it is your!
|
||||
|
||||
Documentation: https://www.github.com/enigma972/user-bundle
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Enigma972\UserBundle\Entity\User as BaseUser;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=UserRepository::class)
|
||||
* @UniqueEntity(fields={"username"}, message="There is already an account with this username")
|
||||
*/
|
||||
class User extends BaseUser
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\User;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Enigma972\UserBundle\Repository\UserRepository as Users;
|
||||
|
||||
/**
|
||||
* @method User|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method User|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method User[] findAll()
|
||||
* @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class UserRepository extends Users
|
||||
{
|
||||
// /**
|
||||
// * @return User[] Returns an array of User objects
|
||||
// */
|
||||
/*
|
||||
public function findByExampleField($value)
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->andWhere('u.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->orderBy('u.id', 'ASC')
|
||||
->setMaxResults(10)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
public function findOneBySomeField($value): ?User
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->andWhere('u.exampleField = :val')
|
||||
->setParameter('val', $value)
|
||||
->getQuery()
|
||||
->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user