Commit 6cb6ae1e by Damien Moulard

redirect to index if switching to comptoir or groupe role

parent 0a7b3ecd
...@@ -191,7 +191,6 @@ class CotisationAdmin extends AbstractAdmin ...@@ -191,7 +191,6 @@ class CotisationAdmin extends AbstractAdmin
protected function configureListFields(ListMapper $listMapper) protected function configureListFields(ListMapper $listMapper)
{ {
// In TAV env, block access to standard cotisations admin. // In TAV env, block access to standard cotisations admin.
// TODO: find a better way (eg. block access with App\EventListener\MenuBuilderListener?)
if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) { if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) {
$url = $this->getConfigurationPool()->getContainer()->get( 'router' )->generate( 'sonata_admin_dashboard' ); $url = $this->getConfigurationPool()->getContainer()->get( 'router' )->generate( 'sonata_admin_dashboard' );
$redirection = new RedirectResponse( $url ); $redirection = new RedirectResponse( $url );
......
...@@ -379,7 +379,11 @@ class IndexController extends AbstractController ...@@ -379,7 +379,11 @@ class IndexController extends AbstractController
$this->session->set('_groupegere', $groupe); $this->session->set('_groupegere', $groupe);
$this->reloadUserTokenFromGroup($group, $request); $this->reloadUserTokenFromGroup($group, $request);
return $this->redirectToRoute('sonata_admin_dashboard'); if ($this->getParameter('tav_env') == true) {
return $this->redirectToRoute('index');
} else {
return $this->redirectToRoute('sonata_admin_dashboard');
}
} }
/** /**
...@@ -408,7 +412,11 @@ class IndexController extends AbstractController ...@@ -408,7 +412,11 @@ class IndexController extends AbstractController
$this->session->set('_comptoirgere', $comptoir); $this->session->set('_comptoirgere', $comptoir);
$this->reloadUserTokenFromGroup($group, $request); $this->reloadUserTokenFromGroup($group, $request);
return $this->redirectToRoute('sonata_admin_dashboard'); if ($this->getParameter('tav_env') == true) {
return $this->redirectToRoute('index');
} else {
return $this->redirectToRoute('sonata_admin_dashboard');
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment