src/Controller/AdminController.php line 16
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
/**
* Gestion de la connexion des utilisateurs
*/
class AdminController extends AbstractController
{
#[Route('/', name: 'dashboard')]
public function index(): Response
{
if (!$this->getUser()) {
return $this->redirectToRoute('login');
} else {
$user = $this->getUser();
if ($user->isEnabled() == true) {
return $this->redirectToRoute('client_list');
} else {
//$this->addFlash('errors', "Votre compte est desactivé");
return $this->redirectToRoute('logout');
}
}
return $this->render('admin/index.html.twig', []);
}
}