92 lines
2.4 KiB
PHP
Executable File
92 lines
2.4 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class HomeController extends AbstractController
|
|
{
|
|
public function home(Request $request)
|
|
{
|
|
/*
|
|
if ($request->getSession()->get('fgforceconnect') && !$this->getUser()) {
|
|
return $this->redirectToRoute('app_login');
|
|
}
|
|
*/
|
|
|
|
if (!$this->getUser()) {
|
|
return $this->render('Home/home.html.twig', [
|
|
'useheader' => true,
|
|
'usemenu' => false,
|
|
'usesidebar' => false,
|
|
'maxsize' => 1000,
|
|
]);
|
|
}
|
|
if ($this->getUser()->hasRole('ROLE_USER')) {
|
|
return $this->redirectToRoute('app_user_home');
|
|
}
|
|
|
|
if ($this->getUser()->hasRole('ROLE_MANAGER')) {
|
|
return $this->redirectToRoute('app_manager_home');
|
|
}
|
|
|
|
if ($this->getUser()->hasRole('ROLE_MASTER')) {
|
|
return $this->redirectToRoute('app_master_home');
|
|
}
|
|
|
|
if ($this->getUser()->hasRole('ROLE_MODO')) {
|
|
return $this->redirectToRoute('app_modo_home');
|
|
}
|
|
|
|
if ($this->getUser()->hasRole('ROLE_ADMIN')) {
|
|
return $this->redirectToRoute('app_admin_home');
|
|
}
|
|
}
|
|
|
|
public function homeuser($access): Response
|
|
{
|
|
return $this->render('Home/home.html.twig', [
|
|
'useheader' => true,
|
|
'usemenu' => false,
|
|
'usesidebar' => false,
|
|
'maxsize' => 1000,
|
|
]);
|
|
}
|
|
|
|
public function homemaster($access): Response
|
|
{
|
|
return $this->render('Home/home.html.twig', [
|
|
'useheader' => true,
|
|
'usemenu' => false,
|
|
'usesidebar' => false,
|
|
'maxsize' => 1000,
|
|
]);
|
|
}
|
|
|
|
public function homemanager($access): Response
|
|
{
|
|
return $this->redirectToRoute('app_manager_user');
|
|
}
|
|
|
|
public function homemodo($access): Response
|
|
{
|
|
return $this->redirectToRoute('app_modo_niveau02');
|
|
}
|
|
|
|
public function homeadmin($access): Response
|
|
{
|
|
return $this->redirectToRoute('app_admin_config');
|
|
}
|
|
|
|
public function docrest(): Response
|
|
{
|
|
return $this->render('Home/docrest.html.twig', [
|
|
'useheader' => true,
|
|
'usemenu' => false,
|
|
'usesidebar' => true,
|
|
]);
|
|
}
|
|
}
|