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