X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/airbundle/blobdiff_plain/2884b5c8b4514b0e1c0dd0449db2af5be32382b6..fe6e2c02f7e5253da2b031783e426b3a65bf90b8:/Controller/UserController.php?ds=inline diff --git a/Controller/UserController.php b/Controller/UserController.php index 5010e64..c5d4a6f 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -94,7 +94,7 @@ class UserController extends BaseUserController { if (empty($user = $this->doctrine->getRepository($this->config['class']['user'])->findOneByMail($mail))) { //Throw not found //XXX: prevent slugger reverse engineering by not displaying decoded mail - throw $this->createNotFoundException($this->translator->trans('Unable to find account %mail%', ['%mail%' => $smail])); + throw $this->createNotFoundException($this->translator->trans('Unable to find account: %mail%', ['%mail%' => $smail])); } //Prevent access when not admin, user is not guest and not currently logged user @@ -618,12 +618,27 @@ class UserController extends BaseUserController { $this->addFlash('notice', $this->translator->trans('To change your password login with your mail and any password then follow the procedure')); } + #XXX: TODO: voir si c'est pas plus logique de mettre en place la sélection de dance pour tout le monde et utiliser ça comme source de donnée pour les ml auxquelles on souscrit ??? + + #if ($this->checker->isGranted('ROLE_ADMIN')) { + //Create the DanceType form and give the proper parameters + $dance = $this->factory->create('Rapsys\AirBundle\Form\DanceType', $user, [ + //Set dance choices + 'dance_choices' => $danceChoices, + //Set dance favorites + 'dance_favorites' => $this->doctrine->getRepository($this->config['class']['dance'])->findIdByNameTypeAsArray($this->config['default']['dance_favorites']), + ]); + //Render view return $this->render( //Template $this->config['edit']['view']['name'], //Context - ['edit' => $edit->createView(), 'sent' => $request->query->get('sent', 0)]+$this->config['edit']['view']['context'] + [ + 'dance' => $dance->createView(), + 'edit' => $edit->createView(), + 'sent' => $request->query->get('sent', 0) + ]+$this->config['edit']['view']['context'] ); }