<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use App\Service\ExportAndImportTable;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SocietySecurityController extends AbstractController
{
/**
* @Route("/", name="login")
*/
public function login(AuthenticationUtils $authenticationUtils): Response
{
if ($this->getUser()) {
return $this->redirectToRoute('home');
}
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('security/login.html.twig', ['last_username' => $lastUsername, 'error' => $error]);
}
/**
* @Route("/logout", name="logout")
*/
public function logout(): Response
{
// throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
return $this->redirectToRoute('login');
}
/**
* @Route("/home/portail-administration/Gestion-des-Bases-de-donnees/table/export/{table_name}", name="app_portail_administration-bdd_table-export")
*/
public function tableExportFile($table_name,Request $request, ExportAndImportTable $ExportAndImportTable): Response
{
return $ExportAndImportTable->ExportTable($table_name);
}
}