summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
76b2ea7)
Remove forename, surname and pseudonym extraction from mail
Add support for configurable field
'civility_default' => $doctrine->getRepository($this->config['class']['civility'])->findOneByTitle($this->config['default']['civility']),
//Disable mail
'mail' => $this->isGranted('ROLE_ADMIN'),
'civility_default' => $doctrine->getRepository($this->config['class']['civility'])->findOneByTitle($this->config['default']['civility']),
//Disable mail
'mail' => $this->isGranted('ROLE_ADMIN'),
- //Disable slug
- 'slug' => $this->isGranted('ROLE_ADMIN'),
//Disable password
'password' => false,
//Set method
'method' => 'POST'
//Disable password
'password' => false,
//Set method
'method' => 'POST'
+ ]+$this->config['edit']['field']);
//With admin role
if ($this->isGranted('ROLE_ADMIN')) {
//With admin role
if ($this->isGranted('ROLE_ADMIN')) {
//Set data
$data = $edit->getData();
//Set data
$data = $edit->getData();
- //Set slug
- $slug = null;
-
- //With admin
- if ($this->isGranted('ROLE_ADMIN')) {
- //With slug
- if (!empty($data->getSlug())) {
- //Set slug
- $slug = $slugger->slug($data->getPseudonym());
- }
-
- //Update slug
- $data->setSlug($slug);
- }
-
//Queue snippet save
$manager->persist($data);
//Queue snippet save
$manager->persist($data);
$sfield = $field;
//Reset field
$sfield = $field;
//Reset field
- $field = [
- //Without slug
- 'slug' => false
- ];
'mail' => true,
//Set method
'method' => 'POST'
'mail' => true,
//Set method
'method' => 'POST'
+ ]+$this->config['register']['field']);
if ($request->isMethod('POST')) {
//Refill the fields in case the form is not valid.
if ($request->isMethod('POST')) {
//Refill the fields in case the form is not valid.
//Set mail shortcut
$registerMail =& $this->config['register']['mail'];
//Set mail shortcut
$registerMail =& $this->config['register']['mail'];
- //Extract names and pseudonym from mail
- $names = explode(' ', $pseudonym = ucwords(trim(preg_replace('/[^a-zA-Z]+/', ' ', current(explode('@', $data->getMail()))))));
-
- //Set pseudonym
- $user->setPseudonym($user->getPseudonym()??$pseudonym);
-
- //Set forename
- $user->setForename($user->getForename()??$names[0]);
-
- //Set surname
- $user->setSurname($user->getSurname()??$names[1]??$names[0]);
-
//Set password
$user->setPassword($encoder->encodePassword($user, $user->getPassword()??$data->getMail()));
//Set password
$user->setPassword($encoder->encodePassword($user, $user->getPassword()??$data->getMail()));