Compare commits
44 Commits
docs/maj_d
...
feat/login
| Author | SHA1 | Date | |
|---|---|---|---|
| 7751d78b98 | |||
| 47d9fe93e5 | |||
| bf3439587e | |||
| d2ffdcbc0d | |||
| 4f7dc49f13 | |||
| 1bb651b7e4 | |||
|
|
6f9523f9e7 | ||
| 7400d0d418 | |||
| 7a25779c9c | |||
| b57236c4e7 | |||
| f3822a60aa | |||
| d46b61a0ad | |||
| ebd680b4a0 | |||
| 7e6e10381f | |||
|
|
3821006ef3 | ||
|
|
e7e6d7c1af | ||
| 23789ab33e | |||
| 1cb1fc925b | |||
| 0e5351b7f4 | |||
| ba84b49134 | |||
| 1b5fd98527 | |||
| 36cd7923c1 | |||
| c0829d30d0 | |||
| 458f4b5d91 | |||
| 627f5b6954 | |||
| ff6399436c | |||
| d81e450a0e | |||
| 3dcba06f20 | |||
| f72c99f56a | |||
| 0fa1c418f8 | |||
| 74f795ba25 | |||
| ab90664b0a | |||
|
|
81a30ebea6 | ||
| 8450372a97 | |||
| 0b3e9bebb9 | |||
| ef7f038ab8 | |||
| f87ed32f6f | |||
| 38b1293a27 | |||
| 63398086b7 | |||
| 1454b9bfc8 | |||
|
|
e299eb59ad | ||
| b6b82e1631 | |||
|
|
a8bcc7ae43 | ||
| f2365c08e9 |
17
.editorconfig
Normal file
17
.editorconfig
Normal file
@@ -0,0 +1,17 @@
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{compose.yaml,compose.*.yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
16
.env
16
.env
@@ -1,9 +1,11 @@
|
||||
APP_ENV=dev
|
||||
APP_ENV=
|
||||
APP_SECRET=
|
||||
APP_SHARE_DIR=var/share
|
||||
APP_VERSION=0.0.1
|
||||
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
|
||||
MAILER_DSN="smtp://localhost:1025"
|
||||
DEFAULT_URI="http://localhost:8000"
|
||||
APP_SHARE_DIR=
|
||||
APP_VERSION=
|
||||
DATABASE_URL=
|
||||
MESSENGER_TRANSPORT_DSN=
|
||||
MAILER_DSN=
|
||||
DEFAULT_URI=
|
||||
KAZ_API_BASE_URL=
|
||||
KAZ_API_USER=
|
||||
KAZ_API_PASSWORD=
|
||||
KAZ_API_PASSWORD=
|
||||
|
||||
3
.env.test
Normal file
3
.env.test
Normal file
@@ -0,0 +1,3 @@
|
||||
# define your env variables for the test env here
|
||||
KERNEL_CLASS='App\Kernel'
|
||||
APP_SECRET='$ecretf0rt3st'
|
||||
27
.gitignore
vendored
27
.gitignore
vendored
@@ -26,3 +26,30 @@ phpunit.xml
|
||||
### OS / Misc ###
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
###> symfony/webpack-encore-bundle ###
|
||||
/node_modules/
|
||||
/public/build/
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
###< symfony/webpack-encore-bundle ###
|
||||
|
||||
###> symfony/asset-mapper ###
|
||||
/public/assets/
|
||||
/assets/vendor/
|
||||
###< symfony/asset-mapper ###
|
||||
|
||||
###> symfony/framework-bundle ###
|
||||
/.env.local
|
||||
/.env.local.php
|
||||
/.env.*.local
|
||||
/config/secrets/prod/prod.decrypt.private.php
|
||||
/public/bundles/
|
||||
/var/
|
||||
/vendor/
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> phpunit/phpunit ###
|
||||
/phpunit.xml
|
||||
/.phpunit.cache/
|
||||
###< phpunit/phpunit ###
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
# Plateforme web pour les adhérents KAZ
|
||||
|
||||
## Objectif
|
||||
@@ -11,6 +10,7 @@ Cette application web permet aux adhérents de l'association KAZ de gérer leur
|
||||
|
||||
## Architecture technique
|
||||
- **Frontend** : [Twig](https://twig.symfony.com/) + [Tailwind CSS](https://tailwindcss.com/)
|
||||
- **Documentation installation Tailwind** : [Plus d'infos ici](https://tailwindcss.com/docs/installation/framework-guides/symfony)
|
||||
- **Backend** : PHP 8.4 / [Symfony](https://symfony.com/)
|
||||
- **Base de données** : [PostgreSQL](https://www.postgresql.org/)
|
||||
- **Intégration** : Communication via API avec les outils de KAZ (notamment OpenLDAP).
|
||||
|
||||
@@ -2,9 +2,9 @@ import './stimulus_bootstrap.js';
|
||||
/*
|
||||
* Welcome to your app's main JavaScript file!
|
||||
*
|
||||
* This file will be included onto the page via the importmap() Twig function,
|
||||
* which should already be in your base.html.twig.
|
||||
* We recommend including the built version of this JavaScript file
|
||||
* (and its CSS file) in your base layout (base.html.twig).
|
||||
*/
|
||||
import './styles/app.css';
|
||||
|
||||
console.log('This log comes from assets/app.js - welcome to AssetMapper! 🎉');
|
||||
// any CSS you import will output into a single css file (app.css in this case)
|
||||
import './styles/app.css';
|
||||
|
||||
81
assets/controllers/csrf_protection_controller.js
Normal file
81
assets/controllers/csrf_protection_controller.js
Normal file
@@ -0,0 +1,81 @@
|
||||
const nameCheck = /^[-_a-zA-Z0-9]{4,22}$/;
|
||||
const tokenCheck = /^[-_/+a-zA-Z0-9]{24,}$/;
|
||||
|
||||
// Generate and double-submit a CSRF token in a form field and a cookie, as defined by Symfony's SameOriginCsrfTokenManager
|
||||
// Use `form.requestSubmit()` to ensure that the submit event is triggered. Using `form.submit()` will not trigger the event
|
||||
// and thus this event-listener will not be executed.
|
||||
document.addEventListener('submit', function (event) {
|
||||
generateCsrfToken(event.target);
|
||||
}, true);
|
||||
|
||||
// When @hotwired/turbo handles form submissions, send the CSRF token in a header in addition to a cookie
|
||||
// The `framework.csrf_protection.check_header` config option needs to be enabled for the header to be checked
|
||||
document.addEventListener('turbo:submit-start', function (event) {
|
||||
const h = generateCsrfHeaders(event.detail.formSubmission.formElement);
|
||||
Object.keys(h).map(function (k) {
|
||||
event.detail.formSubmission.fetchRequest.headers[k] = h[k];
|
||||
});
|
||||
});
|
||||
|
||||
// When @hotwired/turbo handles form submissions, remove the CSRF cookie once a form has been submitted
|
||||
document.addEventListener('turbo:submit-end', function (event) {
|
||||
removeCsrfToken(event.detail.formSubmission.formElement);
|
||||
});
|
||||
|
||||
export function generateCsrfToken (formElement) {
|
||||
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
|
||||
|
||||
if (!csrfField) {
|
||||
return;
|
||||
}
|
||||
|
||||
let csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
|
||||
let csrfToken = csrfField.value;
|
||||
|
||||
if (!csrfCookie && nameCheck.test(csrfToken)) {
|
||||
csrfField.setAttribute('data-csrf-protection-cookie-value', csrfCookie = csrfToken);
|
||||
csrfField.defaultValue = csrfToken = btoa(String.fromCharCode.apply(null, (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(18))));
|
||||
}
|
||||
csrfField.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
|
||||
if (csrfCookie && tokenCheck.test(csrfToken)) {
|
||||
const cookie = csrfCookie + '_' + csrfToken + '=' + csrfCookie + '; path=/; samesite=strict';
|
||||
document.cookie = window.location.protocol === 'https:' ? '__Host-' + cookie + '; secure' : cookie;
|
||||
}
|
||||
}
|
||||
|
||||
export function generateCsrfHeaders (formElement) {
|
||||
const headers = {};
|
||||
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
|
||||
|
||||
if (!csrfField) {
|
||||
return headers;
|
||||
}
|
||||
|
||||
const csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
|
||||
|
||||
if (tokenCheck.test(csrfField.value) && nameCheck.test(csrfCookie)) {
|
||||
headers[csrfCookie] = csrfField.value;
|
||||
}
|
||||
|
||||
return headers;
|
||||
}
|
||||
|
||||
export function removeCsrfToken (formElement) {
|
||||
const csrfField = formElement.querySelector('input[data-controller="csrf-protection"], input[name="_csrf_token"]');
|
||||
|
||||
if (!csrfField) {
|
||||
return;
|
||||
}
|
||||
|
||||
const csrfCookie = csrfField.getAttribute('data-csrf-protection-cookie-value');
|
||||
|
||||
if (tokenCheck.test(csrfField.value) && nameCheck.test(csrfCookie)) {
|
||||
const cookie = csrfCookie + '_' + csrfField.value + '=0; path=/; samesite=strict; max-age=0';
|
||||
|
||||
document.cookie = window.location.protocol === 'https:' ? '__Host-' + cookie + '; secure' : cookie;
|
||||
}
|
||||
}
|
||||
|
||||
/* stimulusFetch: 'lazy' */
|
||||
export default 'csrf-protection-controller';
|
||||
16
assets/controllers/hello_controller.js
Normal file
16
assets/controllers/hello_controller.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
/*
|
||||
* This is an example Stimulus controller!
|
||||
*
|
||||
* Any element with a data-controller="hello" attribute will cause
|
||||
* this controller to be executed. The name "hello" comes from the filename:
|
||||
* hello_controller.js -> "hello"
|
||||
*
|
||||
* Delete this file or adapt it for your use!
|
||||
*/
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,13 @@
|
||||
import { startStimulusApp } from '@symfony/stimulus-bundle';
|
||||
|
||||
startStimulusApp();
|
||||
const app = startStimulusApp();
|
||||
import { startStimulusApp } from '@symfony/stimulus-bridge';
|
||||
|
||||
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
|
||||
export const app = startStimulusApp(require.context(
|
||||
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
|
||||
true,
|
||||
/\.[jt]sx?$/
|
||||
));
|
||||
// register any custom, 3rd party controllers here
|
||||
// app.register('some_controller_name', SomeImportedController);
|
||||
|
||||
@@ -1,3 +1,35 @@
|
||||
body {
|
||||
background-color: skyblue;
|
||||
@import "tailwindcss";
|
||||
|
||||
/* Chargement des polices d'écriture */
|
||||
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@100..800&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400..700&family=Sora:wght@100..800&display=swap');
|
||||
|
||||
/* Configuration charte graphique */
|
||||
@theme {
|
||||
/* --- Couleurs de l'association --- */
|
||||
--color-bouton: #4DD5C8;
|
||||
--color-bouton-hover: #6CE0D6;
|
||||
--color-title: #E6A638;
|
||||
--color-text: #000000;
|
||||
--color-bg-primaire: #F9FCF7;
|
||||
--color-bg-secondaire: #23978B;
|
||||
|
||||
/* --- Couleurs liées à des actions --- */
|
||||
--color-danger: #EF4444;
|
||||
--color-danger-hover: #DC2626;
|
||||
|
||||
--color-success: #A7F3D0;
|
||||
--color-success-text: #065F46;
|
||||
|
||||
--color-info: #BFDBFE;
|
||||
--color-info-hover: #93C5FD;
|
||||
|
||||
/* --- Couleurs en plus --- */
|
||||
--color-gris-clair: #E5E7EB;
|
||||
--color-gris-moyen: #9CA3AF;
|
||||
--color-gris-fonce: #4B5563;
|
||||
|
||||
/* Polices */
|
||||
--font-sora: "Sora", sans-serif;
|
||||
--font-caveat: "Caveat", cursive;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ services:
|
||||
database:
|
||||
image: postgres:${POSTGRES_VERSION:-16}-alpine
|
||||
ports:
|
||||
- "5432"
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-app}
|
||||
# You should definitely change the password in production
|
||||
@@ -25,6 +25,5 @@ services:
|
||||
environment:
|
||||
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
||||
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
||||
|
||||
volumes:
|
||||
database_data:
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
"doctrine/doctrine-bundle": "^3.2",
|
||||
"doctrine/doctrine-migrations-bundle": "^4.0",
|
||||
"doctrine/orm": "^3.6",
|
||||
"fakerphp/faker": "^1.24",
|
||||
"phpdocumentor/reflection-docblock": "^5.6",
|
||||
"phpstan/phpdoc-parser": "^2.3",
|
||||
"symfony/asset": "8.0.*",
|
||||
"symfony/asset-mapper": "8.0.*",
|
||||
"symfony/console": "8.0.*",
|
||||
"symfony/doctrine-messenger": "8.0.*",
|
||||
"symfony/dotenv": "8.0.*",
|
||||
@@ -37,10 +37,12 @@
|
||||
"symfony/string": "8.0.*",
|
||||
"symfony/translation": "8.0.*",
|
||||
"symfony/twig-bundle": "8.0.*",
|
||||
"symfony/uid": "8.0.*",
|
||||
"symfony/ux-turbo": "^2.32",
|
||||
"symfony/validator": "8.0.*",
|
||||
"symfony/web-link": "8.0.*",
|
||||
"symfony/yaml": "8.0.*",
|
||||
"symfonycasts/tailwind-bundle": "^0.12.0",
|
||||
"twig/extra-bundle": "^2.12|^3.0",
|
||||
"twig/twig": "^2.12|^3.0"
|
||||
},
|
||||
@@ -98,6 +100,7 @@
|
||||
}
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/doctrine-fixtures-bundle": "^4.3",
|
||||
"phpunit/phpunit": "^13.0",
|
||||
"symfony/browser-kit": "8.0.*",
|
||||
"symfony/css-selector": "8.0.*",
|
||||
|
||||
501
composer.lock
generated
501
composer.lock
generated
@@ -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": "b80e1957a1c5f59c7aa332a9535d541a",
|
||||
"content-hash": "bc53a345dda69084bc7dbf18b03f3d9d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/semver",
|
||||
@@ -1263,6 +1263,69 @@
|
||||
],
|
||||
"time": "2025-03-06T22:45:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fakerphp/faker",
|
||||
"version": "v1.24.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/FakerPHP/Faker.git",
|
||||
"reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5",
|
||||
"reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0",
|
||||
"psr/container": "^1.0 || ^2.0",
|
||||
"symfony/deprecation-contracts": "^2.2 || ^3.0"
|
||||
},
|
||||
"conflict": {
|
||||
"fzaninotto/faker": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.4.1",
|
||||
"doctrine/persistence": "^1.3 || ^2.0",
|
||||
"ext-intl": "*",
|
||||
"phpunit/phpunit": "^9.5.26",
|
||||
"symfony/phpunit-bridge": "^5.4.16"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/orm": "Required to use Faker\\ORM\\Doctrine",
|
||||
"ext-curl": "Required by Faker\\Provider\\Image to download images.",
|
||||
"ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.",
|
||||
"ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.",
|
||||
"ext-mbstring": "Required for multibyte Unicode string functionality."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Faker\\": "src/Faker/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "François Zaninotto"
|
||||
}
|
||||
],
|
||||
"description": "Faker is a PHP library that generates fake data for you.",
|
||||
"keywords": [
|
||||
"data",
|
||||
"faker",
|
||||
"fixtures"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/FakerPHP/Faker/issues",
|
||||
"source": "https://github.com/FakerPHP/Faker/tree/v1.24.1"
|
||||
},
|
||||
"time": "2024-11-21T13:46:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "3.10.0",
|
||||
@@ -1966,16 +2029,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/asset-mapper",
|
||||
"version": "v8.0.4",
|
||||
"version": "v8.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/asset-mapper.git",
|
||||
"reference": "14184221c21c2622e62f2c009a6cc25c5570e4ba"
|
||||
"reference": "80635c3722b9bb5481e0282497ae23796dcd3712"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/asset-mapper/zipball/14184221c21c2622e62f2c009a6cc25c5570e4ba",
|
||||
"reference": "14184221c21c2622e62f2c009a6cc25c5570e4ba",
|
||||
"url": "https://api.github.com/repos/symfony/asset-mapper/zipball/80635c3722b9bb5481e0282497ae23796dcd3712",
|
||||
"reference": "80635c3722b9bb5481e0282497ae23796dcd3712",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2023,7 +2086,7 @@
|
||||
"description": "Maps directories of assets & makes them available in a public directory with versioned filenames.",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/asset-mapper/tree/v8.0.4"
|
||||
"source": "https://github.com/symfony/asset-mapper/tree/v8.0.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2043,7 +2106,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-13T13:06:50+00:00"
|
||||
"time": "2026-02-17T13:07:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/cache",
|
||||
@@ -3388,16 +3451,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/form",
|
||||
"version": "v8.0.4",
|
||||
"version": "v8.0.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/form.git",
|
||||
"reference": "c34ec2c2648e2dfedab3ce7e3c6c86f8d89c3092"
|
||||
"reference": "954e17b053dad9fb227ebd90260752e3a46bb06a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/form/zipball/c34ec2c2648e2dfedab3ce7e3c6c86f8d89c3092",
|
||||
"reference": "c34ec2c2648e2dfedab3ce7e3c6c86f8d89c3092",
|
||||
"url": "https://api.github.com/repos/symfony/form/zipball/954e17b053dad9fb227ebd90260752e3a46bb06a",
|
||||
"reference": "954e17b053dad9fb227ebd90260752e3a46bb06a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3459,7 +3522,7 @@
|
||||
"description": "Allows to easily create, process and reuse HTML forms",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/form/tree/v8.0.4"
|
||||
"source": "https://github.com/symfony/form/tree/v8.0.7"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -3479,7 +3542,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-23T11:07:10+00:00"
|
||||
"time": "2026-03-06T13:17:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/framework-bundle",
|
||||
@@ -3623,16 +3686,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-client",
|
||||
"version": "v8.0.5",
|
||||
"version": "v8.0.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-client.git",
|
||||
"reference": "f9fdd372473e66469c6d32a4ed12efcffdea38c4"
|
||||
"reference": "356e43d6994ae9d7761fd404d40f78691deabe0e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-client/zipball/f9fdd372473e66469c6d32a4ed12efcffdea38c4",
|
||||
"reference": "f9fdd372473e66469c6d32a4ed12efcffdea38c4",
|
||||
"url": "https://api.github.com/repos/symfony/http-client/zipball/356e43d6994ae9d7761fd404d40f78691deabe0e",
|
||||
"reference": "356e43d6994ae9d7761fd404d40f78691deabe0e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3695,7 +3758,7 @@
|
||||
"http"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/http-client/tree/v8.0.5"
|
||||
"source": "https://github.com/symfony/http-client/tree/v8.0.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -3715,7 +3778,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-27T16:18:07+00:00"
|
||||
"time": "2026-03-30T15:14:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-client-contracts",
|
||||
@@ -5213,6 +5276,89 @@
|
||||
],
|
||||
"time": "2025-06-23T16:12:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-uuid",
|
||||
"version": "v1.33.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-uuid.git",
|
||||
"reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/21533be36c24be3f4b1669c4725c7d1d2bab4ae2",
|
||||
"reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-uuid": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-uuid": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/polyfill",
|
||||
"name": "symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Uuid\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Grégoire Pineau",
|
||||
"email": "lyrixx@lyrixx.info"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for uuid functions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"uuid"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-uuid/tree/v1.33.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/nicolas-grekas",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v8.0.5",
|
||||
@@ -5610,16 +5756,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/security-bundle",
|
||||
"version": "v8.0.4",
|
||||
"version": "v8.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/security-bundle.git",
|
||||
"reference": "c170650a00ba724be3455852747af600a2f042b4"
|
||||
"reference": "73ba33c215a5e4516c7045c26f6fec71e4ab5727"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/security-bundle/zipball/c170650a00ba724be3455852747af600a2f042b4",
|
||||
"reference": "c170650a00ba724be3455852747af600a2f042b4",
|
||||
"url": "https://api.github.com/repos/symfony/security-bundle/zipball/73ba33c215a5e4516c7045c26f6fec71e4ab5727",
|
||||
"reference": "73ba33c215a5e4516c7045c26f6fec71e4ab5727",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5686,7 +5832,7 @@
|
||||
"description": "Provides a tight integration of the Security component into the Symfony full-stack framework",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/security-bundle/tree/v8.0.4"
|
||||
"source": "https://github.com/symfony/security-bundle/tree/v8.0.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -5706,7 +5852,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-10T13:58:55+00:00"
|
||||
"time": "2026-02-22T22:01:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/security-core",
|
||||
@@ -6808,6 +6954,84 @@
|
||||
],
|
||||
"time": "2026-01-09T12:15:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/uid",
|
||||
"version": "v8.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/uid.git",
|
||||
"reference": "8b81bd3700f5c1913c22a3266a647aa1bb974435"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/uid/zipball/8b81bd3700f5c1913c22a3266a647aa1bb974435",
|
||||
"reference": "8b81bd3700f5c1913c22a3266a647aa1bb974435",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.4",
|
||||
"symfony/polyfill-uuid": "^1.15"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/console": "^7.4|^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Uid\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Grégoire Pineau",
|
||||
"email": "lyrixx@lyrixx.info"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Provides an object-oriented API to generate and represent UIDs",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"UID",
|
||||
"ulid",
|
||||
"uuid"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/uid/tree/v8.0.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/nicolas-grekas",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-03T23:40:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/ux-turbo",
|
||||
"version": "v2.32.0",
|
||||
@@ -7331,6 +7555,62 @@
|
||||
],
|
||||
"time": "2025-12-04T18:17:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfonycasts/tailwind-bundle",
|
||||
"version": "v0.12.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/SymfonyCasts/tailwind-bundle.git",
|
||||
"reference": "17c85e25d3ceb54b8599e8ca4c5b67c485f2a48a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/SymfonyCasts/tailwind-bundle/zipball/17c85e25d3ceb54b8599e8ca4c5b67c485f2a48a",
|
||||
"reference": "17c85e25d3ceb54b8599e8ca4c5b67c485f2a48a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"symfony/asset-mapper": "^6.3|^7.0|^8.0",
|
||||
"symfony/cache": "^6.3|^7.0|^8.0",
|
||||
"symfony/console": "^5.4|^6.3|^7.0|^8.0",
|
||||
"symfony/deprecation-contracts": "^2.2|^3.0",
|
||||
"symfony/http-client": "^5.4|^6.3|^7.0|^8.0",
|
||||
"symfony/process": "^5.4|^6.3|^7.0|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.6",
|
||||
"symfony/filesystem": "^6.3|^7.0|^8.0",
|
||||
"symfony/framework-bundle": "^6.3|^7.0|^8.0",
|
||||
"symfony/phpunit-bridge": "^6.3.9|^7.0|^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfonycasts\\TailwindBundle\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ryan Weaver",
|
||||
"homepage": "https://symfonycasts.com"
|
||||
}
|
||||
],
|
||||
"description": "Delightful Tailwind Support for Symfony + AssetMapper",
|
||||
"keywords": [
|
||||
"asset-mapper",
|
||||
"tailwind"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/SymfonyCasts/tailwind-bundle/issues",
|
||||
"source": "https://github.com/SymfonyCasts/tailwind-bundle/tree/v0.12.0"
|
||||
},
|
||||
"time": "2025-11-24T10:14:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twig/extra-bundle",
|
||||
"version": "v3.23.0",
|
||||
@@ -7548,6 +7828,175 @@
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "doctrine/data-fixtures",
|
||||
"version": "2.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/data-fixtures.git",
|
||||
"reference": "7a615ba135e45d67674bb623d90f34f6c7b6bd97"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/data-fixtures/zipball/7a615ba135e45d67674bb623d90f34f6c7b6bd97",
|
||||
"reference": "7a615ba135e45d67674bb623d90f34f6c7b6bd97",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/persistence": "^3.1 || ^4.0",
|
||||
"php": "^8.1",
|
||||
"psr/log": "^1.1 || ^2 || ^3"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/dbal": "<3.5 || >=5",
|
||||
"doctrine/orm": "<2.14 || >=4",
|
||||
"doctrine/phpcr-odm": "<1.3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "^14",
|
||||
"doctrine/dbal": "^3.5 || ^4",
|
||||
"doctrine/mongodb-odm": "^1.3.0 || ^2.0.0",
|
||||
"doctrine/orm": "^2.14 || ^3",
|
||||
"ext-sqlite3": "*",
|
||||
"fig/log-test": "^1",
|
||||
"phpstan/phpstan": "2.1.31",
|
||||
"phpunit/phpunit": "10.5.45 || 12.4.0",
|
||||
"symfony/cache": "^6.4 || ^7",
|
||||
"symfony/var-exporter": "^6.4 || ^7"
|
||||
},
|
||||
"suggest": {
|
||||
"alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)",
|
||||
"doctrine/mongodb-odm": "For loading MongoDB ODM fixtures",
|
||||
"doctrine/orm": "For loading ORM fixtures",
|
||||
"doctrine/phpcr-odm": "For loading PHPCR ODM fixtures"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\DataFixtures\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jonathan Wage",
|
||||
"email": "jonwage@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Data Fixtures for all Doctrine Object Managers",
|
||||
"homepage": "https://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"database"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/data-fixtures/issues",
|
||||
"source": "https://github.com/doctrine/data-fixtures/tree/2.2.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://www.doctrine-project.org/sponsorship.html",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/phpdoctrine",
|
||||
"type": "patreon"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdata-fixtures",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-10-17T20:06:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/doctrine-fixtures-bundle",
|
||||
"version": "4.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/DoctrineFixturesBundle.git",
|
||||
"reference": "9e013ed10d49bf7746b07204d336384a7d9b5a4d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/DoctrineFixturesBundle/zipball/9e013ed10d49bf7746b07204d336384a7d9b5a4d",
|
||||
"reference": "9e013ed10d49bf7746b07204d336384a7d9b5a4d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"doctrine/data-fixtures": "^2.2",
|
||||
"doctrine/doctrine-bundle": "^2.2 || ^3.0",
|
||||
"doctrine/orm": "^2.14.0 || ^3.0",
|
||||
"doctrine/persistence": "^2.4 || ^3.0 || ^4.0",
|
||||
"php": "^8.1",
|
||||
"psr/log": "^2 || ^3",
|
||||
"symfony/config": "^6.4 || ^7.0 || ^8.0",
|
||||
"symfony/console": "^6.4 || ^7.0 || ^8.0",
|
||||
"symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0",
|
||||
"symfony/deprecation-contracts": "^2.1 || ^3",
|
||||
"symfony/doctrine-bridge": "^6.4.16 || ^7.1.9 || ^8.0",
|
||||
"symfony/http-kernel": "^6.4 || ^7.0 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"doctrine/dbal": "< 3"
|
||||
},
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "14.0.0",
|
||||
"phpstan/phpstan": "2.1.11",
|
||||
"phpunit/phpunit": "^10.5.38 || 11.4.14"
|
||||
},
|
||||
"type": "symfony-bundle",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Doctrine\\Bundle\\FixturesBundle\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Doctrine Project",
|
||||
"homepage": "https://www.doctrine-project.org"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony DoctrineFixturesBundle",
|
||||
"homepage": "https://www.doctrine-project.org",
|
||||
"keywords": [
|
||||
"Fixture",
|
||||
"persistence"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/doctrine/DoctrineFixturesBundle/issues",
|
||||
"source": "https://github.com/doctrine/DoctrineFixturesBundle/tree/4.3.1"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://www.doctrine-project.org/sponsorship.html",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/phpdoctrine",
|
||||
"type": "patreon"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdoctrine-fixtures-bundle",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-12-03T16:05:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.13.4",
|
||||
@@ -9824,5 +10273,5 @@
|
||||
"ext-iconv": "*"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.9.0"
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
|
||||
@@ -7,10 +7,12 @@ return [
|
||||
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
|
||||
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
|
||||
Symfony\UX\Turbo\TurboBundle::class => ['all' => true],
|
||||
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
|
||||
Symfony\UX\Turbo\TurboBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfonycasts\TailwindBundle\SymfonycastsTailwindBundle::class => ['all' => true],
|
||||
];
|
||||
|
||||
@@ -1,20 +1,57 @@
|
||||
security:
|
||||
# Hierarchie des rôles #
|
||||
role_hierarchy:
|
||||
ROLE_ORGANISATION: ROLE_USER
|
||||
ROLE_ADMIN_ORGANISATION: ROLE_ORGANISATION
|
||||
ROLE_ADMIN: ROLE_ADMIN
|
||||
|
||||
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
|
||||
# Comment sont hachés nos mots de passe
|
||||
password_hashers:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
|
||||
# https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider
|
||||
# d'où viennent nos utilisateurs ?
|
||||
providers:
|
||||
users_in_memory: { memory: null }
|
||||
# used to reload user from session & other features (e.g. switch_user)
|
||||
app_user_provider: # un nom unique
|
||||
entity: # nos utilisateurs sont en base de données
|
||||
class: App\Entity\User # c'est cette entité-là
|
||||
property: email # représentée par cette propriété-ci
|
||||
|
||||
# activation du système de sécurité
|
||||
firewalls:
|
||||
# permet de désactiver sur la debug bar, le profiler, etc...
|
||||
dev:
|
||||
# Ensure dev tools and static assets are always allowed
|
||||
pattern: ^/(_profiler|_wdt|assets|build)/
|
||||
security: false
|
||||
# notre pare-feu principal, activé partout par défaut
|
||||
main:
|
||||
lazy: true
|
||||
provider: users_in_memory
|
||||
provider: app_user_provider
|
||||
# Le formulaire de connexion sera automatiquement protégé des attaques CSRF.
|
||||
# La classe FormLoginAuthenticator est automatiquement utilisée en interne par Symfony,
|
||||
# il n'y a plus de classe de type Authenticator à gérer soi-même.
|
||||
form_login:
|
||||
login_path: app_login
|
||||
check_path: app_login
|
||||
enable_csrf: true
|
||||
username_parameter: _username
|
||||
password_parameter: _password
|
||||
default_target_path: app_home
|
||||
logout:
|
||||
path: app_logout
|
||||
# où rediriger après la déconnexion
|
||||
target: app_login
|
||||
|
||||
remember_me:
|
||||
secret: '%kernel.secret%'
|
||||
lifetime: 604800
|
||||
path: /
|
||||
# par défaut, le "souvenir de moi" n'est pas coché, l'utilisateur doit cliquer sur la check-box
|
||||
# si on veut "souvenir de moi" activité en permanence, il faut décommenter cette ligne :
|
||||
#always_remember_me: true
|
||||
|
||||
# Activate different ways to authenticate:
|
||||
# https://symfony.com/doc/current/security.html#the-firewall
|
||||
@@ -23,9 +60,11 @@ security:
|
||||
# switch_user: true
|
||||
|
||||
# Note: Only the *first* matching rule is applied
|
||||
# autorisations
|
||||
access_control:
|
||||
# - { path: ^/admin, roles: ROLE_ADMIN }
|
||||
# - { path: ^/profile, roles: ROLE_USER }
|
||||
- { path: ^/admin, roles: ROLE_ADMIN }
|
||||
- { path: ^/organisation, roles: ROLE_ADMIN_ORGANISATION }
|
||||
- { path: ^/user, roles: ROLE_USER }
|
||||
|
||||
when@test:
|
||||
security:
|
||||
|
||||
6
config/packages/symfonycasts_tailwind.yaml
Normal file
6
config/packages/symfonycasts_tailwind.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
symfonycasts_tailwind:
|
||||
# Specify the EXACT version of Tailwind CSS you want to use
|
||||
binary_version: 'v4.1.11'
|
||||
|
||||
# Alternatively, you can specify the path to the binary that you manage yourself
|
||||
#binary: 'node_modules/.bin/tailwindcss'
|
||||
2
config/packages/tailwind.yaml
Normal file
2
config/packages/tailwind.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
symfonycasts_tailwind:
|
||||
input_css: '%kernel.project_dir%/assets/styles/app.css'
|
||||
@@ -638,7 +638,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* }>,
|
||||
* },
|
||||
* uid?: bool|array{ // Uid configuration
|
||||
* enabled?: bool|Param, // Default: false
|
||||
* enabled?: bool|Param, // Default: true
|
||||
* default_uuid_version?: 7|6|4|1|Param, // Default: 7
|
||||
* name_based_uuid_version?: 5|3|Param, // Default: 5
|
||||
* name_based_uuid_namespace?: scalar|Param|null,
|
||||
@@ -938,20 +938,6 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* intercept_redirects?: bool|Param, // Default: false
|
||||
* excluded_ajax_paths?: scalar|Param|null, // Default: "^/((index|app(_[\\w]+)?)\\.php/)?_wdt"
|
||||
* }
|
||||
* @psalm-type StimulusConfig = array{
|
||||
* controller_paths?: list<scalar|Param|null>,
|
||||
* controllers_json?: scalar|Param|null, // Default: "%kernel.project_dir%/assets/controllers.json"
|
||||
* }
|
||||
* @psalm-type TurboConfig = array{
|
||||
* broadcast?: bool|array{
|
||||
* enabled?: bool|Param, // Default: true
|
||||
* entity_template_prefixes?: list<scalar|Param|null>,
|
||||
* doctrine_orm?: bool|array{ // Enable the Doctrine ORM integration
|
||||
* enabled?: bool|Param, // Default: true
|
||||
* },
|
||||
* },
|
||||
* default_transport?: scalar|Param|null, // Default: "default"
|
||||
* }
|
||||
* @psalm-type TwigExtraConfig = array{
|
||||
* cache?: bool|array{
|
||||
* enabled?: bool|Param, // Default: false
|
||||
@@ -1455,6 +1441,29 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* generate_final_classes?: bool|Param, // Default: true
|
||||
* generate_final_entities?: bool|Param, // Default: false
|
||||
* }
|
||||
* @psalm-type StimulusConfig = array{
|
||||
* controller_paths?: list<scalar|Param|null>,
|
||||
* controllers_json?: scalar|Param|null, // Default: "%kernel.project_dir%/assets/controllers.json"
|
||||
* }
|
||||
* @psalm-type TurboConfig = array{
|
||||
* broadcast?: bool|array{
|
||||
* enabled?: bool|Param, // Default: true
|
||||
* entity_template_prefixes?: list<scalar|Param|null>,
|
||||
* doctrine_orm?: bool|array{ // Enable the Doctrine ORM integration
|
||||
* enabled?: bool|Param, // Default: true
|
||||
* },
|
||||
* },
|
||||
* default_transport?: scalar|Param|null, // Default: "default"
|
||||
* }
|
||||
* @psalm-type SymfonycastsTailwindConfig = array{
|
||||
* input_css?: list<scalar|Param|null>,
|
||||
* config_file?: scalar|Param|null, // Path to the tailwind.config.js file // Default: "%kernel.project_dir%/tailwind.config.js"
|
||||
* binary?: scalar|Param|null, // The tailwind binary to use instead of downloading a new one // Default: null
|
||||
* binary_version?: scalar|Param|null, // Tailwind CLI version to download - null means the latest version // Default: null
|
||||
* binary_platform?: "auto"|"linux-arm64"|"linux-arm64-musl"|"linux-x64"|"linux-x64-musl"|"macos-arm64"|"macos-x64"|"windows-x64"|Param, // Tailwind CLI platform to download - "auto" will try to detect the platform automatically // Default: "auto"
|
||||
* postcss_config_file?: scalar|Param|null, // Path to PostCSS config file which is passed to the Tailwind CLI // Default: null
|
||||
* strict_mode?: bool|Param|null, // When enabled, an exception will be thrown if there are no built assets (default: false in `test` env, true otherwise) // Default: null
|
||||
* }
|
||||
* @psalm-type ConfigType = array{
|
||||
* imports?: ImportsConfig,
|
||||
* parameters?: ParametersConfig,
|
||||
@@ -1463,11 +1472,12 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* doctrine?: DoctrineConfig,
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* twig?: TwigConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* twig_extra?: TwigExtraConfig,
|
||||
* security?: SecurityConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* symfonycasts_tailwind?: SymfonycastsTailwindConfig,
|
||||
* "when@dev"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
* parameters?: ParametersConfig,
|
||||
@@ -1478,12 +1488,13 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* debug?: DebugConfig,
|
||||
* twig?: TwigConfig,
|
||||
* web_profiler?: WebProfilerConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* twig_extra?: TwigExtraConfig,
|
||||
* security?: SecurityConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* maker?: MakerConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* symfonycasts_tailwind?: SymfonycastsTailwindConfig,
|
||||
* },
|
||||
* "when@prod"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
@@ -1493,11 +1504,12 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* doctrine?: DoctrineConfig,
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* twig?: TwigConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* twig_extra?: TwigExtraConfig,
|
||||
* security?: SecurityConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* symfonycasts_tailwind?: SymfonycastsTailwindConfig,
|
||||
* },
|
||||
* "when@test"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
@@ -1508,11 +1520,12 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* twig?: TwigConfig,
|
||||
* web_profiler?: WebProfilerConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* twig_extra?: TwigExtraConfig,
|
||||
* security?: SecurityConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* symfonycasts_tailwind?: SymfonycastsTailwindConfig,
|
||||
* },
|
||||
* ...<string, ExtensionType|array{ // extra keys must follow the when@%env% pattern or match an extension alias
|
||||
* imports?: ImportsConfig,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
parameters:
|
||||
images_directory: '%kernel.project_dir%/public/uploads/images'
|
||||
|
||||
services:
|
||||
# configuration par défaut pour les services
|
||||
# configuration par défaut pour les services
|
||||
_defaults:
|
||||
autowire: true # Injecte automatiquement les dépendances dans vos services.
|
||||
autoconfigure: true # Enregistre automatiquement vos services en tant que commandes, abonnés d'événements, etc.
|
||||
@@ -7,8 +10,13 @@ services:
|
||||
App\:
|
||||
resource: '../src/'
|
||||
|
||||
App\Service\KazApiClient:
|
||||
App\Service\KazApiService:
|
||||
arguments:
|
||||
$kazApiClient: '@kaz_api.client'
|
||||
$apiUser: '%env(KAZ_API_USER)%'
|
||||
$apiPassword: '%env(KAZ_API_PASSWORD)%'
|
||||
$apiPassword: '%env(KAZ_API_PASSWORD)%'
|
||||
|
||||
# Gestion de l'enregistrement de l'image de profil
|
||||
App\Service\FileUploader:
|
||||
arguments:
|
||||
$targetDirectory: '%images_directory%'
|
||||
|
||||
@@ -15,6 +15,28 @@
|
||||
<ini name="error_reporting" value="-1" />
|
||||
<server name="APP_ENV" value="test" force="true" />
|
||||
<server name="SHELL_VERBOSITY" value="-1" />
|
||||
|
||||
<!-- ###+ symfony/framework-bundle ### -->
|
||||
<env name="APP_ENV" value="dev"/>
|
||||
<env name="APP_SECRET" value=""/>
|
||||
<env name="APP_SHARE_DIR" value="var/share"/>
|
||||
<!-- ###- symfony/framework-bundle ### -->
|
||||
|
||||
<!-- ###+ symfony/routing ### -->
|
||||
<!-- Configure how to generate URLs in non-HTTP contexts, such as CLI commands. -->
|
||||
<!-- See https://symfony.com/doc/current/routing.html#generating-urls-in-commands -->
|
||||
<env name="DEFAULT_URI" value="http://localhost"/>
|
||||
<!-- ###- symfony/routing ### -->
|
||||
|
||||
<!-- ###+ doctrine/doctrine-bundle ### -->
|
||||
<!-- Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url -->
|
||||
<!-- IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml -->
|
||||
<!-- -->
|
||||
<!-- DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db" -->
|
||||
<!-- DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4" -->
|
||||
<!-- DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -->
|
||||
<env name="DATABASE_URL" value="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"/>
|
||||
<!-- ###- doctrine/doctrine-bundle ### -->
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
|
||||
66
public/img/logo.svg
Normal file
66
public/img/logo.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 71 KiB |
@@ -8,11 +8,9 @@ use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class HomeController extends AbstractController
|
||||
{
|
||||
#[Route('/hello')]
|
||||
public function hello(): Response
|
||||
{
|
||||
return $this->render('home/hello.html.twig', [
|
||||
'name' => 'Melvin'
|
||||
]);
|
||||
}
|
||||
}
|
||||
#[Route(path: '/', name: 'app_home', methods: ['GET'])]
|
||||
public function home(): Response
|
||||
{
|
||||
return $this->render('home/home.html.twig');
|
||||
}
|
||||
}
|
||||
|
||||
36
src/Controller/SecurityController.php
Normal file
36
src/Controller/SecurityController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
|
||||
|
||||
class SecurityController extends AbstractController
|
||||
{
|
||||
#[Route(path: '/login', name: 'app_login')]
|
||||
public function login(AuthenticationUtils $authenticationUtils, Request $request): Response
|
||||
{
|
||||
if ($this->getUser()) {
|
||||
return $this->redirectToRoute('app_home');
|
||||
}
|
||||
|
||||
// Récupération de l'erreur de connexion (s'il y en a une)
|
||||
$error = $authenticationUtils->getLastAuthenticationError();
|
||||
// Récupération du dernier nom d'utilisateur saisi par l'adhérent
|
||||
$lastUsername = $authenticationUtils->getLastUsername();
|
||||
|
||||
return $this->render('security/login.html.twig', [
|
||||
'last_username' => $lastUsername,
|
||||
'error' => $error
|
||||
]);
|
||||
}
|
||||
|
||||
#[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.');
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,20 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Form\ChangePasswordType;
|
||||
use App\Form\UserProfileType;
|
||||
use App\Service\FileUploader;
|
||||
use App\Service\KazApiService;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Exception;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormError;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
|
||||
@@ -18,7 +28,7 @@ class UserController extends AbstractController
|
||||
* Permet de vérifier si un utilisateur existe dans le ldap.
|
||||
*
|
||||
* @param string $email L'adresse e-mail de l'utilisateur.
|
||||
* @param KazApiService $apiClient Le service utilisé pour récupérer les données utilisateur.
|
||||
* @param KazApiService $apiKazService Le service utilisé pour récupérer les données utilisateur.
|
||||
*
|
||||
* @return Response La page index utilisateur rendue.
|
||||
* @throws ClientExceptionInterface
|
||||
@@ -27,13 +37,112 @@ class UserController extends AbstractController
|
||||
* @throws ServerExceptionInterface
|
||||
* @throws TransportExceptionInterface
|
||||
*/
|
||||
#[Route('/user/{email}')]
|
||||
public function index(string $email, KazApiService $apiClient): Response
|
||||
{
|
||||
$exist = $apiClient->getUserData($email);
|
||||
|
||||
#[Route('/mon-profil', name: 'app_user', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('ROLE_USER')]
|
||||
public function showProfile(
|
||||
Request $request,
|
||||
EntityManagerInterface $entityManager,
|
||||
FileUploader $fileUploader,
|
||||
KazApiService $apiKazService
|
||||
): Response
|
||||
{
|
||||
// Récupération de l'utilisateur actuellement connecté
|
||||
$user = $this->getUser();
|
||||
// Vérification si l'URL est en mode édition
|
||||
$isEditMode = $request->query->getBoolean('edit', false);
|
||||
|
||||
try {
|
||||
// Récupération des données de l'utilisateur sur l'API grâce à son email
|
||||
$kazUser = $apiKazService->getUserData($user->getEmail());
|
||||
// Initialisation de la variable $userData
|
||||
$user = $user->updateFromKazUser($kazUser);
|
||||
} catch (Exception $e) {
|
||||
$this->addFlash('error', 'Impossible de charger vos données.' . $e->getMessage());
|
||||
}
|
||||
|
||||
// Création du formulaire lié à l'utilisateur connecté
|
||||
$form = $this->createForm(UserProfileType::class, $user);
|
||||
$form->handleRequest($request);
|
||||
|
||||
// Affichage du formulaire si les données sont valides
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
/** @var UploadedFile|null $imageFile */
|
||||
$imageFile = $form->get('image')->getData();
|
||||
|
||||
// --- Gestion de l'image de profil ---
|
||||
if ($imageFile) {
|
||||
// Suppression de l'ancienne image via le service
|
||||
if ($user->getImage()) {
|
||||
$fileUploader->delete($user->getImage());
|
||||
}
|
||||
// Dépôt de la nouvelle image et mise à jour de son nom dans l'entité
|
||||
$newFilename = $fileUploader->upload($imageFile);
|
||||
$user->setImage($newFilename);
|
||||
}
|
||||
// --- Fin gestion de l'image de profil ---
|
||||
|
||||
// Synchronisation des données avec l'API
|
||||
$kazUser = $user->convertToKazUser();
|
||||
|
||||
try {
|
||||
$apiKazService->updateUserData($user->getEmail(), $kazUser);
|
||||
} catch (Exception $e) {
|
||||
$this->addFlash('error', 'Impossible de mettre à jour votre profil' . $e->getMessage());
|
||||
}
|
||||
// Sauvegarde en base de données
|
||||
$entityManager->flush();
|
||||
// Message de confirmation et rechargement de la page
|
||||
$this->addFlash('success', 'Votre profil a été mis à jour avec succès !');
|
||||
// Redirection de l'utilisateur
|
||||
return $this->redirectToRoute('app_user');
|
||||
}
|
||||
// Affichage de la page
|
||||
return $this->render('user/index.html.twig', [
|
||||
'exist' => $exist,
|
||||
'form' => $form->createView(),
|
||||
'userData' => $user,
|
||||
'isEditMode' => $isEditMode,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
#[Route('/mot-de-passe', name: 'app_user_edit_password', methods: ['GET', 'POST'])]
|
||||
public function editPassword(
|
||||
Request $request,
|
||||
UserPasswordHasherInterface $hasher,
|
||||
EntityManagerInterface $entityManager
|
||||
): Response
|
||||
{
|
||||
// Création du formulaire
|
||||
$form = $this->createForm(ChangePasswordType::class);
|
||||
|
||||
// Liaison du formulaire à la requête HTTP
|
||||
$form->handleRequest($request);
|
||||
|
||||
// Vérification du formulaire, s'il est bien soumis et valide
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
// Récupération des données du formulaire
|
||||
$user = $this->getUser();
|
||||
$plainOldPassword = $form->get('oldPassword')->getData();
|
||||
$newPassword = $form->get('newPassword')->getData();
|
||||
|
||||
// Vérification de l'ancien mot de passe
|
||||
if (!$hasher->isPasswordValid($user, $plainOldPassword)) {
|
||||
$form->get('oldPassword')->addError(new FormError('L\'ancien mot de passe est incorrect.'));
|
||||
} else {
|
||||
// Si tout est OK : Hachage du mot de passe
|
||||
$hashedPassword = $hasher->hashPassword($user, $newPassword);
|
||||
$user->setPassword($hashedPassword);
|
||||
|
||||
// Sauvegarde en BDD
|
||||
$entityManager->flush();
|
||||
// Message de succès pour l'utilisateur
|
||||
$this->addFlash('success', 'Votre mot de passe a bien été mis à jour !');
|
||||
|
||||
return $this->redirectToRoute('app_user_edit_password');
|
||||
}
|
||||
}
|
||||
return $this->render('user/edit_password.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
94
src/DataFixtures/AppFixtures.php
Normal file
94
src/DataFixtures/AppFixtures.php
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\User;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Faker\Factory;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
|
||||
class AppFixtures extends Fixture
|
||||
{
|
||||
// Initialisation de l'outil de hachage de Symfony
|
||||
private UserPasswordHasherInterface $hasher;
|
||||
|
||||
// Injection de dépendance pour récupérer le service de sécurité
|
||||
public function __construct(UserPasswordHasherInterface $hasher)
|
||||
{
|
||||
$this->hasher = $hasher;
|
||||
}
|
||||
|
||||
// Méthode principale qui génère des données de test en BDD locale
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
// --- Création de 10 utilisateurs avec Faker --- //
|
||||
// Initialisation de Faker en français
|
||||
$faker = Factory::create('fr_FR');
|
||||
|
||||
// Boucle pour créer 10 utilisateurs
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
// Instanciation d'un nouvel utilisateur (Adhérent)
|
||||
$user = new User();
|
||||
// Attribution d'un email aléatoire et unique
|
||||
$user->setEmail($faker->unique()->safeEmail());
|
||||
// Définition des droits d'accès de l'utilisateur
|
||||
$user->setRoles(['ROLE_USER', 'ROLE_ORGANISATION']);
|
||||
// Hachage sécurisé du mot de passe "password"
|
||||
$user->setPassword($this->hasher->hashPassword($user, 'password'));
|
||||
// Définition d'un NOM et Prénom
|
||||
$user->setFirstname($faker->firstName());
|
||||
$user->setLastname($faker->lastName());
|
||||
// autres fixtures à modifier plus tard
|
||||
$user->setNextcloudQuota($faker->numberBetween(1, 20) . 'G');
|
||||
$user->setQuota($faker->numberBetween(1, 10) . 'G');
|
||||
$user->setEmailQuota('1G');
|
||||
$user->setAlternateEmail($faker->unique()->safeEmail());
|
||||
$user->setHasAgoraAccess($faker->boolean(70)); // 70% de chance d'avoir accès
|
||||
$user->setHasMobilizon($faker->boolean(50));
|
||||
$user->setHasNextcloudAccess($faker->boolean(90));
|
||||
$user->setIdentifiantKaz($faker->uuid());
|
||||
// Préparation de l'enregistrement de l'objet en base de données
|
||||
$manager->persist($user);
|
||||
}
|
||||
|
||||
// Création d'un compte de test fixe
|
||||
$admin = new User();
|
||||
$admin->setEmail('admin@kaz.bzh');
|
||||
$admin->setRoles(['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ORGANISATION']);
|
||||
$admin->setPassword($this->hasher->hashPassword($admin, 'password'));
|
||||
// Remplissage des champs obligatoires restants pour éviter les erreurs SQL
|
||||
$admin->setFirstName('Admin');
|
||||
$admin->setLastName('KAZ');
|
||||
$admin->setAlternateEmail('secours@kaz.bzh');
|
||||
$admin->setIdentifiantKaz('ADMIN-KAZ-001');
|
||||
$admin->setQuota('5G');
|
||||
$admin->setEmailQuota('1G');
|
||||
$admin->setNextcloudQuota('10G');
|
||||
$admin->setHasNextcloudAccess(true);
|
||||
$admin->setHasMobilizon(true);
|
||||
$admin->setHasAgoraAccess(true);
|
||||
|
||||
$manager->persist($admin);
|
||||
|
||||
// Création d'un compte de test fixe présent dans le LDAP pour ma présentation
|
||||
$toto = new User();
|
||||
$toto->setEmail('toto@kazkouil.fr');
|
||||
$toto->setRoles(['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ORGANISATION']);
|
||||
$toto->setPassword($this->hasher->hashPassword($toto, 'password'));
|
||||
$toto->setFirstName('');
|
||||
$toto->setLastName('');
|
||||
$toto->setAlternateEmail('');
|
||||
$toto->setIdentifiantKaz('');
|
||||
$toto->setQuota('5G');
|
||||
$toto->setEmailQuota('1G');
|
||||
$toto->setNextcloudQuota('10G');
|
||||
$toto->setHasNextcloudAccess(true);
|
||||
$toto->setHasMobilizon(true);
|
||||
$toto->setHasAgoraAccess(true);
|
||||
$manager->persist($toto);
|
||||
|
||||
// Exécution réelle des requêtes SQL (envoi vers la base), une fois la bouche finie
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
||||
397
src/Entity/User.php
Normal file
397
src/Entity/User.php
Normal file
@@ -0,0 +1,397 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[ORM\Table(name: '`user`')]
|
||||
#[UniqueEntity(fields: ['email'], message: 'There is already an account with this email')]
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
|
||||
public const string EMAIL_QUOTA_DEFAULT = '1G';
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
#[ORM\Column(type: 'uuid', unique: true, name: 'id')]
|
||||
private ?Uuid $id;
|
||||
|
||||
#[ORM\Column(length: 180, unique: true)]
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
* @var list<string> The user roles
|
||||
*/
|
||||
#[ORM\Column(name: 'roles')]
|
||||
private array $roles = [];
|
||||
|
||||
/**
|
||||
* @var ?string The hashed password
|
||||
*/
|
||||
#[ORM\Column(name: 'password')]
|
||||
private ?string $password = null;
|
||||
|
||||
#[ORM\Column(length: 255, name: 'email_quota')]
|
||||
private ?string $emailQuota = null;
|
||||
|
||||
#[ORM\Column(length: 255, name: 'alternate_email')]
|
||||
private ?string $alternateEmail = null;
|
||||
|
||||
#[ORM\Column(length: 255, name: 'identifiant_kaz')]
|
||||
private ?string $identifiantKaz = null;
|
||||
|
||||
#[ORM\Column(length: 255, name: 'quota')]
|
||||
private ?string $quota = null;
|
||||
|
||||
#[ORM\Column(name: 'has_nextcloud_access')]
|
||||
private ?bool $hasNextcloudAccess = null;
|
||||
|
||||
#[ORM\Column(length: 255, name: 'nextcloud_quota')]
|
||||
private ?string $nextcloudQuota = null;
|
||||
|
||||
#[ORM\Column(name: 'has_mobilizon')]
|
||||
private ?bool $hasMobilizon = null;
|
||||
|
||||
#[ORM\Column(name: 'has_agora_access')]
|
||||
private ?bool $hasAgoraAccess = null;
|
||||
|
||||
#[ORM\Column(length: 255, name: 'last_name')]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column(length: 255, name: 'first_name')]
|
||||
private ?string $firstName = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true, name: 'image')]
|
||||
private ?string $image = null;
|
||||
|
||||
#[ORM\Column(length: 20, nullable: true, name: 'telephone')]
|
||||
private ?string $telephone = null;
|
||||
|
||||
private ?string $numeroMembre = null;
|
||||
|
||||
private ?bool $mailEnabled = null;
|
||||
|
||||
private ?string $mailAlias = null;
|
||||
|
||||
public function __construct() {
|
||||
$this->emailQuota = self::EMAIL_QUOTA_DEFAULT;
|
||||
}
|
||||
|
||||
public function getId(): ?Uuid
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(Uuid $id): static
|
||||
{
|
||||
$this->id = $id;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): static
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A visual identifier that represents this user.
|
||||
*
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return (string) $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
$roles[] = 'ROLE_USER'; // garantit qu'il a au moins ce rôle
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<string> $roles
|
||||
*/
|
||||
public function setRoles(array $roles): static
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
* Ajout de cette fonction, car obligatoire pour faire fonctionner UserInterface correctement
|
||||
*/
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
// Si vous stockez des données temporaires sensibles sur l'utilisateur, nettoyez-les ici
|
||||
// $this->plainPassword = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see PasswordAuthenticatedUserInterface
|
||||
*/
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): static
|
||||
{
|
||||
$this->password = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure the session doesn't contain actual password hashes by CRC32C-hashing them, as supported since Symfony 7.3.
|
||||
*/
|
||||
public function __serialize(): array
|
||||
{
|
||||
$data = (array) $this;
|
||||
$data["\0".self::class."\0password"] = hash('crc32c', $this->password);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getEmailQuota(): ?string
|
||||
{
|
||||
return $this->emailQuota;
|
||||
}
|
||||
|
||||
public function setEmailQuota(string $emailQuota): static
|
||||
{
|
||||
$this->emailQuota = $emailQuota;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAlternateEmail(): ?string
|
||||
{
|
||||
return $this->alternateEmail;
|
||||
}
|
||||
|
||||
public function setAlternateEmail(string $alternateEmail): static
|
||||
{
|
||||
$this->alternateEmail = $alternateEmail;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIdentifiantKaz(): ?string
|
||||
{
|
||||
return $this->identifiantKaz;
|
||||
}
|
||||
|
||||
public function setIdentifiantKaz(string $identifiantKaz): static
|
||||
{
|
||||
$this->identifiantKaz = $identifiantKaz;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getQuota(): ?string
|
||||
{
|
||||
return $this->quota;
|
||||
}
|
||||
|
||||
public function setQuota(string $quota): static
|
||||
{
|
||||
$this->quota = $quota;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function hasNextcloudAccess(): ?bool
|
||||
{
|
||||
return $this->hasNextcloudAccess;
|
||||
}
|
||||
|
||||
public function setHasNextcloudAccess(bool $hasNextcloudAccess): static
|
||||
{
|
||||
$this->hasNextcloudAccess = $hasNextcloudAccess;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNextcloudQuota(): ?string
|
||||
{
|
||||
return $this->nextcloudQuota;
|
||||
}
|
||||
|
||||
public function setNextcloudQuota(string $nextcloudQuota): static
|
||||
{
|
||||
$this->nextcloudQuota = $nextcloudQuota;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function hasMobilizon(): ?bool
|
||||
{
|
||||
return $this->hasMobilizon;
|
||||
}
|
||||
|
||||
public function setHasMobilizon(bool $hasMobilizon): static
|
||||
{
|
||||
$this->hasMobilizon = $hasMobilizon;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function hasAgoraAccess(): ?bool
|
||||
{
|
||||
return $this->hasAgoraAccess;
|
||||
}
|
||||
|
||||
public function setHasAgoraAccess(bool $hasAgoraAccess): static
|
||||
{
|
||||
$this->hasAgoraAccess = $hasAgoraAccess;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastName(): ?string
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
public function setLastName(string $lastName): static
|
||||
{
|
||||
$this->lastName = $lastName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
|
||||
public function setFirstName(string $firstName): static
|
||||
{
|
||||
$this->firstName = $firstName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getImage(): ?string
|
||||
{
|
||||
return $this->image;
|
||||
}
|
||||
|
||||
public function setImage(?string $image): static
|
||||
{
|
||||
$this->image = $image;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTelephone(): ?string
|
||||
{
|
||||
return $this->telephone;
|
||||
}
|
||||
|
||||
public function setTelephone(?string $telephone): static
|
||||
{
|
||||
$this->telephone = $telephone;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNumeroMembre(): ?string
|
||||
{
|
||||
return $this->numeroMembre;
|
||||
}
|
||||
|
||||
public function setNumeroMembre(?string $numeroMembre): static
|
||||
{
|
||||
$this->numeroMembre = $numeroMembre;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isMailEnabled(): ?bool
|
||||
{
|
||||
return $this->mailEnabled;
|
||||
}
|
||||
|
||||
public function setMailEnabled(?bool $mailEnabled): static
|
||||
{
|
||||
$this->mailEnabled = $mailEnabled;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMailAlias(): ?string
|
||||
{
|
||||
return $this->mailAlias;
|
||||
}
|
||||
|
||||
public function setMailAlias(?string $mailAlias): static
|
||||
{
|
||||
$this->mailAlias = $mailAlias;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
// Fonction qui permet d'afficher les données de l'API sur la page de profil
|
||||
public function updateFromKazUser($kazUser) : User
|
||||
{
|
||||
// Récupération et conversion des données de l'API pour les afficher
|
||||
$this->setEmail($kazUser['mail']);
|
||||
// Création du firstname et lastname (une seule donnée sur l'API)
|
||||
$name = explode(' ', $kazUser['sn']);
|
||||
$this->setFirstName($name[0]);
|
||||
// Récupération des valeurs du tableau moins la première
|
||||
$aLastname = array_slice($name, 1);
|
||||
$this->setLastName(implode(' ', $aLastname));
|
||||
// Récupération du mail de secours
|
||||
$this->setAlternateEmail($kazUser['mailDeSecours']);
|
||||
$this->setEmailQuota($kazUser['mailQuota']);
|
||||
$this->setHasAgoraAccess($kazUser['agoraEnabled']);
|
||||
$this->setHasMobilizon($kazUser['mobilizonEnabled']);
|
||||
$this->setHasNextcloudAccess($kazUser['nextcloudEnabled']);
|
||||
$this->setNextcloudQuota($kazUser['nextcloudQuota']);
|
||||
$this->setQuota($kazUser['quota']);
|
||||
$this->setIdentifiantKaz($kazUser['identifiantKaz']);
|
||||
return $this;
|
||||
}
|
||||
|
||||
// Fonction qui permet de convertir les données de l'API vers $kazUser
|
||||
public function convertToKazUser() : array
|
||||
{
|
||||
$data = [
|
||||
'numeroMembre' => $this->getNumeroMembre(),
|
||||
'mailDeSecours' => $this->getAlternateEmail(),
|
||||
'mailEnabled' => $this->isMailEnabled(),
|
||||
'nextcloudEnabled' => $this->hasNextcloudAccess(),
|
||||
'mobilizonEnabled' => $this->hasMobilizon(),
|
||||
'agoraEnabled' => $this->hasAgoraAccess(),
|
||||
'identifiantKaz' => $this->getIdentifiantKaz(),
|
||||
'mailAlias' => $this->getMailAlias(),
|
||||
'quota' => $this->getQuota(),
|
||||
];
|
||||
|
||||
return array_filter($data, fn($value) => $value !== null);
|
||||
}
|
||||
}
|
||||
54
src/Form/ChangePasswordType.php
Normal file
54
src/Form/ChangePasswordType.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\Length;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class ChangePasswordType extends AbstractType
|
||||
{
|
||||
# Mise en place du formulaire de changement de mot de passe
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('oldPassword', PasswordType::class, [
|
||||
'label' => 'Mot de passe actuel',
|
||||
'mapped' => false,
|
||||
# Mise en place de contraintes dans la saisie du mot de passe
|
||||
'constraints' => [
|
||||
new NotBlank(message: 'Veuillez saisir votre mot de passe actuel'),
|
||||
],
|
||||
])
|
||||
->add('newPassword', RepeatedType::class, [
|
||||
'type' => PasswordType::class,
|
||||
'invalid_message' => 'Les deux mots de passe doivent être identiques.',
|
||||
'mapped' => false,
|
||||
# Mise en place de contraintes dans la saisie du mot de passe
|
||||
'constraints' => [
|
||||
new NotBlank(
|
||||
message: 'Veuillez saisir un mot de passe'
|
||||
),
|
||||
new Length(
|
||||
min: 8,
|
||||
minMessage: 'Votre mot de passe doit faire au moins {{ limit }} caractères',
|
||||
max: 4096,
|
||||
),
|
||||
],
|
||||
'first_options' => ['label' => 'Nouveau mot de passe'],
|
||||
'second_options' => ['label' => 'Confirmer le nouveau mot de passe'],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
// Configure your form options here
|
||||
]);
|
||||
}
|
||||
}
|
||||
105
src/Form/UserProfileType.php
Normal file
105
src/Form/UserProfileType.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\User;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\Image;
|
||||
use Symfony\Component\Validator\Constraints\Length;
|
||||
use Symfony\Component\Validator\Constraints\Regex;
|
||||
|
||||
class UserProfileType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('firstName', TextType::class, [
|
||||
'label' => 'Prénom',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('lastName', TextType::class, [
|
||||
'label' => 'Nom',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('identifiantKaz', TextType::class, [
|
||||
'label' => 'Identifiant KAZ : ',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('email', EmailType::class, [
|
||||
'label' => 'E-mail',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('alternateEmail', EmailType::class, [
|
||||
'label' => 'E-mail de secours',
|
||||
'constraints' => [
|
||||
new Regex(
|
||||
pattern: '/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/',
|
||||
message: 'L\'adresse e-mail n\'est pas valide.'
|
||||
)
|
||||
]
|
||||
])
|
||||
->add('emailQuota', TextType::class, [
|
||||
'label' => 'Espace de stockage de votre boîte mail : ',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('hasNextcloudAccess', CheckboxType::class, [
|
||||
'label' => 'Accès au Nextcloud : ',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('nextcloudQuota', TextType::class, [
|
||||
'label' => 'Espace de stockage de votre Nextcloud : ',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('hasMobilizon', CheckboxType::class, [
|
||||
'label' => 'Accès à Mobilizon : ',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('hasAgoraAccess', CheckboxType::class, [
|
||||
'label' => 'Accès à l\'Agora : ',
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('telephone', TelType::class, [
|
||||
'label'=>'Téléphone',
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'placeholder'=>'06 00 00 00 00',
|
||||
],
|
||||
'constraints' => [
|
||||
new Regex(
|
||||
pattern: '/^[0-9\+\s\.\-\(\)]+$/',
|
||||
message: 'Le numéro de téléphone n\'est pas valide.'
|
||||
),
|
||||
new Length(
|
||||
max: 20,
|
||||
maxMessage: 'Le numéro est trop long (maximum {{ limit }} caractères)'
|
||||
),
|
||||
],
|
||||
])
|
||||
->add('image', FileType::class, [
|
||||
'label' => 'Mon image de profil',
|
||||
'mapped' => false,
|
||||
'required' => false,
|
||||
'constraints' => [
|
||||
new Image(
|
||||
maxSize: '8M',
|
||||
extensions: ['jpg', 'jpeg', 'png', 'gif'],
|
||||
extensionsMessage: 'Veuillez déposer une image JPG, JPEG, GIF ou PNG valide')
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => User::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
60
src/Repository/UserRepository.php
Normal file
60
src/Repository/UserRepository.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\User;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<User>
|
||||
*/
|
||||
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to upgrade (rehash) the user's password automatically over time.
|
||||
*/
|
||||
public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
|
||||
{
|
||||
if (!$user instanceof User) {
|
||||
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $user::class));
|
||||
}
|
||||
|
||||
$user->setPassword($newHashedPassword);
|
||||
$this->getEntityManager()->persist($user);
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return User[] Returns an array of User objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('u')
|
||||
// ->andWhere('u.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('u.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?User
|
||||
// {
|
||||
// return $this->createQueryBuilder('u')
|
||||
// ->andWhere('u.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
79
src/Service/FileUploader.php
Normal file
79
src/Service/FileUploader.php
Normal file
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
use Symfony\Component\HttpFoundation\File\Exception\FileException;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\String\Slugger\SluggerInterface;
|
||||
|
||||
/**
|
||||
* Service de gestion des envois et suppressions de fichiers.
|
||||
*/
|
||||
class FileUploader
|
||||
{
|
||||
/**
|
||||
* @param string $targetDirectory Le chemin absolu vers le dossier de dépôt.
|
||||
* @param SluggerInterface $slugger Le service de nettoyage des chaînes de caractères.
|
||||
*/
|
||||
public function __construct(
|
||||
#[Autowire('%kernel.project_dir%/public/uploads/img')]
|
||||
private readonly string $targetDirectory,
|
||||
private readonly SluggerInterface $slugger,
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Traite, sécurise et déplace un fichier déposé.
|
||||
*
|
||||
* @param UploadedFile $file Le fichier physique à déposer.
|
||||
* @return string Le nom final sécurisé et unique du fichier.
|
||||
* @throws RuntimeException En cas d'échec de l'écriture sur le disque.
|
||||
*/
|
||||
public function upload(UploadedFile $file): string
|
||||
{
|
||||
$originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
|
||||
$safeFilename = $this->slugger->slug($originalFilename);
|
||||
|
||||
// Utilisation de uniqid('', true) pour garantir une unicité absolue en production
|
||||
$fileName = sprintf('%s-%s.%s', $safeFilename, uniqid('', true), $file->guessExtension());
|
||||
|
||||
try {
|
||||
$file->move($this->getTargetDirectory(), $fileName);
|
||||
} catch (FileException $e) {
|
||||
throw new RuntimeException('Erreur lors du transfert de l\'image : ' . $e->getMessage(), 0, $e);
|
||||
}
|
||||
|
||||
return $fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supprime physiquement un fichier du serveur.
|
||||
*
|
||||
* @param string|null $fileName Le nom du fichier à supprimer.
|
||||
*/
|
||||
public function delete(?string $fileName): void
|
||||
{
|
||||
if (null === $fileName) {
|
||||
return;
|
||||
}
|
||||
|
||||
$filePath = rtrim($this->getTargetDirectory(), '/') . '/' . $fileName;
|
||||
|
||||
if (file_exists($filePath)) {
|
||||
unlink($filePath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le chemin du répertoire de dépôt.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTargetDirectory(): string
|
||||
{
|
||||
return $this->targetDirectory;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ namespace App\Service;
|
||||
|
||||
|
||||
use Exception;
|
||||
use Symfony\Component\Mime\Part\DataPart;
|
||||
use Symfony\Component\Mime\Part\Multipart\FormDataPart;
|
||||
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
|
||||
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
|
||||
@@ -14,12 +16,18 @@ use Symfony\Contracts\HttpClient\HttpClientInterface;
|
||||
class KazApiService
|
||||
{
|
||||
private ?string $token = null;
|
||||
private HttpClientInterface $httpClient;
|
||||
|
||||
public function __construct(
|
||||
private readonly HttpClientInterface $kazApiClient,
|
||||
private readonly string $apiUser,
|
||||
private readonly string $apiPassword
|
||||
) {}
|
||||
) {
|
||||
$this->httpClient = $kazApiClient->withOptions([
|
||||
'auth_basic' => [$apiUser, $apiPassword]
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Récupère le token JWT via l'authentification Basic
|
||||
@@ -37,16 +45,14 @@ class KazApiService
|
||||
return $this->token;
|
||||
}
|
||||
|
||||
$response = $this->kazApiClient->request('POST', '/get_token', [
|
||||
'auth_basic' => [$this->apiUser, $this->apiPassword]
|
||||
]);
|
||||
$response = $this->httpClient->request('GET', '/get_token');
|
||||
|
||||
if ($response->getStatusCode() !== 200) {
|
||||
throw new Exception('Impossible de récupérer le token JWT');
|
||||
throw new Exception('Impossible de récupérer le token JWT'.$response->getStatusCode());
|
||||
}
|
||||
|
||||
$data = $response->toArray();
|
||||
$this->token = $data['token']; // Ajustez la clé selon le format de votre API
|
||||
$this->token = $data['access_token'];
|
||||
|
||||
return $this->token;
|
||||
}
|
||||
@@ -68,7 +74,6 @@ class KazApiService
|
||||
public function getUserData(string $email): array
|
||||
{
|
||||
$options['headers']['Authorization'] = 'Bearer ' . $this->getToken();
|
||||
|
||||
$response = $this->kazApiClient->request('GET', "/ldap/user/$email", $options);
|
||||
|
||||
if ($response->getStatusCode() !== 200) {
|
||||
@@ -77,4 +82,26 @@ class KazApiService
|
||||
|
||||
return $response->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Envoie les nouvelles données saisies par l'utilisateur vers l'API
|
||||
*
|
||||
* @throws ClientExceptionInterface
|
||||
* @throws DecodingExceptionInterface
|
||||
* @throws RedirectionExceptionInterface
|
||||
* @throws ServerExceptionInterface
|
||||
* @throws TransportExceptionInterface
|
||||
* @throws Exception
|
||||
*/
|
||||
public function updateUserData(string $email, array $kazUser): void
|
||||
{
|
||||
$options['headers']['Authorization'] = 'Bearer ' . $this->getToken();
|
||||
$options['headers']['Content-Type'] = 'application/json';
|
||||
$options['json'] = $kazUser;
|
||||
$response = $this->kazApiClient->request('PATCH', "/ldap/user/update/$email", $options);
|
||||
|
||||
if ($response->getStatusCode() !== 200) {
|
||||
throw new Exception('Erreur lors de l\'appel API : ' . $response->getStatusCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
31
symfony.lock
31
symfony.lock
@@ -22,6 +22,18 @@
|
||||
"src/Repository/.gitignore"
|
||||
]
|
||||
},
|
||||
"doctrine/doctrine-fixtures-bundle": {
|
||||
"version": "4.3",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "3.0",
|
||||
"ref": "1f5514cfa15b947298df4d771e694e578d4c204d"
|
||||
},
|
||||
"files": [
|
||||
"src/DataFixtures/AppFixtures.php"
|
||||
]
|
||||
},
|
||||
"doctrine/doctrine-migrations-bundle": {
|
||||
"version": "4.0",
|
||||
"recipe": {
|
||||
@@ -270,6 +282,15 @@
|
||||
"templates/base.html.twig"
|
||||
]
|
||||
},
|
||||
"symfony/uid": {
|
||||
"version": "8.0",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "7.0",
|
||||
"ref": "0df5844274d871b37fc3816c57a768ffc60a43a5"
|
||||
}
|
||||
},
|
||||
"symfony/ux-turbo": {
|
||||
"version": "2.32",
|
||||
"recipe": {
|
||||
@@ -307,16 +328,16 @@
|
||||
"config/routes/web_profiler.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/webapp-pack": {
|
||||
"version": "1.4",
|
||||
"symfonycasts/tailwind-bundle": {
|
||||
"version": "0.12",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "1.0",
|
||||
"ref": "b9e6cc8e7b6069d0e8a816665809a423864eb4dd"
|
||||
"version": "0.8",
|
||||
"ref": "d0bd0276f74de90adfaa4c6cd74cc0caacd77e0a"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/messenger.yaml"
|
||||
"config/packages/symfonycasts_tailwind.yaml"
|
||||
]
|
||||
},
|
||||
"twig/extra-bundle": {
|
||||
|
||||
65
templates/_navbar.html.twig
Normal file
65
templates/_navbar.html.twig
Normal file
@@ -0,0 +1,65 @@
|
||||
<nav class="bg-white border-b border-gris-clair shadow-sm py-4 px-6 sticky top-0 z-50 font-sora">
|
||||
|
||||
<div class="max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-4">
|
||||
|
||||
<div class="flex flex-col md:flex-row items-center gap-4 md:gap-8 w-full md:w-auto">
|
||||
|
||||
<a href="{{ path('app_home') }}" class="flex items-center gap-2 transition-transform hover:scale-105">
|
||||
<img src="{{ asset('img/logo.svg') }}" alt="Logo de l'association" class="h-10 w-auto object-contain">
|
||||
</a>
|
||||
|
||||
<ul class="flex flex-wrap justify-center md:justify-start gap-2 md:gap-4">
|
||||
|
||||
{# Onglet : Mon profil #}
|
||||
<li>
|
||||
<a href="{{ path('app_user') }}"
|
||||
class="px-4 py-2 text-sm font-semibold transition-colors block
|
||||
{{ app.request.attributes.get('_route') == 'app_user'
|
||||
? 'bg-bouton/20 border border-bouton text-text rounded-lg'
|
||||
: 'text-gris-fonce hover:bg-gris-clair hover:text-text rounded-lg border border-transparent' }}">
|
||||
Mon profil
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{# Onglet : Mon offre #}
|
||||
<li>
|
||||
{# TODO : créer la route {{ path('app_offres') }} #}
|
||||
<a href="https://kaz.bzh/offres/" target=_blank"
|
||||
class="px-4 py-2 text-sm font-semibold transition-colors block text-gris-fonce hover:bg-gris-clair hover:text-text rounded-lg border border-transparent flex items-center gap-1">
|
||||
Mon offre
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{# Onglet : Gérer mes mots de passe #}
|
||||
<li>
|
||||
<a href="{{ path('app_user_edit_password') }}"
|
||||
class="px-4 py-2 text-sm font-semibold transition-colors block
|
||||
{{ app.request.attributes.get('_route') == 'app_user_edit_password'
|
||||
? 'bg-bouton/20 border border-bouton text-text rounded-lg'
|
||||
: 'text-gris-fonce hover:bg-gris-clair hover:text-text rounded-lg border border-transparent' }}">
|
||||
Gérer mes mots de passe
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{# Onglet : Mon organisation (ne s'affiche que si on a le rôle adéquat) #}
|
||||
{% if is_granted('ROLE_ADMIN_ORGANISATION') %}
|
||||
<li>
|
||||
<a href="#"
|
||||
class="px-4 py-2 text-sm font-semibold transition-colors block text-gris-fonce hover:bg-gris-clair hover:text-text rounded-lg border border-transparent">
|
||||
Mon organisation
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="flex-shrink-0 mt-4 md:mt-0">
|
||||
<a href="{{ path('app_logout') }}"
|
||||
class="px-4 py-2 text-sm font-bold bg-danger text-white rounded-lg hover:bg-danger-hover transition-colors shadow flex items-center gap-2">
|
||||
Se déconnecter
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
@@ -2,16 +2,84 @@
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Association Kaz{% endblock %}</title>
|
||||
<link rel="icon" href="{{ asset("img/logo.svg") }}">
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="{{ asset('styles/app.css') }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||
{{ importmap('app') }}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
|
||||
<body class="min-h-screen flex flex-col font-sora antialiased text-text bg-bg-primaire">
|
||||
|
||||
{{ include('_navbar.html.twig') }}
|
||||
|
||||
{# Contenu principal #}
|
||||
<main class="flex-grow">
|
||||
{# Gestion du responsive et l'espacement pour toutes les pages #}
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
{# Affichage des messages flash (Succès ou Erreur) #}
|
||||
{% for label, messages in app.flashes %}
|
||||
{% for message in messages %}
|
||||
{# Réglages des couleurs que prendront les messages en fonction de leur(s) paramètre(s) #}
|
||||
{% set colorClasses = {
|
||||
'success': 'bg-green-50 border-green-200 text-green-800',
|
||||
'error': 'bg-red-50 border-red-200 text-red-800',
|
||||
'warning': 'bg-yellow-50 border-yellow-200 text-yellow-800',
|
||||
'info': 'bg-blue-50 border-blue-200 text-blue-800'
|
||||
} %}
|
||||
|
||||
{# Affichage du message de la couleur définie par sa fonction #}
|
||||
<div
|
||||
class="flex items-center p-4 mb-4 rounded-lg border shadow-sm {{ colorClasses[label] ?? colorClasses['info'] }}"
|
||||
role="alert">
|
||||
<div class="text-sm font-semibold flex-grow">
|
||||
{{ message }}
|
||||
</div>
|
||||
|
||||
{# Affichage du boutton "x" pour fermer le message flash #}
|
||||
<button type="button"
|
||||
onclick="this.parentElement.remove()"
|
||||
class="ml-4 hover:opacity-50 transition-opacity"
|
||||
aria-label="Fermer">
|
||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M6 18L18 6M6 6l12 12"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{# Affichage du body spécifique à chaque page #}
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{# Gestion du pied-de-page #}
|
||||
<footer class="w-full bg-white border-t border-gris-clair mt-auto">
|
||||
<div
|
||||
class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex flex-col md:flex-row justify-between items-center gap-6">
|
||||
<div class="flex items-center gap-3 text-sm text-gris-fonce text-center md:text-left">
|
||||
<img src="{{ asset('img/logo.svg') }}" alt="Logo" class="h-6 w-auto opacity-80">
|
||||
<p>© {{ 'now'|date('Y') }} — Kaz. Le numérique sobre, libre, éthique et local.</p>
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<ul class="flex flex-wrap justify-center gap-6 text-sm text-gris-fonce">
|
||||
<li><a href="https://kaz.bzh/mentions-legales/" target="_blank"
|
||||
class="hover:text-bouton transition-colors">Mentions légales</a></li>
|
||||
<li><a href="https://status.kaz.bzh/status/kaz" target="_blank"
|
||||
class="hover:text-bouton transition-colors">État des services</a></li>
|
||||
<li><a href="https://kaz.bzh/contact/" target="_blank"
|
||||
class="hover:text-bouton transition-colors">Contact</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
error404.html.twig
|
||||
107
templates/home/home.html.twig
Normal file
107
templates/home/home.html.twig
Normal file
@@ -0,0 +1,107 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Accueil | {{ parent() }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="min-h-screen bg-bg-primaire py-8 w-full font-sora">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
|
||||
{# Bloc "message d'accueil" #}
|
||||
<h1 class="text-4xl font-caveat text-text mb-6 text-center sm:text-center">
|
||||
Page d'accueil
|
||||
</h1>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gris-clair p-6 sm:p-8 mb-10">
|
||||
<h2 class="text-xl font-bold text-title mb-4 text-center">
|
||||
Bienvenue sur ton espace kaznaute <span class="text-bouton">{{ app.user ? app.user.userIdentifier : 'visiteur' }}</span> !
|
||||
</h2>
|
||||
|
||||
{# Zone réservée pour les futures données de Pahéko
|
||||
TODO : Gérer les données avec Pahéko, mise en service en cours par un des développeurs de l'association. Cela sera vu à posteriori du stage #}
|
||||
<div class="bg-bouton/10 border border-bouton/30 rounded-lg p-5">
|
||||
<h3 class="font-semibold text-title mb-3 flex items-center gap-2">
|
||||
Ton abonnement actuellement :
|
||||
</h3>
|
||||
|
||||
<ul class="space-y-2 text-sm text-text">
|
||||
<li class="flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2">
|
||||
<span class="font-semibold text-gris-fonce">Formule souscrite :</span>
|
||||
{# TODO API : Remplacer par la vraie variable quand connexion Pahéko OK #}
|
||||
<span class="italic opacity-70">Ici s'affichera la donnée récupérée grâce à l'API</span>
|
||||
</li>
|
||||
<li class="flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2">
|
||||
<span class="font-semibold text-gris-fonce">Date de validité :</span>
|
||||
{# TODO API : Remplacer par la vraie variable quand connexion Pahéko OK #}
|
||||
<span class="italic opacity-70">Ici s'affichera la donnée récupérée grâce à l'API</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{# Bloc "que souhaitez-vous faire ?" #}
|
||||
<h2 class="text-2xl font-bold text-title mb-6 text-center sm:text-left">
|
||||
Que souhaitez-vous faire ?
|
||||
</h2>
|
||||
{# Gestion du responsive #}
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6">
|
||||
|
||||
{# LIGNE 1 : Profil & Offre #}
|
||||
<a href="{{ path('app_user')|default('#') }}" class="group flex items-center p-5 bg-white border border-gris-clair rounded-xl shadow-sm hover:shadow-md hover:border-bouton transition-all duration-200">
|
||||
<div class="flex-shrink-0 bg-blue-50 text-blue-600 rounded-lg p-3 group-hover:bg-blue-600 group-hover:text-white transition-colors">
|
||||
<span class="text-2xl block">👤</span>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<h3 class="text-lg font-semibold text-title group-hover:text-bouton transition-colors">Mon Profil</h3>
|
||||
<p class="text-sm text-gris-fonce">Consulter et modifier mes informations</p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="#" class="group flex items-center p-5 bg-white border border-gris-clair rounded-xl shadow-sm hover:shadow-md hover:border-bouton transition-all duration-200">
|
||||
<div class="flex-shrink-0 bg-green-50 text-green-600 rounded-lg p-3 group-hover:bg-green-600 group-hover:text-white transition-colors">
|
||||
<span class="text-2xl block">💳</span>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<h3 class="text-lg font-semibold text-title group-hover:text-bouton transition-colors">Mon Offre</h3>
|
||||
<p class="text-sm text-gris-fonce">Gérer mon adhésion KAZ</p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{# LIGNE 2 : Sécurité & Organisation/Contact #}
|
||||
|
||||
<a href="{{ path('app_user_edit_password') }}" class="group flex items-center p-5 bg-white border border-gris-clair rounded-xl shadow-sm hover:shadow-md hover:border-bouton transition-all duration-200">
|
||||
<div class="flex-shrink-0 bg-orange-50 text-orange-600 rounded-lg p-3 group-hover:bg-orange-600 group-hover:text-white transition-colors">
|
||||
<span class="text-2xl block">🔒</span>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<h3 class="text-lg font-semibold text-title group-hover:text-bouton transition-colors">Sécurité</h3>
|
||||
<p class="text-sm text-gris-fonce">Modifier mes mots de passe</p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{# Si la personne gère une asso, on montre l'organisation. Sinon, un bouton Contact pour garder la grille de 6 éléments équilibrée #}
|
||||
{% if is_granted('ROLE_ADMIN_ORGANISATION') %}
|
||||
<a href="#" class="group flex items-center p-5 bg-white border border-bouton/30 rounded-xl shadow-sm hover:shadow-md hover:border-bouton transition-all duration-200">
|
||||
<div class="flex-shrink-0 bg-bouton/20 text-bouton rounded-lg p-3 group-hover:bg-bouton group-hover:text-white transition-colors">
|
||||
<span class="text-2xl block">🏢</span>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<h3 class="text-lg font-semibold text-title group-hover:text-bouton transition-colors">Mon Organisation</h3>
|
||||
<p class="text-sm text-gris-fonce">Espace de gestion du bureau</p>
|
||||
</div>
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="https://kaz.bzh/contact/" target="_blank" class="group flex items-center p-5 bg-white border border-gris-clair rounded-xl shadow-sm hover:shadow-md hover:border-bouton transition-all duration-200">
|
||||
<div class="flex-shrink-0 bg-purple-50 text-purple-600 rounded-lg p-3 group-hover:bg-purple-600 group-hover:text-white transition-colors">
|
||||
<span class="text-2xl block">✉️</span>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<h3 class="text-lg font-semibold text-title group-hover:text-bouton transition-colors">Nous contacter</h3>
|
||||
<p class="text-sm text-gris-fonce">Besoin d'aide ou d'assistance ?</p>
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
90
templates/security/login.html.twig
Normal file
90
templates/security/login.html.twig
Normal file
@@ -0,0 +1,90 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Page de connexion | Association KAZ</title>
|
||||
|
||||
{% block importmap %}{{ importmap('app') }}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body class="min-h-screen bg-bg-primaire font-sora text-text flex flex-col justify-between items-center p-4 sm:p-8">
|
||||
<div class="flex-none"></div>
|
||||
<main class="w-full max-w-md bg-white p-8 rounded-xl shadow-lg border border-gris-clair">
|
||||
|
||||
<header class="flex justify-center mb-6">
|
||||
<img src="{{ asset('img/logo.svg') }}"
|
||||
alt="Logo association"
|
||||
class="h-16 md:h-24 w-auto object-contain">
|
||||
</header>
|
||||
|
||||
<h1 class="text-4xl text-center mb-8 font-caveat text-text">Se connecter</h1>
|
||||
|
||||
{% if error %}
|
||||
<div class="bg-danger/10 border border-danger text-danger px-4 py-3 rounded-lg mb-6 text-sm" role="alert">
|
||||
{{ error.messageKey|trans(error.messageData, 'security') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" class="space-y-5">
|
||||
{# champ adresse-mail #}
|
||||
<div class="space-y-1">
|
||||
<label for="username" class="block text-sm font-semibold text-text">
|
||||
Adresse-mail :
|
||||
</label>
|
||||
<input type="email" value="{{ last_username }}" name="_username" id="username"
|
||||
class="w-full px-4 py-3 border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-shadow"
|
||||
placeholder="Saisissez votre e-mail" required autofocus autocomplete="email">
|
||||
</div>
|
||||
|
||||
{# champ "mot de passe" #}
|
||||
<div class="space-y-1">
|
||||
<label for="password" class="block text-sm font-semibold text-text">
|
||||
Mot de passe :
|
||||
</label>
|
||||
<input type="password" name="_password" id="password"
|
||||
class="w-full px-4 py-3 border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-shadow"
|
||||
placeholder="Saisissez votre mot de passe" required autocomplete="current-password">
|
||||
</div>
|
||||
|
||||
{# checkbox "se souvenir de moi" #}
|
||||
<div class="flex items-center pt-1">
|
||||
<input type="checkbox" name="_remember_me" id="remember_me"
|
||||
class="w-4 h-4 text-bouton border-gris-clair rounded focus:ring-bouton cursor-pointer">
|
||||
<label for="remember_me" class="ml-2 text-sm text-gris-fonce cursor-pointer select-none">
|
||||
Se souvenir de moi
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col sm:flex-row gap-4 pt-2">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
|
||||
<button type="submit"
|
||||
class="flex-1 py-3 bg-bouton hover:bg-bouton-hover text-text font-bold rounded-lg shadow transition-colors">
|
||||
Se connecter
|
||||
</button>
|
||||
|
||||
<a href="https://kaz.bzh/offres/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="flex-1 flex items-center justify-center py-3 border border-gris-moyen text-text hover:bg-gris-clair font-bold rounded-lg transition-colors text-center">
|
||||
M'inscrire
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="text-center pt-4">
|
||||
{# TODO : faire route vers mot de passe oublié #}
|
||||
<a href="#"
|
||||
class="text-sm font-semibold text-title hover:text-bouton transition-colors">
|
||||
Mot de passe oublié ?
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
|
||||
<footer class="mt-8 text-center text-sm text-gris-fonce w-full">
|
||||
© {{ 'now'|date('Y') }} | Kaz, le numérique sobre, libre, éthique et local.
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
86
templates/user/edit_password.html.twig
Normal file
86
templates/user/edit_password.html.twig
Normal file
@@ -0,0 +1,86 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Modifier mes mots de passe | {{ parent() }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="max-w-md mx-auto w-full bg-white rounded-2xl shadow-xl p-8 border-t-4 border-bouton mt-10 md:mt-20">
|
||||
|
||||
<h1 class="font-caveat text-4xl text-text mb-12 text-center">
|
||||
Modifier le mot de passe de mon espace kaznaute
|
||||
</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
<div class="space-y-6">
|
||||
{# Champ Ancien Mot de Passe #}
|
||||
<div class="flex flex-col gap-1.5">
|
||||
{{ form_label(form.oldPassword, 'Mon mot de passe actuel', {
|
||||
'label_attr': {'class': 'block text-sm font-semibold text-text'}
|
||||
}) }}
|
||||
{{ form_widget(form.oldPassword, {
|
||||
'attr': {
|
||||
'class': 'w-full px-4 py-3 border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-all',
|
||||
'placeholder':'Saisissez votre ancien mot de passe'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{# Affichage message pour les erreurs de saisie de l'ancien mot de passe #}
|
||||
{% if form_errors(form.oldPassword) %}
|
||||
<div class="text-red-500 text-xs mt-1 italic">
|
||||
{{ form_errors(form.oldPassword) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<hr class="border-gris-clair/50">
|
||||
|
||||
{# Champs Nouveau Mot de Passe #}
|
||||
<div class="space-y-6">
|
||||
{# Affichage d'un message d'erreur si les deux champs ne correspondent pas #}
|
||||
{% if form_errors(form.newPassword) %}
|
||||
<div class="text-red-500 text-xs italic">
|
||||
{{ form_errors(form.newPassword) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="flex flex-col gap-1.5">
|
||||
{{ form_label(form.newPassword.first, 'Mon nouveau mot de passe', {
|
||||
'label_attr': {'class': 'block text-sm font-semibold text-text'}
|
||||
}) }}
|
||||
{{ form_widget(form.newPassword.first, {
|
||||
'attr': {
|
||||
'class': 'w-full px-4 py-3 border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-all',
|
||||
'placeholder':'Saisissez un nouveau mot de passe'
|
||||
}
|
||||
}) }}
|
||||
{% if form_errors(form.newPassword.first) %}
|
||||
<div class="text-red-500 text-xs italic">
|
||||
{{ form_errors(form.newPassword.first) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-1.5">
|
||||
{{ form_label(form.newPassword.second, 'Confirmer mon nouveau mot de passe', {
|
||||
'label_attr': {'class': 'block text-sm font-semibold text-text'}
|
||||
}) }}
|
||||
{{ form_widget(form.newPassword.second, {
|
||||
'attr': {
|
||||
'class': 'w-full px-4 py-3 border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-all',
|
||||
'placeholder': 'Confirmez votre saisie'
|
||||
}
|
||||
}) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Bouton de validation #}
|
||||
<div class="flex justify-center pt-12 pb-2">
|
||||
<button type="submit"
|
||||
class="w-full sm:w-auto px-8 py-3 bg-bouton hover:bg-bouton-hover text-text text-sm font-bold rounded-lg shadow-md transition-all transform active:scale-95">
|
||||
Mettre à jour mon mot de passe
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,2 +1,283 @@
|
||||
{# templates/hellp.html.twig #}
|
||||
<h1>Hello ! {{ name }}</h1>
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{# @var userData \App\Entity\User #}
|
||||
{# @var form \Symfony\Component\Form\FormView #}
|
||||
{# @var isEditMode bool #}
|
||||
|
||||
{% block title %}Ma page de profil | {{ parent() }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="min-h-screen bg-bg-primaire py-8 w-full font-sora">
|
||||
{# Affichage du formulaire (seulement en mode édition) #}
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 grid md:grid-cols-3 gap-8">
|
||||
{% if isEditMode %}
|
||||
{{ form_start(form, {'attr': {'class': 'contents'}}) }}
|
||||
{% endif %}
|
||||
|
||||
{# Colonne Photo #}
|
||||
<div class="flex flex-col text-text items-center">
|
||||
|
||||
<div class="mt-16 flex-shrink-0">
|
||||
{% if userData.image %}
|
||||
{# Design avec photo #}
|
||||
<img src="{{ asset('uploads/images/' ~ userData.image) }}"
|
||||
alt="Photo de profil"
|
||||
class="w-48 h-48 md:w-56 md:h-56 p-1 rounded-full ring-2 ring-gris-clair object-cover">
|
||||
{% else %}
|
||||
{# Design sans photo #}
|
||||
<div
|
||||
class="relative w-48 h-48 md:w-56 md:h-56 overflow-hidden bg-neutral-200 rounded-full flex items-end justify-center shadow-sm">
|
||||
<svg class="w-5/6 h-5/6 text-neutral-500" fill="currentColor" viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
||||
clip-rule="evenodd"></path>
|
||||
</svg>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<p class="text-2xl text-title font-caveat mt-6"> Ma photo</p>
|
||||
|
||||
{# Gestion du dépôt d'un fichier image (Uniquement en mode édition) #}
|
||||
{% if isEditMode %}
|
||||
<div class="w-full mt-4">
|
||||
{{ form_label(form.image, 'Choisir un fichier', {
|
||||
'label_attr': {'class': 'block mb-2.5 text-sm font-medium text-gris-fonce'}
|
||||
}) }}
|
||||
{{ form_widget(form.image, {
|
||||
'attr': {
|
||||
'class': 'cursor-pointer bg-white border border-gris-clair text-text text-sm rounded-lg focus:outline-none focus:ring-1 focus:ring-bouton focus:border-bouton block w-full shadow-sm placeholder-gris-moyen file:mr-4 file:py-2.5 file:px-4 file:border-0 file:border-r file:border-gris-clair file:bg-gris-clair file:text-gris-fonce hover:file:bg-gris-moyen transition-colors',
|
||||
'aria-describedby': 'file_input_help'
|
||||
}
|
||||
}) }}
|
||||
<p class="mt-1 text-sm text-gris-moyen" id="file_input_help">
|
||||
JPG, JPEG, GIF ou PNG (Taille max : 8Mo).
|
||||
</p>
|
||||
<div class="text-red-500 text-xs mt-1 italic font-sora">
|
||||
{{ form_errors(form.image) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Colonne Infos Persos #}
|
||||
<div class="md:col-span-2">
|
||||
|
||||
{# Gestion des boutons d'action (Modifier / Annuler) et des titres #}
|
||||
<div class="relative flex items-center justify-center mb-6">
|
||||
<h1 class="text-4xl font-caveat text-text m-0">Mon profil</h1>
|
||||
|
||||
<div class="absolute right-0">
|
||||
{% if isEditMode %}
|
||||
<a href="{{ path('app_user') }}"
|
||||
class="flex items-center gap-1.5 px-3 py-1.5 bg-white border border-gris-clair hover:bg-gray-50 text-text text-sm font-bold rounded-md shadow-sm transition-colors">
|
||||
❌ Annuler
|
||||
</a>
|
||||
{% else %}
|
||||
<a href="{{ path('app_user', {'edit': 1}) }}"
|
||||
class="flex items-center gap-1.5 px-3 py-1.5 bg-white border border-gris-clair hover:bg-gray-50 text-text text-sm font-bold rounded-md shadow-sm transition-colors">
|
||||
✏️ Modifier
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="text-2xl font-caveat text-text mb-6 text-center">Mes informations personnelles</h2>
|
||||
|
||||
{# --- Gestion de l'affichage des informations personnelles --- #}
|
||||
<div class="flex flex-col gap-6">
|
||||
{# Identifiant #}
|
||||
<div class="space-y-1">
|
||||
<label class="block text-base font-semibold text-text">
|
||||
Identifiant Kaz :
|
||||
</label>
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.identifiantKaz, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
|
||||
{% else %}
|
||||
<div
|
||||
class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
|
||||
{{ userData.identifiantKaz ?? 'Non défini' }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# --- NOM et Prénom --- #}
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
{# NOM #}
|
||||
<div class="space-y-1">
|
||||
<label class="block text-base font-semibold text-text">
|
||||
NOM :
|
||||
</label>
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.lastName, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
|
||||
<div class="text-red-500 text-xs mt-1 italic font-sora">
|
||||
{{ form_errors(form.lastName) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div
|
||||
class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
|
||||
{{ userData.lastName }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Prénom #}
|
||||
<div class="space-y-1">
|
||||
<label class="block text-base font-semibold text-text">
|
||||
Prénom :
|
||||
</label>
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.firstName, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
|
||||
<div class="text-red-500 text-xs mt-1 italic font-sora">
|
||||
{{ form_errors(form.firstName) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div
|
||||
class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
|
||||
{{ userData.firstName }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Téléphone #}
|
||||
<div class="space-y-1">
|
||||
<label class="block text-base font-semibold text-text">
|
||||
Numéro de téléphone :
|
||||
</label>
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.telephone, {'attr': {'class': 'w-full px-4 py-3 text-base bg-white border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-shadow'}}) }}
|
||||
<div class="text-red-500 text-xs mt-1 italic">
|
||||
{{ form_errors(form.telephone) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div
|
||||
class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
|
||||
{{ userData.telephone ?? 'Non renseigné' }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# E-mail #}
|
||||
<div class="space-y-1">
|
||||
<label class="block text-base font-semibold text-text">
|
||||
E-mail :
|
||||
</label>
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.email, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
|
||||
<div class="text-red-500 text-xs mt-1 italic font-sora">
|
||||
{{ form_errors(form.email) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div
|
||||
class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
|
||||
{{ userData.email }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# E-mail de secours #}
|
||||
<div class="space-y-1">
|
||||
<label class="block text-base font-semibold text-text">
|
||||
E-mail de secours :
|
||||
</label>
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.alternateEmail, {'attr': {'class': 'w-full px-4 py-3 text-base bg-white border border-gris-clair rounded-lg focus:outline-none focus:border-bouton focus:ring-1 focus:ring-bouton placeholder-gris-moyen transition-shadow'}}) }}
|
||||
<div class="text-red-500 text-xs mt-1 italic font-sora">
|
||||
{{ form_errors(form.alternateEmail) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div
|
||||
class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
|
||||
{{ userData.alternateEmail ?? 'Non renseigné' }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Quota Email #}
|
||||
<div class="space-y-1">
|
||||
<label class="block text-base font-semibold text-text">
|
||||
Espace disponible dans votre boîte mail :
|
||||
</label>
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.emailQuota, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
|
||||
{% else %}
|
||||
<div
|
||||
class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
|
||||
{{ userData.emailQuota ?? 'Non défini' }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Quota Nextcloud #}
|
||||
<div class="space-y-1 sm:col-span-2">
|
||||
<label class="block text-base font-semibold text-text">
|
||||
Quota Nextcloud :
|
||||
</label>
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.nextcloudQuota, {'attr': {'class': 'w-full px-4 py-3 text-base bg-gray-100 border border-gris-clair rounded-lg text-gray-500 cursor-not-allowed'}}) }}
|
||||
{% else %}
|
||||
<div
|
||||
class="w-full px-4 py-3 text-base bg-gray-50 border border-gris-clair rounded-lg text-text">
|
||||
{{ userData.nextcloudQuota ?? 'Non défini' }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# --- Gestion de l'affichage des checkbox des différents accès --- #}
|
||||
<div class="sm:col-span-2 grid grid-cols-1 sm:grid-cols-3 gap-4 pt-4 border-t border-gris-clair">
|
||||
|
||||
{# Accès Nextcloud #}
|
||||
<div class="flex items-center gap-3">
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.hasNextcloudAccess, {'attr': {'class': 'w-5 h-5 text-bouton border-gris-clair rounded focus:ring-bouton cursor-not-allowed opacity-60'}}) }}
|
||||
{{ form_label(form.hasNextcloudAccess, null, {'label_attr': {'class': 'text-base font-medium text-text'}}) }}
|
||||
{% else %}
|
||||
<span class="text-l">{% if userData.hasNextcloudAccess %}✅{% else %}❌{% endif %}</span>
|
||||
<span class="text-base font-medium text-text">Accès Nextcloud</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Accès Mobilizon #}
|
||||
<div class="flex items-center gap-3">
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.hasMobilizon, {'attr': {'class': 'w-5 h-5 text-bouton border-gris-clair rounded focus:ring-bouton cursor-not-allowed opacity-60'}}) }}
|
||||
{{ form_label(form.hasMobilizon, null, {'label_attr': {'class': 'text-base font-medium text-text'}}) }}
|
||||
{% else %}
|
||||
<span class="text-l">{% if userData.hasMobilizon %}✅{% else %}❌{% endif %}</span>
|
||||
<span class="text-base font-medium text-text">Accès Mobilizon</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Accès Agora #}
|
||||
<div class="flex items-center gap-3">
|
||||
{% if isEditMode %}
|
||||
{{ form_widget(form.hasAgoraAccess, {'attr': {'class': 'w-5 h-5 text-bouton border-gris-clair rounded focus:ring-bouton cursor-not-allowed opacity-60'}}) }}
|
||||
{{ form_label(form.hasAgoraAccess, null, {'label_attr': {'class': 'text-base font-medium text-text'}}) }}
|
||||
{% else %}
|
||||
<span class="text-l">{% if userData.hasAgoraAccess %}✅{% else %}❌{% endif %}</span>
|
||||
<span class="text-base font-medium text-text">Accès Agora</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Affichage du bouton "Valider" (seulement en mode édition) #}
|
||||
{% if isEditMode %}
|
||||
<div class="flex justify-center pt-8 pb-4">
|
||||
<button type="submit"
|
||||
class="px-8 py-2.5 bg-bouton hover:bg-bouton-hover text-text text-sm font-bold rounded-lg shadow transition-colors">
|
||||
Enregistrer les modifications
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Fermuture du formulaire (seulement en mode édition) #}
|
||||
{% if isEditMode %}
|
||||
{{ form_end(form) }}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
0
translations/.gitignore
vendored
Normal file
0
translations/.gitignore
vendored
Normal file
2
translations/security.fr.yaml
Normal file
2
translations/security.fr.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
# translations/security.fr.yaml
|
||||
"Invalid credentials.": "Identifiants invalides. Veuillez vérifier votre email ou votre mot de passe."
|
||||
Reference in New Issue
Block a user