Compare commits

..

No commits in common. "fc8387808fb763a79eddafa0d79113fe2330b406" and "a14a4ba64eae13d342483edf190ded99070bf88a" have entirely different histories.

15 changed files with 18 additions and 59 deletions

View File

@ -3,6 +3,7 @@
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="App\Tests\" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/cache" />

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,5 @@
/**
<<<<<<< HEAD
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
=======
* Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0.
>>>>>>> b29391d6550c182d7b75efab8795a238c1936a27
* Original file: /npm/@hotwired/turbo@7.3.0/dist/turbo.es2017-esm.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files

View File

@ -35,7 +35,6 @@
"symfony/property-info": "7.1.*",
"symfony/runtime": "7.1.*",
"symfony/security-bundle": "7.1.*",
"symfony/security-csrf": "7.1.*",
"symfony/serializer": "7.1.*",
"symfony/stimulus-bundle": "^2.20",
"symfony/string": "7.1.*",

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "69565ad2398a468ae94c92c449ee3c20",
"content-hash": "e99a99b4ca2d6b58821cb711cb543c93",
"packages": [
{
"name": "composer/semver",

View File

@ -14,14 +14,14 @@ security:
lazy: true
provider: app_user_provider
form_login:
login_path: app_login
check_path: app_login
login_path: _login
check_path: _login
success_handler: App\Security\CustomAuthenticationSuccessHandler
enable_csrf: true
csrf_token_id: authenticate
logout:
path: app_logout
target: app_login
path: _logout
target: _login
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall

View File

@ -9,7 +9,7 @@ use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class AuthenticationController extends AbstractController
{
#[Route(path: '/', name: 'app_login')]
#[Route(path: '/', name: '_login')]
public function login(AuthenticationUtils $authenticationUtils): Response
{
// get the login error if there is one
@ -24,7 +24,7 @@ class AuthenticationController extends AbstractController
]);
}
#[Route(path: '/logout', name: 'app_logout')]
#[Route(path: '/logout', name: '_logout')]
public function logout(): void
{
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');

View File

@ -6,10 +6,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/calendrier')]
class CalendrierController extends AbstractController
{
#[Route(name: 'app_calendrier_index', methods: ['GET'])]
#[Route('/calendrier', name: 'app_calendrier')]
public function index(): Response
{
return $this->render('calendrier/index.html.twig', [

View File

@ -9,7 +9,6 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Routing\Attribute\Route;
#[Route('/user')]
@ -24,18 +23,13 @@ final class UserController extends AbstractController
}
#[Route('/new', name: 'app_user_new', methods: ['GET', 'POST'])]
public function new(Request $request, EntityManagerInterface $entityManager, UserPasswordHasherInterface $passwordHasher): Response
public function new(Request $request, EntityManagerInterface $entityManager): Response
{
$user = new Utilisateur();
$form = $this->createForm(UserType::class, $user);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
// Hash du mot de passe
$plainPassword = $form->get('plainPassword')->getData();
$hashedPassword = $passwordHasher->hashPassword($user, $plainPassword);
$user->setPassword($hashedPassword);
$entityManager->persist($user);
$entityManager->flush();

View File

@ -17,7 +17,7 @@ final class VehicleController extends AbstractController
#[Route(name: 'app_vehicle_index', methods: ['GET'])]
public function index(VehicleRepository $vehicleRepository): Response
{
return $this->render('vehicle/index.html.twig', [
return $this->render('vehicle/admin.html.twig', [
'vehicles' => $vehicleRepository->findAll(),
]);
}

View File

@ -31,19 +31,6 @@ class Utilisateur implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(length: 255)]
private ?string $Phone = null;
private ?string $plainPassword = null;
public function getPlainPassword(): ?string
{
return $this->plainPassword;
}
public function setPlainPassword(?string $plainPassword): void
{
$this->plainPassword = $plainPassword;
}
/**
* @var list<string> The user roles
*/
@ -192,6 +179,6 @@ class Utilisateur implements UserInterface, PasswordAuthenticatedUserInterface
public function eraseCredentials(): void
{
// If you store any temporary, sensitive data on the user, clear it here
$this->plainPassword = null;
// $this->plainPassword = null;
}
}

View File

@ -6,7 +6,6 @@ use App\Entity\Utilisateur;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@ -24,17 +23,10 @@ class UserType extends AbstractType
])
->add('Phone', TextType::class)
->add('roles', ChoiceType::class, [
'choices' => [
'Secretaire' => 'ROLE_SECRETAIRE',
'Chauffagiste' => 'ROLE_CHAUFFAGISTE',
],
'multiple' => true,
])
->add('plainPassword', PasswordType::class, [
'mapped' => false,
'required' => true,
'label' => 'Mot de passe',
]);
->add('password', TextType::class)
;
}
public function configureOptions(OptionsResolver $resolver): void

View File

@ -15,7 +15,6 @@ class VehicleType extends AbstractType
$builder
->add('LicensePlate', TextType::class)
->add('Brand', TextType::class)
->add('Model', TextType::class)
;
}

View File

@ -19,8 +19,8 @@
<ul>
{% if is_granted('ROLE_ADMIN') %}
<li><a href="{{ path('admin_dashboard') }}">Dashboard Admin</a></li>
<li><a href="{{ path('app_user_index') }}">Gérer un utilisateur</a></li>
<li><a href="{{ path('app_calendrier_index') }}">Tous les plannings</a></li>
<li><a href="{{ path('app_user_new') }}">Gérer un utilisateur</a></li>
<li><a href="{{ path('app_calendrier') }}">Tous les plannings</a></li>
<li><a href="{{ path('app_stock_index') }}">Gérer les stocks</a></li>
<li><a href="{{ path('app_vehicle_index') }}">Gérer les véhicules</a></li>
{% endif %}
@ -40,7 +40,7 @@
<li><a href="{{ path('stock_index') }}">Pièces détachées</a></li>
{% endif %}
<li><a href="{{ path('app_logout') }}">Déconnexion</a></li>
<li><a href="{{ path('_logout') }}">Déconnexion</a></li>
</ul>
</nav>
{% endif %}

View File

@ -25,7 +25,7 @@
<img class="logoProfile" src="{{ asset('styles/image/profile.png') }}" alt="Logo Profil">
<img class="logoPassword" src="{{ asset('styles/image/password.png') }}" alt="Logo Password">
<form method="post" action="{{ path('app_login') }}">
<form method="post" action="{{ path('_login') }}">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}