Browse Source

Evolution #49: Page home: rediriger si déjà connecté

bastien 13 years ago
parent
commit
8feebf2f2e
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/Muzich/IndexBundle/Controller/IndexController.php

+ 6 - 1
src/Muzich/IndexBundle/Controller/IndexController.php View File

@@ -6,7 +6,7 @@ use Muzich\CoreBundle\lib\Controller;
6 6
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
7 7
 use Symfony\Component\Security\Core\SecurityContext;
8 8
 
9
-use Symfony\Component\HttpFoundation\RedirectResponse;
9
+//use Symfony\Component\HttpFoundation\RedirectResponse;
10 10
 
11 11
 class IndexController extends Controller
12 12
 {
@@ -17,6 +17,11 @@ class IndexController extends Controller
17 17
    */
18 18
   public function indexAction()
19 19
   {
20
+    if ($this->getUser() != 'anon.')
21
+    {
22
+      return $this->redirect($this->generateUrl('home'));
23
+    }
24
+    
20 25
     $vars = $this->proceedLogin();
21 26
     $form = $this->container->get('fos_user.registration.form');
22 27