Compare commits
3 Commits
f97358bd4e
...
b7773bd06d
Author | SHA1 | Date | |
---|---|---|---|
b7773bd06d | |||
39c6623e3d | |||
665589a395 |
2
.idea/dataSources.xml
generated
2
.idea/dataSources.xml
generated
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
<data-source source="LOCAL" name="HegreEtConfort@localhost" uuid="330f803e-8495-4534-bf92-2d18fd17b85f">
|
<data-source source="LOCAL" name="HegreEtConfort@localhost" uuid="21423ae4-3232-4641-affb-06399f70655a">
|
||||||
<driver-ref>postgresql</driver-ref>
|
<driver-ref>postgresql</driver-ref>
|
||||||
<synchronize>true</synchronize>
|
<synchronize>true</synchronize>
|
||||||
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
|
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
"symfony/property-info": "7.1.*",
|
"symfony/property-info": "7.1.*",
|
||||||
"symfony/runtime": "7.1.*",
|
"symfony/runtime": "7.1.*",
|
||||||
"symfony/security-bundle": "7.1.*",
|
"symfony/security-bundle": "7.1.*",
|
||||||
|
"symfony/security-csrf": "7.1.*",
|
||||||
"symfony/serializer": "7.1.*",
|
"symfony/serializer": "7.1.*",
|
||||||
"symfony/stimulus-bundle": "^2.20",
|
"symfony/stimulus-bundle": "^2.20",
|
||||||
"symfony/string": "7.1.*",
|
"symfony/string": "7.1.*",
|
||||||
|
38
composer.lock
generated
38
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "e99a99b4ca2d6b58821cb711cb543c93",
|
"content-hash": "69565ad2398a468ae94c92c449ee3c20",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "composer/semver",
|
"name": "composer/semver",
|
||||||
@ -3466,16 +3466,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/form",
|
"name": "symfony/form",
|
||||||
"version": "v7.1.5",
|
"version": "v7.1.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/form.git",
|
"url": "https://github.com/symfony/form.git",
|
||||||
"reference": "6b8b53ad6d42f14b158c896163b96ff260d78222"
|
"reference": "7a48dda96fe16711fc042df38ca1a7dd4d9d6387"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/form/zipball/6b8b53ad6d42f14b158c896163b96ff260d78222",
|
"url": "https://api.github.com/repos/symfony/form/zipball/7a48dda96fe16711fc042df38ca1a7dd4d9d6387",
|
||||||
"reference": "6b8b53ad6d42f14b158c896163b96ff260d78222",
|
"reference": "7a48dda96fe16711fc042df38ca1a7dd4d9d6387",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -3543,7 +3543,7 @@
|
|||||||
"description": "Allows to easily create, process and reuse HTML forms",
|
"description": "Allows to easily create, process and reuse HTML forms",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/form/tree/v7.1.5"
|
"source": "https://github.com/symfony/form/tree/v7.1.6"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -3559,7 +3559,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-09-20T08:28:38+00:00"
|
"time": "2024-10-09T08:46:59+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/framework-bundle",
|
"name": "symfony/framework-bundle",
|
||||||
@ -5648,16 +5648,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/security-bundle",
|
"name": "symfony/security-bundle",
|
||||||
"version": "v7.1.4",
|
"version": "v7.1.11",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/security-bundle.git",
|
"url": "https://github.com/symfony/security-bundle.git",
|
||||||
"reference": "5e10107856ff64d477c61fed7bcbb8a16125ea01"
|
"reference": "4012dbc0884fc7cbf555615a5aaa16f7c0d3f222"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/security-bundle/zipball/5e10107856ff64d477c61fed7bcbb8a16125ea01",
|
"url": "https://api.github.com/repos/symfony/security-bundle/zipball/4012dbc0884fc7cbf555615a5aaa16f7c0d3f222",
|
||||||
"reference": "5e10107856ff64d477c61fed7bcbb8a16125ea01",
|
"reference": "4012dbc0884fc7cbf555615a5aaa16f7c0d3f222",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -5734,7 +5734,7 @@
|
|||||||
"description": "Provides a tight integration of the Security component into the Symfony full-stack framework",
|
"description": "Provides a tight integration of the Security component into the Symfony full-stack framework",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/security-bundle/tree/v7.1.4"
|
"source": "https://github.com/symfony/security-bundle/tree/v7.1.11"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -5750,7 +5750,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-08-20T11:38:55+00:00"
|
"time": "2024-12-31T17:57:35+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/security-core",
|
"name": "symfony/security-core",
|
||||||
@ -5840,16 +5840,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/security-csrf",
|
"name": "symfony/security-csrf",
|
||||||
"version": "v7.1.1",
|
"version": "v7.1.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/security-csrf.git",
|
"url": "https://github.com/symfony/security-csrf.git",
|
||||||
"reference": "27cd1bce9d7f3457a152a6ca9790712d6954dd21"
|
"reference": "23b460d3447fd61970e0ed5ec7a0301296a17f06"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/security-csrf/zipball/27cd1bce9d7f3457a152a6ca9790712d6954dd21",
|
"url": "https://api.github.com/repos/symfony/security-csrf/zipball/23b460d3447fd61970e0ed5ec7a0301296a17f06",
|
||||||
"reference": "27cd1bce9d7f3457a152a6ca9790712d6954dd21",
|
"reference": "23b460d3447fd61970e0ed5ec7a0301296a17f06",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -5888,7 +5888,7 @@
|
|||||||
"description": "Symfony Security Component - CSRF Library",
|
"description": "Symfony Security Component - CSRF Library",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/security-csrf/tree/v7.1.1"
|
"source": "https://github.com/symfony/security-csrf/tree/v7.1.6"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -5904,7 +5904,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-05-31T14:57:53+00:00"
|
"time": "2024-09-25T14:20:29+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/security-http",
|
"name": "symfony/security-http",
|
||||||
|
@ -7,16 +7,28 @@ security:
|
|||||||
# used to reload user from session & other features (e.g. switch_user)
|
# used to reload user from session & other features (e.g. switch_user)
|
||||||
app_user_provider:
|
app_user_provider:
|
||||||
entity:
|
entity:
|
||||||
class: App\Entity\User
|
class: App\Entity\Utilisateur
|
||||||
property: email
|
property: email
|
||||||
firewalls:
|
firewalls:
|
||||||
dev:
|
dev:
|
||||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||||
security: false
|
security: false
|
||||||
|
|
||||||
main:
|
main:
|
||||||
lazy: true
|
lazy: true
|
||||||
provider: app_user_provider
|
provider: app_user_provider
|
||||||
|
|
||||||
|
form_login:
|
||||||
|
login_path: app_login
|
||||||
|
check_path: app_login
|
||||||
|
enable_csrf: true
|
||||||
|
csrf_token_id: authenticate
|
||||||
|
|
||||||
|
logout:
|
||||||
|
path: app_logout
|
||||||
|
target: app_login
|
||||||
|
|
||||||
|
|
||||||
# activate different ways to authenticate
|
# activate different ways to authenticate
|
||||||
# https://symfony.com/doc/current/security.html#the-firewall
|
# https://symfony.com/doc/current/security.html#the-firewall
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration;
|
|||||||
/**
|
/**
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
*/
|
*/
|
||||||
final class Version20250408072726 extends AbstractMigration
|
final class Version20250410150126 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
@ -24,14 +24,14 @@ final class Version20250408072726 extends AbstractMigration
|
|||||||
$this->addSql('CREATE SEQUENCE intervention_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
$this->addSql('CREATE SEQUENCE intervention_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
$this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE SEQUENCE stock_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
$this->addSql('CREATE SEQUENCE stock_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE SEQUENCE user_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
$this->addSql('CREATE SEQUENCE utilisateur_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE SEQUENCE vehicle_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
$this->addSql('CREATE SEQUENCE vehicle_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||||
$this->addSql('CREATE TABLE fault (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
$this->addSql('CREATE TABLE fault (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE TABLE intervention (id INT NOT NULL, wording VARCHAR(255) NOT NULL, timestamp TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, description VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
$this->addSql('CREATE TABLE intervention (id INT NOT NULL, wording VARCHAR(255) NOT NULL, timestamp TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, description VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE TABLE skill (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
$this->addSql('CREATE TABLE skill (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE TABLE stock (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, quantity VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
$this->addSql('CREATE TABLE stock (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, quantity VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE TABLE "user" (id INT NOT NULL, email VARCHAR(180) NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, phone VARCHAR(255) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
$this->addSql('CREATE TABLE utilisateur (id INT NOT NULL, email VARCHAR(180) NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, phone VARCHAR(255) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON "user" (email)');
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON utilisateur (email)');
|
||||||
$this->addSql('CREATE TABLE vehicle (id INT NOT NULL, license_plate VARCHAR(255) NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
$this->addSql('CREATE TABLE vehicle (id INT NOT NULL, license_plate VARCHAR(255) NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
|
$this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
|
||||||
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
|
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
|
||||||
@ -58,13 +58,13 @@ final class Version20250408072726 extends AbstractMigration
|
|||||||
$this->addSql('DROP SEQUENCE intervention_id_seq CASCADE');
|
$this->addSql('DROP SEQUENCE intervention_id_seq CASCADE');
|
||||||
$this->addSql('DROP SEQUENCE skill_id_seq CASCADE');
|
$this->addSql('DROP SEQUENCE skill_id_seq CASCADE');
|
||||||
$this->addSql('DROP SEQUENCE stock_id_seq CASCADE');
|
$this->addSql('DROP SEQUENCE stock_id_seq CASCADE');
|
||||||
$this->addSql('DROP SEQUENCE user_id_seq CASCADE');
|
$this->addSql('DROP SEQUENCE utilisateur_id_seq CASCADE');
|
||||||
$this->addSql('DROP SEQUENCE vehicle_id_seq CASCADE');
|
$this->addSql('DROP SEQUENCE vehicle_id_seq CASCADE');
|
||||||
$this->addSql('DROP TABLE fault');
|
$this->addSql('DROP TABLE fault');
|
||||||
$this->addSql('DROP TABLE intervention');
|
$this->addSql('DROP TABLE intervention');
|
||||||
$this->addSql('DROP TABLE skill');
|
$this->addSql('DROP TABLE skill');
|
||||||
$this->addSql('DROP TABLE stock');
|
$this->addSql('DROP TABLE stock');
|
||||||
$this->addSql('DROP TABLE "user"');
|
$this->addSql('DROP TABLE utilisateur');
|
||||||
$this->addSql('DROP TABLE vehicle');
|
$this->addSql('DROP TABLE vehicle');
|
||||||
$this->addSql('DROP TABLE messenger_messages');
|
$this->addSql('DROP TABLE messenger_messages');
|
||||||
}
|
}
|
@ -9,7 +9,7 @@ use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
|||||||
|
|
||||||
class AuthenticationController extends AbstractController
|
class AuthenticationController extends AbstractController
|
||||||
{
|
{
|
||||||
#[Route(path: '/', name: '_login')]
|
#[Route(path: '/', name: 'app_login')]
|
||||||
public function login(AuthenticationUtils $authenticationUtils): Response
|
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||||
{
|
{
|
||||||
// get the login error if there is one
|
// get the login error if there is one
|
||||||
@ -24,7 +24,7 @@ class AuthenticationController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route(path: '/logout', name: '_logout')]
|
#[Route(path: '/logout', name: 'app_logout')]
|
||||||
public function logout(): void
|
public function logout(): void
|
||||||
{
|
{
|
||||||
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\Utilisateur;
|
||||||
use App\Form\UserType;
|
use App\Form\UserType;
|
||||||
use App\Repository\UserRepository;
|
use App\Repository\UserRepository;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
@ -25,7 +25,7 @@ final class UserController extends AbstractController
|
|||||||
#[Route('/new', name: 'app_user_new', methods: ['GET', 'POST'])]
|
#[Route('/new', name: 'app_user_new', methods: ['GET', 'POST'])]
|
||||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$user = new User();
|
$user = new Utilisateur();
|
||||||
$form = $this->createForm(UserType::class, $user);
|
$form = $this->createForm(UserType::class, $user);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ final class UserController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_user_show', methods: ['GET'])]
|
#[Route('/{id}', name: 'app_user_show', methods: ['GET'])]
|
||||||
public function show(User $user): Response
|
public function show(Utilisateur $user): Response
|
||||||
{
|
{
|
||||||
return $this->render('user/show.html.twig', [
|
return $this->render('user/show.html.twig', [
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
@ -51,7 +51,7 @@ final class UserController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}/edit', name: 'app_user_edit', methods: ['GET', 'POST'])]
|
#[Route('/{id}/edit', name: 'app_user_edit', methods: ['GET', 'POST'])]
|
||||||
public function edit(Request $request, User $user, EntityManagerInterface $entityManager): Response
|
public function edit(Request $request, Utilisateur $user, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
$form = $this->createForm(UserType::class, $user);
|
$form = $this->createForm(UserType::class, $user);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
@ -69,7 +69,7 @@ final class UserController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[Route('/{id}', name: 'app_user_delete', methods: ['POST'])]
|
#[Route('/{id}', name: 'app_user_delete', methods: ['POST'])]
|
||||||
public function delete(Request $request, User $user, EntityManagerInterface $entityManager): Response
|
public function delete(Request $request, Utilisateur $user, EntityManagerInterface $entityManager): Response
|
||||||
{
|
{
|
||||||
if ($this->isCsrfTokenValid('delete'.$user->getId(), $request->getPayload()->getString('_token'))) {
|
if ($this->isCsrfTokenValid('delete'.$user->getId(), $request->getPayload()->getString('_token'))) {
|
||||||
$entityManager->remove($user);
|
$entityManager->remove($user);
|
||||||
|
@ -10,7 +10,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
|||||||
|
|
||||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||||
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
|
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
|
||||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
class Utilisateur implements UserInterface, PasswordAuthenticatedUserInterface
|
||||||
{
|
{
|
||||||
#[ORM\Id]
|
#[ORM\Id]
|
||||||
#[ORM\GeneratedValue]
|
#[ORM\GeneratedValue]
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\Utilisateur;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||||
@ -32,7 +32,7 @@ class UserType extends AbstractType
|
|||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'data_class' => User::class,
|
'data_class' => Utilisateur::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Repository;
|
namespace App\Repository;
|
||||||
|
|
||||||
use App\Entity\User;
|
use App\Entity\Utilisateur;
|
||||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||||
@ -10,13 +10,13 @@ use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
|||||||
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @extends ServiceEntityRepository<User>
|
* @extends ServiceEntityRepository<Utilisateur>
|
||||||
*/
|
*/
|
||||||
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
||||||
{
|
{
|
||||||
public function __construct(ManagerRegistry $registry)
|
public function __construct(ManagerRegistry $registry)
|
||||||
{
|
{
|
||||||
parent::__construct($registry, User::class);
|
parent::__construct($registry, Utilisateur::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,7 +24,7 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
|
|||||||
*/
|
*/
|
||||||
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
|
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
|
||||||
{
|
{
|
||||||
if (!$user instanceof User) {
|
if (!$user instanceof Utilisateur) {
|
||||||
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
|
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
|
|||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * @return User[] Returns an array of User objects
|
// * @return Utilisateur[] Returns an array of Utilisateur objects
|
||||||
// */
|
// */
|
||||||
// public function findByExampleField($value): array
|
// public function findByExampleField($value): array
|
||||||
// {
|
// {
|
||||||
@ -48,7 +48,7 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
|
|||||||
// ;
|
// ;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// public function findOneBySomeField($value): ?User
|
// public function findOneBySomeField($value): ?Utilisateur
|
||||||
// {
|
// {
|
||||||
// return $this->createQueryBuilder('u')
|
// return $this->createQueryBuilder('u')
|
||||||
// ->andWhere('u.exampleField = :val')
|
// ->andWhere('u.exampleField = :val')
|
||||||
|
@ -40,14 +40,11 @@
|
|||||||
|
|
||||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
||||||
|
|
||||||
<input type="checkbox" name="remember" id="remember">
|
|
||||||
<label class="remember" for="remember">Se souvenir de moi</label>
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<button type="submit" class="login"> Connexion </button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<button class="login"> Connexion </button>
|
|
||||||
|
|
||||||
<p class="forgot"> Mot de passe oublié ?</p>
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user