]> Raphaël G. Git Repositories - airbundle/blobdiff - Controller/UserController.php
Replace map util by image to generate multimap
[airbundle] / Controller / UserController.php
index 5010e6468b867de016c3df5b8c4b93138d7be317..c5d4a6fcf45275e28e42ad2c93974771ca96a86a 100644 (file)
@@ -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
                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
                }
 
                //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'));
                }
 
                        $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
                //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']
                );
        }
 
                );
        }