Compare commits
33 Commits
feat/fixtu
...
feat/login
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| f87ed32f6f | |||
| 63398086b7 |
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
|
||||
15
.env
15
.env
@@ -1,10 +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"
|
||||
MESSENGER_TRANSPORT_DSN="doctrine://default"
|
||||
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=
|
||||
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'
|
||||
20
.gitignore
vendored
20
.gitignore
vendored
@@ -33,3 +33,23 @@ Thumbs.db
|
||||
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).
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import { startStimulusApp } from '@symfony/stimulus-bundle';
|
||||
|
||||
const app = startStimulusApp();
|
||||
import { startStimulusApp } from '@symfony/stimulus-bridge';
|
||||
|
||||
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
|
||||
|
||||
@@ -1,3 +1,35 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
@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;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,5 @@ services:
|
||||
environment:
|
||||
MP_SMTP_AUTH_ACCEPT_ANY: 1
|
||||
MP_SMTP_AUTH_ALLOW_INSECURE: 1
|
||||
|
||||
volumes:
|
||||
database_data:
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
"symfony/ux-turbo": "^2.32",
|
||||
"symfony/validator": "8.0.*",
|
||||
"symfony/web-link": "8.0.*",
|
||||
"symfony/webpack-encore-bundle": "^2.4",
|
||||
"symfony/yaml": "8.0.*",
|
||||
"symfonycasts/tailwind-bundle": "^0.12.0",
|
||||
"twig/extra-bundle": "^2.12|^3.0",
|
||||
"twig/twig": "^2.12|^3.0"
|
||||
},
|
||||
@@ -80,7 +80,8 @@
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd"
|
||||
"assets:install %PUBLIC_DIR%": "symfony-cmd",
|
||||
"importmap:install": "symfony-cmd"
|
||||
},
|
||||
"post-install-cmd": [
|
||||
"@auto-scripts"
|
||||
|
||||
316
composer.lock
generated
316
composer.lock
generated
@@ -4,8 +4,85 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "4597facec97a6ff342cba0371179ad02",
|
||||
"content-hash": "bc53a345dda69084bc7dbf18b03f3d9d",
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/semver",
|
||||
"version": "3.4.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/semver.git",
|
||||
"reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95",
|
||||
"reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^5.3.2 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^1.11",
|
||||
"symfony/phpunit-bridge": "^3 || ^7"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Composer\\Semver\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nils Adermann",
|
||||
"email": "naderman@naderman.de",
|
||||
"homepage": "http://www.naderman.de"
|
||||
},
|
||||
{
|
||||
"name": "Jordi Boggiano",
|
||||
"email": "j.boggiano@seld.be",
|
||||
"homepage": "http://seld.be"
|
||||
},
|
||||
{
|
||||
"name": "Rob Bast",
|
||||
"email": "rob.bast@gmail.com",
|
||||
"homepage": "http://robbast.nl"
|
||||
}
|
||||
],
|
||||
"description": "Semver library that offers utilities, version constraint parsing and validation.",
|
||||
"keywords": [
|
||||
"semantic",
|
||||
"semver",
|
||||
"validation",
|
||||
"versioning"
|
||||
],
|
||||
"support": {
|
||||
"irc": "ircs://irc.libera.chat:6697/composer",
|
||||
"issues": "https://github.com/composer/semver/issues",
|
||||
"source": "https://github.com/composer/semver/tree/3.4.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://packagist.com",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/composer",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-08-20T19:15:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/collections",
|
||||
"version": "2.6.0",
|
||||
@@ -1950,6 +2027,87 @@
|
||||
],
|
||||
"time": "2026-01-13T13:06:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/asset-mapper",
|
||||
"version": "v8.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/asset-mapper.git",
|
||||
"reference": "80635c3722b9bb5481e0282497ae23796dcd3712"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/asset-mapper/zipball/80635c3722b9bb5481e0282497ae23796dcd3712",
|
||||
"reference": "80635c3722b9bb5481e0282497ae23796dcd3712",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"composer/semver": "^3.0",
|
||||
"php": ">=8.4",
|
||||
"symfony/filesystem": "^7.4|^8.0",
|
||||
"symfony/http-client": "^7.4|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/asset": "^7.4|^8.0",
|
||||
"symfony/browser-kit": "^7.4|^8.0",
|
||||
"symfony/console": "^7.4|^8.0",
|
||||
"symfony/event-dispatcher-contracts": "^3.0",
|
||||
"symfony/finder": "^7.4|^8.0",
|
||||
"symfony/framework-bundle": "^7.4|^8.0",
|
||||
"symfony/http-foundation": "^7.4|^8.0",
|
||||
"symfony/http-kernel": "^7.4|^8.0",
|
||||
"symfony/process": "^7.4|^8.0",
|
||||
"symfony/runtime": "^7.4|^8.0",
|
||||
"symfony/web-link": "^7.4|^8.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\AssetMapper\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"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.6"
|
||||
},
|
||||
"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-02-17T13:07:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/cache",
|
||||
"version": "v8.0.5",
|
||||
@@ -3293,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": {
|
||||
@@ -3364,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": [
|
||||
{
|
||||
@@ -3384,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",
|
||||
@@ -3528,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": {
|
||||
@@ -3600,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": [
|
||||
{
|
||||
@@ -3620,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",
|
||||
@@ -7322,82 +7480,6 @@
|
||||
],
|
||||
"time": "2026-01-01T23:07:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/webpack-encore-bundle",
|
||||
"version": "v2.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/webpack-encore-bundle.git",
|
||||
"reference": "5b932e0feddd81aaf0ecd7d5fcd2e450e5a7817e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/webpack-encore-bundle/zipball/5b932e0feddd81aaf0ecd7d5fcd2e450e5a7817e",
|
||||
"reference": "5b932e0feddd81aaf0ecd7d5fcd2e450e5a7817e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1.0",
|
||||
"symfony/asset": "^5.4 || ^6.2 || ^7.0 || ^8.0",
|
||||
"symfony/config": "^5.4 || ^6.2 || ^7.0 || ^8.0",
|
||||
"symfony/dependency-injection": "^5.4 || ^6.2 || ^7.0 || ^8.0",
|
||||
"symfony/http-kernel": "^5.4 || ^6.2 || ^7.0 || ^8.0",
|
||||
"symfony/service-contracts": "^1.1.9 || ^2.1.3 || ^3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/framework-bundle": "^5.4 || ^6.2 || ^7.0 || ^8.0",
|
||||
"symfony/http-client": "^5.4 || ^6.2 || ^7.0 || ^8.0",
|
||||
"symfony/phpunit-bridge": "^5.4 || ^6.2 || ^7.0 || ^8.0",
|
||||
"symfony/twig-bundle": "^5.4 || ^6.2 || ^7.0 || ^8.0",
|
||||
"symfony/web-link": "^5.4 || ^6.2 || ^7.0 || ^8.0"
|
||||
},
|
||||
"type": "symfony-bundle",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/webpack-encore",
|
||||
"name": "symfony/webpack-encore"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\WebpackEncoreBundle\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Integration of your Symfony app with Webpack Encore",
|
||||
"support": {
|
||||
"issues": "https://github.com/symfony/webpack-encore-bundle/issues",
|
||||
"source": "https://github.com/symfony/webpack-encore-bundle/tree/v2.4.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": "2025-11-27T13:41:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v8.0.1",
|
||||
@@ -7473,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",
|
||||
|
||||
@@ -11,8 +11,8 @@ return [
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
|
||||
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => 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],
|
||||
];
|
||||
|
||||
11
config/packages/asset_mapper.yaml
Normal file
11
config/packages/asset_mapper.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
framework:
|
||||
asset_mapper:
|
||||
# The paths to make available to the asset mapper.
|
||||
paths:
|
||||
- assets/
|
||||
missing_import_mode: strict
|
||||
|
||||
when@prod:
|
||||
framework:
|
||||
asset_mapper:
|
||||
missing_import_mode: warn
|
||||
@@ -1,6 +1,12 @@
|
||||
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
|
||||
# Comment sont hachés nos mots de passe
|
||||
password_hashers:
|
||||
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
|
||||
|
||||
@@ -31,10 +37,21 @@ security:
|
||||
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
|
||||
# where to redirect after logout
|
||||
# target: app_any_route
|
||||
# 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
|
||||
@@ -45,8 +62,9 @@ security:
|
||||
# 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'
|
||||
@@ -1,45 +0,0 @@
|
||||
webpack_encore:
|
||||
# The path where Encore is building the assets - i.e. Encore.setOutputPath()
|
||||
output_path: '%kernel.project_dir%/public/build'
|
||||
# If multiple builds are defined (as shown below), you can disable the default build:
|
||||
# output_path: false
|
||||
|
||||
# Set attributes that will be rendered on all script and link tags
|
||||
script_attributes:
|
||||
defer: true
|
||||
# Uncomment (also under link_attributes) if using Turbo Drive
|
||||
# https://turbo.hotwired.dev/handbook/drive#reloading-when-assets-change
|
||||
# 'data-turbo-track': reload
|
||||
# link_attributes:
|
||||
# Uncomment if using Turbo Drive
|
||||
# 'data-turbo-track': reload
|
||||
|
||||
# If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials')
|
||||
# crossorigin: 'anonymous'
|
||||
|
||||
# Preload all rendered script and link tags automatically via the HTTP/2 Link header
|
||||
# preload: true
|
||||
|
||||
# Throw an exception if the entrypoints.json file is missing or an entry is missing from the data
|
||||
# strict_mode: false
|
||||
|
||||
# If you have multiple builds:
|
||||
# builds:
|
||||
# frontend: '%kernel.project_dir%/public/frontend/build'
|
||||
|
||||
# pass the build name as the 3rd argument to the Twig functions
|
||||
# {{ encore_entry_script_tags('entry1', null, 'frontend') }}
|
||||
|
||||
framework:
|
||||
assets:
|
||||
json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
|
||||
|
||||
#when@prod:
|
||||
# webpack_encore:
|
||||
# # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes)
|
||||
# # Available in version 1.2
|
||||
# cache: true
|
||||
|
||||
#when@test:
|
||||
# webpack_encore:
|
||||
# strict_mode: false
|
||||
@@ -280,7 +280,7 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* }>,
|
||||
* },
|
||||
* asset_mapper?: bool|array{ // Asset Mapper configuration
|
||||
* enabled?: bool|Param, // Default: false
|
||||
* enabled?: bool|Param, // Default: true
|
||||
* paths?: array<string, scalar|Param|null>,
|
||||
* excluded_patterns?: list<scalar|Param|null>,
|
||||
* exclude_dotfiles?: bool|Param, // If true, any files starting with "." will be excluded from the asset mapper. // Default: true
|
||||
@@ -1441,16 +1441,6 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* generate_final_classes?: bool|Param, // Default: true
|
||||
* generate_final_entities?: bool|Param, // Default: false
|
||||
* }
|
||||
* @psalm-type WebpackEncoreConfig = array{
|
||||
* output_path: scalar|Param|null, // The path where Encore is building the assets - i.e. Encore.setOutputPath()
|
||||
* crossorigin?: false|"anonymous"|"use-credentials"|Param, // crossorigin value when Encore.enableIntegrityHashes() is used, can be false (default), anonymous or use-credentials // Default: false
|
||||
* preload?: bool|Param, // preload all rendered script and link tags automatically via the http2 Link header. // Default: false
|
||||
* cache?: bool|Param, // Enable caching of the entry point file(s) // Default: false
|
||||
* strict_mode?: bool|Param, // Throw an exception if the entrypoints.json file is missing or an entry is missing from the data // Default: true
|
||||
* builds?: array<string, scalar|Param|null>,
|
||||
* script_attributes?: array<string, scalar|Param|null>,
|
||||
* link_attributes?: array<string, scalar|Param|null>,
|
||||
* }
|
||||
* @psalm-type StimulusConfig = array{
|
||||
* controller_paths?: list<scalar|Param|null>,
|
||||
* controllers_json?: scalar|Param|null, // Default: "%kernel.project_dir%/assets/controllers.json"
|
||||
@@ -1465,6 +1455,15 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* },
|
||||
* 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,
|
||||
@@ -1476,9 +1475,9 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* twig_extra?: TwigExtraConfig,
|
||||
* security?: SecurityConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* webpack_encore?: WebpackEncoreConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* symfonycasts_tailwind?: SymfonycastsTailwindConfig,
|
||||
* "when@dev"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
* parameters?: ParametersConfig,
|
||||
@@ -1493,9 +1492,9 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* security?: SecurityConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* maker?: MakerConfig,
|
||||
* webpack_encore?: WebpackEncoreConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* symfonycasts_tailwind?: SymfonycastsTailwindConfig,
|
||||
* },
|
||||
* "when@prod"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
@@ -1508,9 +1507,9 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* twig_extra?: TwigExtraConfig,
|
||||
* security?: SecurityConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* webpack_encore?: WebpackEncoreConfig,
|
||||
* stimulus?: StimulusConfig,
|
||||
* turbo?: TurboConfig,
|
||||
* symfonycasts_tailwind?: SymfonycastsTailwindConfig,
|
||||
* },
|
||||
* "when@test"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
@@ -1524,9 +1523,9 @@ use Symfony\Component\Config\Loader\ParamConfigurator as Param;
|
||||
* twig_extra?: TwigExtraConfig,
|
||||
* security?: SecurityConfig,
|
||||
* monolog?: MonologConfig,
|
||||
* webpack_encore?: WebpackEncoreConfig,
|
||||
* 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,3 +1,6 @@
|
||||
parameters:
|
||||
images_directory: '%kernel.project_dir%/public/uploads/images'
|
||||
|
||||
services:
|
||||
# configuration par défaut pour les services
|
||||
_defaults:
|
||||
@@ -12,3 +15,8 @@ services:
|
||||
$kazApiClient: '@kaz_api.client'
|
||||
$apiUser: '%env(KAZ_API_USER)%'
|
||||
$apiPassword: '%env(KAZ_API_PASSWORD)%'
|
||||
|
||||
# Gestion de l'enregistrement de l'image de profil
|
||||
App\Service\FileUploader:
|
||||
arguments:
|
||||
$targetDirectory: '%images_directory%'
|
||||
|
||||
28
importmap.php
Normal file
28
importmap.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Returns the importmap for this application.
|
||||
*
|
||||
* - "path" is a path inside the asset mapper system. Use the
|
||||
* "debug:asset-map" command to see the full list of paths.
|
||||
*
|
||||
* - "entrypoint" (JavaScript only) set to true for any module that will
|
||||
* be used as an "entrypoint" (and passed to the importmap() Twig function).
|
||||
*
|
||||
* The "importmap:require" command can be used to add new entries to this file.
|
||||
*/
|
||||
return [
|
||||
'app' => [
|
||||
'path' => './assets/app.js',
|
||||
'entrypoint' => true,
|
||||
],
|
||||
'@hotwired/stimulus' => [
|
||||
'version' => '3.2.2',
|
||||
],
|
||||
'@symfony/stimulus-bundle' => [
|
||||
'path' => './vendor/symfony/stimulus-bundle/assets/dist/loader.js',
|
||||
],
|
||||
'@hotwired/turbo' => [
|
||||
'version' => '7.3.0',
|
||||
],
|
||||
];
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20260313151403 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE TABLE "user" (id UUID NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, email_quota VARCHAR(255) NOT NULL, email_de_secours VARCHAR(255) NOT NULL, identifiant_kaz VARCHAR(255) NOT NULL, quota VARCHAR(255) NOT NULL, has_nextcloud_access BOOLEAN NOT NULL, nextcloud_quota VARCHAR(255) NOT NULL, has_mobilizon BOOLEAN NOT NULL, has_agora_access BOOLEAN NOT NULL, lastname VARCHAR(255) NOT NULL, firstname VARCHAR(255) NOT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL ON "user" (email)');
|
||||
$this->addSql('CREATE TABLE messenger_messages (id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0E3BD61CE16BA31DBBF396750 ON messenger_messages (queue_name, available_at, delivered_at, id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('DROP TABLE "user"');
|
||||
$this->addSql('DROP TABLE messenger_messages');
|
||||
}
|
||||
}
|
||||
6456
package-lock.json
generated
6456
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
@@ -1,29 +0,0 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.0",
|
||||
"@babel/preset-env": "^7.16.0",
|
||||
"@hotwired/stimulus": "^3.0.0",
|
||||
"@hotwired/turbo": "^7.1.0 || ^8.0",
|
||||
"@symfony/stimulus-bridge": "^3.2.0 || ^4.0.0",
|
||||
"@symfony/ux-turbo": "file:vendor/symfony/ux-turbo/assets",
|
||||
"@symfony/webpack-encore": "^6.0.0",
|
||||
"core-js": "^3.38.0",
|
||||
"regenerator-runtime": "^0.13.9",
|
||||
"tailwindcss": "^3.4.19",
|
||||
"webpack": "^5.74.0",
|
||||
"webpack-cli": "^5.1.0"
|
||||
},
|
||||
"license": "UNLICENSED",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev-server": "encore dev-server",
|
||||
"dev": "encore dev",
|
||||
"watch": "encore dev --watch",
|
||||
"build": "encore production --progress"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/postcss": "^4.2.1",
|
||||
"postcss": "^8.5.8",
|
||||
"postcss-loader": "^8.2.1"
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export default {
|
||||
plugins: {
|
||||
"@tailwindcss/postcss": {},
|
||||
},
|
||||
};
|
||||
@@ -1,631 +0,0 @@
|
||||
*, ::before, ::after {
|
||||
--tw-border-spacing-x: 0;
|
||||
--tw-border-spacing-y: 0;
|
||||
--tw-translate-x: 0;
|
||||
--tw-translate-y: 0;
|
||||
--tw-rotate: 0;
|
||||
--tw-skew-x: 0;
|
||||
--tw-skew-y: 0;
|
||||
--tw-scale-x: 1;
|
||||
--tw-scale-y: 1;
|
||||
--tw-pan-x: ;
|
||||
--tw-pan-y: ;
|
||||
--tw-pinch-zoom: ;
|
||||
--tw-scroll-snap-strictness: proximity;
|
||||
--tw-gradient-from-position: ;
|
||||
--tw-gradient-via-position: ;
|
||||
--tw-gradient-to-position: ;
|
||||
--tw-ordinal: ;
|
||||
--tw-slashed-zero: ;
|
||||
--tw-numeric-figure: ;
|
||||
--tw-numeric-spacing: ;
|
||||
--tw-numeric-fraction: ;
|
||||
--tw-ring-inset: ;
|
||||
--tw-ring-offset-width: 0px;
|
||||
--tw-ring-offset-color: #fff;
|
||||
--tw-ring-color: rgb(59 130 246 / 0.5);
|
||||
--tw-ring-offset-shadow: 0 0 #0000;
|
||||
--tw-ring-shadow: 0 0 #0000;
|
||||
--tw-shadow: 0 0 #0000;
|
||||
--tw-shadow-colored: 0 0 #0000;
|
||||
--tw-blur: ;
|
||||
--tw-brightness: ;
|
||||
--tw-contrast: ;
|
||||
--tw-grayscale: ;
|
||||
--tw-hue-rotate: ;
|
||||
--tw-invert: ;
|
||||
--tw-saturate: ;
|
||||
--tw-sepia: ;
|
||||
--tw-drop-shadow: ;
|
||||
--tw-backdrop-blur: ;
|
||||
--tw-backdrop-brightness: ;
|
||||
--tw-backdrop-contrast: ;
|
||||
--tw-backdrop-grayscale: ;
|
||||
--tw-backdrop-hue-rotate: ;
|
||||
--tw-backdrop-invert: ;
|
||||
--tw-backdrop-opacity: ;
|
||||
--tw-backdrop-saturate: ;
|
||||
--tw-backdrop-sepia: ;
|
||||
--tw-contain-size: ;
|
||||
--tw-contain-layout: ;
|
||||
--tw-contain-paint: ;
|
||||
--tw-contain-style: ;
|
||||
}
|
||||
|
||||
::backdrop {
|
||||
--tw-border-spacing-x: 0;
|
||||
--tw-border-spacing-y: 0;
|
||||
--tw-translate-x: 0;
|
||||
--tw-translate-y: 0;
|
||||
--tw-rotate: 0;
|
||||
--tw-skew-x: 0;
|
||||
--tw-skew-y: 0;
|
||||
--tw-scale-x: 1;
|
||||
--tw-scale-y: 1;
|
||||
--tw-pan-x: ;
|
||||
--tw-pan-y: ;
|
||||
--tw-pinch-zoom: ;
|
||||
--tw-scroll-snap-strictness: proximity;
|
||||
--tw-gradient-from-position: ;
|
||||
--tw-gradient-via-position: ;
|
||||
--tw-gradient-to-position: ;
|
||||
--tw-ordinal: ;
|
||||
--tw-slashed-zero: ;
|
||||
--tw-numeric-figure: ;
|
||||
--tw-numeric-spacing: ;
|
||||
--tw-numeric-fraction: ;
|
||||
--tw-ring-inset: ;
|
||||
--tw-ring-offset-width: 0px;
|
||||
--tw-ring-offset-color: #fff;
|
||||
--tw-ring-color: rgb(59 130 246 / 0.5);
|
||||
--tw-ring-offset-shadow: 0 0 #0000;
|
||||
--tw-ring-shadow: 0 0 #0000;
|
||||
--tw-shadow: 0 0 #0000;
|
||||
--tw-shadow-colored: 0 0 #0000;
|
||||
--tw-blur: ;
|
||||
--tw-brightness: ;
|
||||
--tw-contrast: ;
|
||||
--tw-grayscale: ;
|
||||
--tw-hue-rotate: ;
|
||||
--tw-invert: ;
|
||||
--tw-saturate: ;
|
||||
--tw-sepia: ;
|
||||
--tw-drop-shadow: ;
|
||||
--tw-backdrop-blur: ;
|
||||
--tw-backdrop-brightness: ;
|
||||
--tw-backdrop-contrast: ;
|
||||
--tw-backdrop-grayscale: ;
|
||||
--tw-backdrop-hue-rotate: ;
|
||||
--tw-backdrop-invert: ;
|
||||
--tw-backdrop-opacity: ;
|
||||
--tw-backdrop-saturate: ;
|
||||
--tw-backdrop-sepia: ;
|
||||
--tw-contain-size: ;
|
||||
--tw-contain-layout: ;
|
||||
--tw-contain-paint: ;
|
||||
--tw-contain-style: ;
|
||||
}
|
||||
|
||||
/*
|
||||
! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
|
||||
*/
|
||||
|
||||
/*
|
||||
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
||||
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
||||
*/
|
||||
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
box-sizing: border-box;
|
||||
/* 1 */
|
||||
border-width: 0;
|
||||
/* 2 */
|
||||
border-style: solid;
|
||||
/* 2 */
|
||||
border-color: #e5e7eb;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
::before,
|
||||
::after {
|
||||
--tw-content: '';
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use a consistent sensible line-height in all browsers.
|
||||
2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
3. Use a more readable tab size.
|
||||
4. Use the user's configured `sans` font-family by default.
|
||||
5. Use the user's configured `sans` font-feature-settings by default.
|
||||
6. Use the user's configured `sans` font-variation-settings by default.
|
||||
7. Disable tap highlights on iOS
|
||||
*/
|
||||
|
||||
html,
|
||||
:host {
|
||||
line-height: 1.5;
|
||||
/* 1 */
|
||||
-webkit-text-size-adjust: 100%;
|
||||
/* 2 */
|
||||
-moz-tab-size: 4;
|
||||
/* 3 */
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
/* 3 */
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
/* 4 */
|
||||
font-feature-settings: normal;
|
||||
/* 5 */
|
||||
font-variation-settings: normal;
|
||||
/* 6 */
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
/* 7 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Remove the margin in all browsers.
|
||||
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
/* 1 */
|
||||
line-height: inherit;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Add the correct height in Firefox.
|
||||
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
||||
3. Ensure horizontal rules are visible by default.
|
||||
*/
|
||||
|
||||
hr {
|
||||
height: 0;
|
||||
/* 1 */
|
||||
color: inherit;
|
||||
/* 2 */
|
||||
border-top-width: 1px;
|
||||
/* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct text decoration in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
abbr:where([title]) {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the default font size and weight for headings.
|
||||
*/
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
Reset links to optimize for opt-in styling instead of opt-out.
|
||||
*/
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct font weight in Edge and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use the user's configured `mono` font-family by default.
|
||||
2. Use the user's configured `mono` font-feature-settings by default.
|
||||
3. Use the user's configured `mono` font-variation-settings by default.
|
||||
4. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
/* 1 */
|
||||
font-feature-settings: normal;
|
||||
/* 2 */
|
||||
font-variation-settings: normal;
|
||||
/* 3 */
|
||||
font-size: 1em;
|
||||
/* 4 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
|
||||
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
||||
3. Remove gaps between table borders by default.
|
||||
*/
|
||||
|
||||
table {
|
||||
text-indent: 0;
|
||||
/* 1 */
|
||||
border-color: inherit;
|
||||
/* 2 */
|
||||
border-collapse: collapse;
|
||||
/* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Change the font styles in all browsers.
|
||||
2. Remove the margin in Firefox and Safari.
|
||||
3. Remove default padding in all browsers.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit;
|
||||
/* 1 */
|
||||
font-feature-settings: inherit;
|
||||
/* 1 */
|
||||
font-variation-settings: inherit;
|
||||
/* 1 */
|
||||
font-size: 100%;
|
||||
/* 1 */
|
||||
font-weight: inherit;
|
||||
/* 1 */
|
||||
line-height: inherit;
|
||||
/* 1 */
|
||||
letter-spacing: inherit;
|
||||
/* 1 */
|
||||
color: inherit;
|
||||
/* 1 */
|
||||
margin: 0;
|
||||
/* 2 */
|
||||
padding: 0;
|
||||
/* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the inheritance of text transform in Edge and Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Remove default button styles.
|
||||
*/
|
||||
|
||||
button,
|
||||
input:where([type='button']),
|
||||
input:where([type='reset']),
|
||||
input:where([type='submit']) {
|
||||
-webkit-appearance: button;
|
||||
/* 1 */
|
||||
background-color: transparent;
|
||||
/* 2 */
|
||||
background-image: none;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Use the modern Firefox focus style for all focusable elements.
|
||||
*/
|
||||
|
||||
:-moz-focusring {
|
||||
outline: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
|
||||
*/
|
||||
|
||||
:-moz-ui-invalid {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct vertical alignment in Chrome and Firefox.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/*
|
||||
Correct the cursor style of increment and decrement buttons in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-inner-spin-button,
|
||||
::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the odd appearance in Chrome and Safari.
|
||||
2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type='search'] {
|
||||
-webkit-appearance: textfield;
|
||||
/* 1 */
|
||||
outline-offset: -2px;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
/* 1 */
|
||||
font: inherit;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct display in Chrome and Safari.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/*
|
||||
Removes the default spacing and border for appropriate elements.
|
||||
*/
|
||||
|
||||
blockquote,
|
||||
dl,
|
||||
dd,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
hr,
|
||||
figure,
|
||||
p,
|
||||
pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
menu {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Reset default styling for dialogs.
|
||||
*/
|
||||
|
||||
dialog {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Prevent resizing textareas horizontally by default.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
|
||||
2. Set the default placeholder color to the user's configured gray 400 color.
|
||||
*/
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
opacity: 1;
|
||||
/* 1 */
|
||||
color: #9ca3af;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
opacity: 1;
|
||||
/* 1 */
|
||||
color: #9ca3af;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Set the default cursor for buttons.
|
||||
*/
|
||||
|
||||
button,
|
||||
[role="button"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*
|
||||
Make sure disabled buttons don't get the pointer cursor.
|
||||
*/
|
||||
|
||||
:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
|
||||
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
|
||||
This can trigger a poorly considered lint error in some tools but is included by design.
|
||||
*/
|
||||
|
||||
img,
|
||||
svg,
|
||||
video,
|
||||
canvas,
|
||||
audio,
|
||||
iframe,
|
||||
embed,
|
||||
object {
|
||||
display: block;
|
||||
/* 1 */
|
||||
vertical-align: middle;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
|
||||
*/
|
||||
|
||||
img,
|
||||
video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Make elements with the HTML hidden attribute stay hidden by default */
|
||||
|
||||
[hidden]:where(:not([hidden="until-found"])) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.visible {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.static {
|
||||
position: static;
|
||||
}
|
||||
|
||||
.fixed {
|
||||
position: fixed;
|
||||
}
|
||||
|
||||
.mb-3 {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.mb-4 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.block {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.transform {
|
||||
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
||||
}
|
||||
|
||||
.rounded-lg {
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.border {
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
.border-red-200 {
|
||||
--tw-border-opacity: 1;
|
||||
border-color: rgb(254 202 202 / var(--tw-border-opacity, 1));
|
||||
}
|
||||
|
||||
.bg-red-50 {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.p-4 {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.text-sm {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.25rem;
|
||||
}
|
||||
|
||||
.text-red-800 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(153 27 27 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.filter {
|
||||
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
||||
}
|
||||
|
||||
.transition {
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
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', name: 'app_home', methods: ['GET'])]
|
||||
public function hello(): Response
|
||||
#[Route(path: '/', name: 'app_home', methods: ['GET'])]
|
||||
public function home(): Response
|
||||
{
|
||||
return $this->render('home/hello.html.twig', [
|
||||
'name' => 'Melvin'
|
||||
]);
|
||||
return $this->render('home/home.html.twig');
|
||||
}
|
||||
}
|
||||
@@ -2,38 +2,35 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use LogicException;
|
||||
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', methods: ['GET','POST'])]
|
||||
public function login(AuthenticationUtils $authenticationUtils): Response
|
||||
#[Route(path: '/login', name: 'app_login')]
|
||||
public function login(AuthenticationUtils $authenticationUtils, Request $request): Response
|
||||
{
|
||||
|
||||
// si on a un utilisateur déjà connecté, alors on le redirige sur la page d'accueil
|
||||
if ($this->getUser()) {
|
||||
return $this->redirectToRoute('app_home');
|
||||
}
|
||||
|
||||
// get the login error if there is one
|
||||
// Récupération de l'erreur de connexion (s'il y en a une)
|
||||
$error = $authenticationUtils->getLastAuthenticationError();
|
||||
|
||||
// last username entered by the user
|
||||
// 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,
|
||||
'error' => $error
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/logout', name: 'app_logout', methods: ['POST'])]
|
||||
#[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.');
|
||||
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;
|
||||
@@ -14,14 +24,11 @@ use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||
|
||||
class UserController extends AbstractController
|
||||
{
|
||||
|
||||
// TODO : UserPasswordHasherInterface
|
||||
// voir : https://symfony.com/doc/current/security/passwords.html#hashing-the-password
|
||||
/**
|
||||
* 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
|
||||
@@ -30,13 +37,112 @@ class UserController extends AbstractController
|
||||
* @throws ServerExceptionInterface
|
||||
* @throws TransportExceptionInterface
|
||||
*/
|
||||
#[Route('/user/{email}', name: 'app_user', methods: ['GET'])]
|
||||
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(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -10,53 +10,85 @@ use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
|
||||
class AppFixtures extends Fixture
|
||||
{
|
||||
# Initialisation de l'outil de hachage de Symfony
|
||||
// Initialisation de l'outil de hachage de Symfony
|
||||
private UserPasswordHasherInterface $hasher;
|
||||
|
||||
# Injection de dépendance pour récupérer le service de sécurité
|
||||
// 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 les données en base
|
||||
// Méthode principale qui génère des données de test en BDD locale
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
# Initialisation de Faker en français
|
||||
// --- Création de 10 utilisateurs avec Faker --- //
|
||||
// Initialisation de Faker en français
|
||||
$faker = Factory::create('fr_FR');
|
||||
|
||||
# Boucle pour créer 10 utilisateurs
|
||||
// Boucle pour créer 10 utilisateurs
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
# Instanciation d'un nouvel utilisateur (Adhérent)
|
||||
// Instanciation d'un nouvel utilisateur (Adhérent)
|
||||
$user = new User();
|
||||
|
||||
# Attribution d'un email aléatoire et unique
|
||||
// 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']);
|
||||
|
||||
# Hachage sécurisé du mot de passe "password"
|
||||
// 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
|
||||
// Définition d'un NOM et Prénom
|
||||
$user->setFirstname($faker->firstName());
|
||||
$user->setLastname($faker->lastName());
|
||||
|
||||
# autres fixtures à modifier plus tard
|
||||
// autres fixtures à modifier plus tard
|
||||
$user->setNextcloudQuota($faker->numberBetween(1, 20) . 'G');
|
||||
$user->setQuota($faker->numberBetween(1, 10) . 'G');
|
||||
$user->setEmailQuota('1G');
|
||||
$user->setEmailDeSecours($faker->unique()->safeEmail());
|
||||
$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
|
||||
// Préparation de l'enregistrement de l'objet en base de données
|
||||
$manager->persist($user);
|
||||
}
|
||||
# Exécution réelle des requêtes SQL (envoi vers la base), une fois la bouche finie
|
||||
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,19 +4,23 @@ 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`')]
|
||||
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
|
||||
#[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)]
|
||||
#[ORM\Column(type: 'uuid', unique: true, name: 'id')]
|
||||
private ?Uuid $id;
|
||||
|
||||
#[ORM\Column(length: 180, unique: true)]
|
||||
@@ -25,44 +29,60 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
/**
|
||||
* @var list<string> The user roles
|
||||
*/
|
||||
#[ORM\Column]
|
||||
#[ORM\Column(name: 'roles')]
|
||||
private array $roles = [];
|
||||
|
||||
/**
|
||||
* @var ?string The hashed password
|
||||
*/
|
||||
#[ORM\Column]
|
||||
#[ORM\Column(name: 'password')]
|
||||
private ?string $password = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, name: 'email_quota')]
|
||||
private ?string $emailQuota = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $emailDeSecours = null;
|
||||
#[ORM\Column(length: 255, name: 'alternate_email')]
|
||||
private ?string $alternateEmail = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, name: 'identifiant_kaz')]
|
||||
private ?string $identifiantKaz = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, name: 'quota')]
|
||||
private ?string $quota = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[ORM\Column(name: 'has_nextcloud_access')]
|
||||
private ?bool $hasNextcloudAccess = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[ORM\Column(length: 255, name: 'nextcloud_quota')]
|
||||
private ?string $nextcloudQuota = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[ORM\Column(name: 'has_mobilizon')]
|
||||
private ?bool $hasMobilizon = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[ORM\Column(name: 'has_agora_access')]
|
||||
private ?bool $hasAgoraAccess = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $lastname = null;
|
||||
#[ORM\Column(length: 255, name: 'last_name')]
|
||||
private ?string $lastName = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $firstname = 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
|
||||
{
|
||||
@@ -104,9 +124,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
// guarantee every user at least has ROLE_USER
|
||||
$roles[] = 'ROLE_USER';
|
||||
|
||||
$roles[] = 'ROLE_USER'; // garantit qu'il a au moins ce rôle
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
@@ -120,6 +138,16 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
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
|
||||
*/
|
||||
@@ -158,14 +186,14 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmailDeSecours(): ?string
|
||||
public function getAlternateEmail(): ?string
|
||||
{
|
||||
return $this->emailDeSecours;
|
||||
return $this->alternateEmail;
|
||||
}
|
||||
|
||||
public function setEmailDeSecours(string $emailDeSecours): static
|
||||
public function setAlternateEmail(string $alternateEmail): static
|
||||
{
|
||||
$this->emailDeSecours = $emailDeSecours;
|
||||
$this->alternateEmail = $alternateEmail;
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -242,27 +270,128 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLastname(): ?string
|
||||
public function getLastName(): ?string
|
||||
{
|
||||
return $this->lastname;
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
public function setLastname(string $lastname): static
|
||||
public function setLastName(string $lastName): static
|
||||
{
|
||||
$this->lastname = $lastname;
|
||||
$this->lastName = $lastName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFirstname(): ?string
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
return $this->firstname;
|
||||
return $this->firstName;
|
||||
}
|
||||
|
||||
public function setFirstname(string $firstname): static
|
||||
public function setFirstName(string $firstName): static
|
||||
{
|
||||
$this->firstname = $firstname;
|
||||
$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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
41
symfony.lock
41
symfony.lock
@@ -62,6 +62,21 @@
|
||||
"bin/phpunit"
|
||||
]
|
||||
},
|
||||
"symfony/asset-mapper": {
|
||||
"version": "8.0",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "6.4",
|
||||
"ref": "5ad1308aa756d58f999ffbe1540d1189f5d7d14a"
|
||||
},
|
||||
"files": [
|
||||
"assets/app.js",
|
||||
"assets/styles/app.css",
|
||||
"config/packages/asset_mapper.yaml",
|
||||
"importmap.php"
|
||||
]
|
||||
},
|
||||
"symfony/console": {
|
||||
"version": "8.0",
|
||||
"recipe": {
|
||||
@@ -313,32 +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"
|
||||
]
|
||||
},
|
||||
"symfony/webpack-encore-bundle": {
|
||||
"version": "2.4",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "2.0",
|
||||
"ref": "719f6110345acb6495e496601fc1b4977d7102b3"
|
||||
},
|
||||
"files": [
|
||||
"assets/app.js",
|
||||
"assets/styles/app.css",
|
||||
"config/packages/webpack_encore.yaml",
|
||||
"package.json",
|
||||
"webpack.config.js"
|
||||
"config/packages/symfonycasts_tailwind.yaml"
|
||||
]
|
||||
},
|
||||
"twig/extra-bundle": {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
content: [
|
||||
"./templates/**/*.html.twig",
|
||||
"./assets/**/*.js",
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
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,85 @@
|
||||
<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">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>{% block title %}Association Kaz{% endblock %}</title>
|
||||
<link rel="icon" href="{{ asset("img/logo.svg") }}">
|
||||
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="/assets/styles/app.css">
|
||||
<link rel="stylesheet" href="{{ asset('styles/app.css') }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
{{ importmap('app') }}
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<body class="min-h-screen flex flex-col font-sora antialiased text-text">
|
||||
|
||||
{% block navbar %}
|
||||
{{ include('_navbar.html.twig') }}
|
||||
{% endblock %}
|
||||
|
||||
{# Contenu principal #}
|
||||
<main class="flex-grow">
|
||||
{# Affichage des messages flash (Succès ou Erreur) #}
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-4">
|
||||
{% for label, messages in app.flashes %}
|
||||
{% for message in messages %}
|
||||
{% 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'
|
||||
} %}
|
||||
|
||||
<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>
|
||||
|
||||
<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 %}
|
||||
</div>
|
||||
|
||||
{% block body %}{% endblock %}
|
||||
</main>
|
||||
|
||||
{# Gestion du pied-de-page du site #}
|
||||
<footer class="bg-white border-t border-gris-clair py-8 w-full">
|
||||
<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">
|
||||
{# Logo de l'association #}
|
||||
<img src="{{ asset('img/logo.svg') }}" alt="Logo" class="h-6 w-auto opacity-80">
|
||||
{# Le texte et les liens #}
|
||||
<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 %}
|
||||
@@ -1,39 +1,90 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
<!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 title %}Log in!{% endblock %}
|
||||
{% 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>
|
||||
|
||||
{% block body %}
|
||||
<form method="post">
|
||||
{% if error %}
|
||||
<div class="p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 border border-red-200">
|
||||
Email ou mot de passe invalide.
|
||||
<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 %}
|
||||
|
||||
{% if app.user %}
|
||||
<div class="mb-3">
|
||||
You are logged in as {{ app.user.userIdentifier }}, <a href="{{ logout_path() }}">Se déconnecter</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<h1 class="h3 mb-3 font-weight-normal">Se connecter à mon compte KAZ</h1>
|
||||
<label for="username">Email</label>
|
||||
<input type="email" value="{{ last_username }}" name="_username" id="username" class="form-control" autocomplete="email" required autofocus>
|
||||
<label for="password">Mot de passe</label>
|
||||
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
|
||||
<input type="hidden" name="_csrf_token" data-controller="csrf-protection" value="{{ csrf_token('authenticate') }}">
|
||||
|
||||
|
||||
{# TODO : vérifier qu'il y a bien une option "Se souvenir de moi" dans mon firewall pour activer la fonctionnalité. #}
|
||||
{# pour en savoir plus : https://symfony.com/doc/current/security/remember_me.html #}
|
||||
|
||||
<div class="checkbox mb-3">
|
||||
<input type="checkbox" name="_remember_me" id="_remember_me">
|
||||
<label for="_remember_me">Se souvenir de moi</label>
|
||||
<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>
|
||||
|
||||
<button class="btn btn-lg btn-primary" type="submit">
|
||||
{# 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>
|
||||
{% endblock %}
|
||||
</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>
|
||||
|
||||
80
templates/user/edit_password.html.twig
Normal file
80
templates/user/edit_password.html.twig
Normal file
@@ -0,0 +1,80 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Modifier mes mots de passe | {{ parent() }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="min-h-screen bg-bg-primaire flex items-center justify-center p-4 font-sora">
|
||||
<div class="max-w-md w-full bg-white rounded-2xl shadow-xl p-8 border-t-4 border-bouton">
|
||||
|
||||
<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="space-y-1">
|
||||
{{ 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-shadow',
|
||||
'placeholder':'Saisissez votre ancien mot de passe'
|
||||
}
|
||||
}) }}
|
||||
|
||||
{# Affichage message pour les erreurs de saisie de l'ancien mot de passe #}
|
||||
<div class="text-red-500 text-xs mt-1 italic">
|
||||
{{ form_errors(form.oldPassword) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Champs Nouveau Mot de Passe #}
|
||||
<div class="space-y-6">
|
||||
{# Affichage d'un message d'erreur si les deux champs ne correspondent pas #}
|
||||
<div class="text-red-500 text-xs italic">
|
||||
{{ form_errors(form.newPassword) }}
|
||||
</div>
|
||||
|
||||
<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'
|
||||
}
|
||||
}) }}
|
||||
<div class="text-red-500 text-xs italic">
|
||||
{{ form_errors(form.newPassword.first) }}
|
||||
</div>
|
||||
</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">
|
||||
<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 transition-all active:scale-95">
|
||||
Mettre à jour mon mot de passe
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
|
||||
</div>
|
||||
</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."
|
||||
@@ -1,79 +0,0 @@
|
||||
const Encore = require('@symfony/webpack-encore');
|
||||
|
||||
// Manually configure the runtime environment if not already configured yet by the "encore" command.
|
||||
// It's useful when you use tools that rely on webpack.config.js file.
|
||||
if (!Encore.isRuntimeEnvironmentConfigured()) {
|
||||
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
|
||||
}
|
||||
|
||||
Encore
|
||||
// directory where compiled assets will be stored
|
||||
.setOutputPath('public/build/')
|
||||
// public path used by the web server to access the output path
|
||||
.setPublicPath('/build')
|
||||
// only needed for CDN's or subdirectory deploy
|
||||
//.setManifestKeyPrefix('build/')
|
||||
|
||||
/*
|
||||
* ENTRY CONFIG
|
||||
*
|
||||
* Each entry will result in one JavaScript file (e.g. app.js)
|
||||
* and one CSS file (e.g. app.css) if your JavaScript imports CSS.
|
||||
*/
|
||||
.addEntry('app', './assets/app.js')
|
||||
|
||||
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
|
||||
.splitEntryChunks()
|
||||
|
||||
// enables the Symfony UX Stimulus bridge (used in assets/stimulus_bootstrap.js)
|
||||
.enableStimulusBridge('./assets/controllers.json')
|
||||
|
||||
// will require an extra script tag for runtime.js
|
||||
// but, you probably want this, unless you're building a single-page app
|
||||
.enableSingleRuntimeChunk()
|
||||
|
||||
/*
|
||||
* FEATURE CONFIG
|
||||
*
|
||||
* Enable & configure other features below. For a full
|
||||
* list of features, see:
|
||||
* https://symfony.com/doc/current/frontend.html#adding-more-features
|
||||
*/
|
||||
.cleanupOutputBeforeBuild()
|
||||
|
||||
// Displays build status system notifications to the user
|
||||
// .enableBuildNotifications()
|
||||
|
||||
.enableSourceMaps(!Encore.isProduction())
|
||||
// enables hashed filenames (e.g. app.abc123.css)
|
||||
.enableVersioning(Encore.isProduction())
|
||||
|
||||
// configure Babel
|
||||
// .configureBabel((config) => {
|
||||
// config.plugins.push('@babel/a-babel-plugin');
|
||||
// })
|
||||
|
||||
// enables and configure @babel/preset-env polyfills
|
||||
.configureBabelPresetEnv((config) => {
|
||||
config.useBuiltIns = 'usage';
|
||||
config.corejs = '3.38';
|
||||
})
|
||||
|
||||
// enables Sass/SCSS support
|
||||
//.enableSassLoader()
|
||||
|
||||
// uncomment if you use TypeScript
|
||||
//.enableTypeScriptLoader()
|
||||
|
||||
// uncomment if you use React
|
||||
//.enableReactPreset()
|
||||
|
||||
// uncomment to get integrity="..." attributes on your script & link tags
|
||||
// requires WebpackEncoreBundle 1.4 or higher
|
||||
//.enableIntegrityHashes(Encore.isProduction())
|
||||
|
||||
// uncomment if you're having problems with a jQuery plugin
|
||||
//.autoProvidejQuery()
|
||||
;
|
||||
|
||||
module.exports = Encore.getWebpackConfig();
|
||||
Reference in New Issue
Block a user