modification du form user pour afficher les rôle lors du new

This commit is contained in:
sermandm 2025-04-18 11:49:14 +02:00
commit 56809b3fbc
10 changed files with 28 additions and 11 deletions

4
.idea/dataSources.xml generated
View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="hegreetconfort@localhost" uuid="21423ae4-3232-4641-affb-06399f70655a">
<data-source source="LOCAL" name="HegreEtConfort@localhost" uuid="21423ae4-3232-4641-affb-06399f70655a">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://localhost:5432/hegreetconfort</jdbc-url>
<jdbc-url>jdbc:postgresql://localhost:5433/HegreEtConfort</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,9 @@
/**
<<<<<<< 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,6 +35,7 @@
"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": "e99a99b4ca2d6b58821cb711cb543c93",
"content-hash": "69565ad2398a468ae94c92c449ee3c20",
"packages": [
{
"name": "composer/semver",

View File

@ -14,14 +14,14 @@ security:
lazy: true
provider: app_user_provider
form_login:
login_path: _login
check_path: _login
login_path: app_login
check_path: app_login
success_handler: App\Security\CustomAuthenticationSuccessHandler
enable_csrf: true
csrf_token_id: authenticate
logout:
path: _logout
target: _login
path: app_logout
target: app_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: '_login')]
#[Route(path: '/', name: 'app_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: '_logout')]
#[Route(path: '/logout', name: 'app_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

@ -23,6 +23,10 @@ class UserType extends AbstractType
])
->add('Phone', TextType::class)
->add('roles', ChoiceType::class, [
'choices' => [
'Secretaire' => 'ROLE_SECRETAIRE',
'Chauffagiste' => 'ROLE_CHAUFFAGISTE',
],
'multiple' => true,
])
->add('password', TextType::class)

View File

@ -40,7 +40,7 @@
<li><a href="{{ path('stock_index') }}">Pièces détachées</a></li>
{% endif %}
<li><a href="{{ path('_logout') }}">Déconnexion</a></li>
<li><a href="{{ path('app_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('_login') }}">
<form method="post" action="{{ path('app_login') }}">
{% if error %}
<div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}