19 Commits

Author SHA1 Message Date
7e6e10381f Merge branch 'main' into feat/cnx_api 2026-03-30 11:47:04 +02:00
MLeveque
3821006ef3 feat(api kaz): Connexion à l'api kaz.
- Suppression des migrations, templates et configurations inutiles (ex. `compose.override.yaml`).
- Mise à jour de l'entité `User` :
  - Renommage des attributs pour correspondre aux conventions (`emailDeSecours` → `alternateEmail`, etc.).
  - Implémentation d'un mapper `updateFromKazUser` pour synchroniser les données depuis l'API Kaz.
- Refactorisation des migrations pour aligner les changements de schéma.
- Mise à jour du formulaire utilisateur et des fixtures en conséquence.
- Ajout du template Twig `profil_infos.html.twig` pour afficher les informations utilisateur. (A supprimer)
2026-03-29 13:47:07 +02:00
MLeveque
e7e6d7c1af feat(api kaz): Connexion à l'api kaz.
- Suppression des migrations, templates et configurations inutiles (ex. `compose.override.yaml`).
- Mise à jour de l'entité `User` :
  - Renommage des attributs pour correspondre aux conventions (`emailDeSecours` → `alternateEmail`, etc.).
  - Implémentation d'un mapper `updateFromKazUser` pour synchroniser les données depuis l'API Kaz.
- Refactorisation des migrations pour aligner les changements de schéma.
- Mise à jour du formulaire utilisateur et des fixtures en conséquence.
- Ajout du template Twig `profil_infos.html.twig` pour afficher les informations utilisateur. (A supprimer)
2026-03-29 13:45:07 +02:00
23789ab33e feat: modif .env pour avoir le bon truc 2026-03-28 11:03:42 +01:00
1cb1fc925b feat: modif commentaires melvin 2026-03-28 10:42:15 +01:00
0e5351b7f4 feat: mise en page de la page "infos perso" et "gérer mes mots de passe" 2026-03-27 00:56:50 +01:00
ba84b49134 feat: mise en page de la page login et page accueil 2026-03-23 18:43:32 +01:00
1b5fd98527 feat: purification webpack for reeeeeeeeeeal 2026-03-19 12:40:26 +01:00
36cd7923c1 feat: purification webpack for reeeeeeeeeeal 2026-03-19 12:40:17 +01:00
c0829d30d0 feat: purification webpack 2026-03-19 12:29:02 +01:00
458f4b5d91 feat: purification webpack 2026-03-19 12:20:21 +01:00
627f5b6954 feat: param de la page d'accueil 2026-03-19 12:09:33 +01:00
ff6399436c feat: modification des param de sécurité pour la déconnexion 2026-03-19 11:54:25 +01:00
d81e450a0e gestion de la connexion de l'utilisateur 2026-03-18 17:34:21 +01:00
3dcba06f20 gestion de la connexion de l'utilisateur 2026-03-17 15:48:27 +01:00
f72c99f56a Merge pull request 'creation de l'entite User' (#7) from feat/creation-entite into main
Reviewed-on: #7
2026-03-17 12:06:40 +01:00
74f795ba25 Merge pull request 'maurine-patch-1' (#8) from maurine-patch-1 into main
Reviewed-on: #8
2026-03-16 13:37:12 +01:00
MLeveque
81a30ebea6 Merge branch 'feat/creation-entite' of ssh://git.kaz.bzh:2202/melvin-leveque/interface-kaznautes into maurine-patch-1 2026-03-16 13:12:05 +01:00
f87ed32f6f Actualisation README
Ajout de la documentation d'installation pour Tailwind
2026-03-16 10:16:31 +01:00
57 changed files with 1662 additions and 7506 deletions

17
.editorconfig Normal file
View 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

2
.env
View File

@@ -1,5 +1,5 @@
APP_ENV=dev
APP_SECRET=
APP_SECRET=je_te_remplis_parce_que_tu_me_mets_des_messages_d_erreur
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"

3
.env.test Normal file
View File

@@ -0,0 +1,3 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'

20
.gitignore vendored
View File

@@ -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 ###

View File

@@ -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).

View File

@@ -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

View File

@@ -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", system-ui, sans-serif;
--font-caveat: "Caveat", cursive;
}

View File

@@ -25,6 +25,5 @@ services:
environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
volumes:
database_data:

View File

@@ -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"

304
composer.lock generated
View File

@@ -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",
@@ -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",

View File

@@ -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],
];

View 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

View File

@@ -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:

View 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'

View File

@@ -0,0 +1,2 @@
symfonycasts_tailwind:
input_css: '%kernel.project_dir%/assets/styles/app.css'

View File

@@ -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

View File

@@ -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,

View File

@@ -1,5 +1,8 @@
parameters:
images_directory: '%kernel.project_dir%/public/uploads/images'
services:
# configuration par défaut pour les services
# configuration par défaut pour les services
_defaults:
autowire: true # Injecte automatiquement les dépendances dans vos services.
autoconfigure: true # Enregistre automatiquement vos services en tant que commandes, abonnés d'événements, etc.
@@ -12,3 +15,8 @@ services:
$kazApiClient: '@kaz_api.client'
$apiUser: '%env(KAZ_API_USER)%'
$apiPassword: '%env(KAZ_API_PASSWORD)%'
# Gestion de l'enregistrement de la photo de profil
App\Service\FileUploader:
arguments:
$targetDirectory: '%images_directory%'

28
importmap.php Normal file
View 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',
],
];

View File

@@ -20,7 +20,7 @@ final class Version20260313151403 extends AbstractMigration
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 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, alternate_email 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)');

View File

@@ -20,12 +20,12 @@ final class Version20260316103235 extends AbstractMigration
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ALTER email_de_secours DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER alternate_email DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ALTER email_de_secours SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER alternate_email SET NOT NULL');
}
}

View File

@@ -24,7 +24,7 @@ final class Version20260316114715 extends AbstractMigration
$this->addSql('ALTER TABLE "user" ADD first_name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE "user" DROP lastname');
$this->addSql('ALTER TABLE "user" DROP firstname');
$this->addSql('ALTER TABLE "user" ALTER email_de_secours SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER alternate_email SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER identifiant_kaz SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER quota SET NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_nextcloud_access SET NOT NULL');
@@ -39,7 +39,7 @@ final class Version20260316114715 extends AbstractMigration
$this->addSql('ALTER TABLE "user" ADD firstname VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE "user" DROP last_name');
$this->addSql('ALTER TABLE "user" DROP first_name');
$this->addSql('ALTER TABLE "user" ALTER email_de_secours DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER alternate_email DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER identifiant_kaz DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER quota DROP NOT NULL');
$this->addSql('ALTER TABLE "user" ALTER has_nextcloud_access DROP NOT NULL');

View File

@@ -0,0 +1,31 @@
<?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 Version20260326214353 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('ALTER TABLE "user" ADD photo VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" DROP photo');
}
}

View File

@@ -0,0 +1,31 @@
<?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 Version20260326231417 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('ALTER TABLE "user" ADD telephone VARCHAR(20) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" DROP telephone');
}
}

View File

@@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260313104837 extends AbstractMigration
final class Version20260328101039 extends AbstractMigration
{
public function getDescription(): string
{
@@ -20,7 +20,8 @@ final class Version20260313104837 extends AbstractMigration
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE "user" (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, role VARCHAR(255) NOT NULL, mail VARCHAR(255) NOT NULL, mail_quota VARCHAR(255) NOT NULL, mail_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, PRIMARY KEY (id))');
$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, alternate_email 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, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255) NOT NULL, photo VARCHAR(255) DEFAULT NULL, telephone VARCHAR(20) DEFAULT 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)');
}

View File

@@ -0,0 +1,35 @@
<?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 Version20260328101220 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, alternate_email 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, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255) NOT NULL, photo VARCHAR(255) DEFAULT NULL, telephone VARCHAR(20) DEFAULT 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');
}
}

View File

@@ -0,0 +1,35 @@
<?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 Version20260329084928 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, alternate_email 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, last_name VARCHAR(255) NOT NULL, first_name VARCHAR(255) NOT NULL, photo VARCHAR(255) DEFAULT NULL, telephone VARCHAR(20) DEFAULT 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

File diff suppressed because it is too large Load Diff

View File

@@ -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"
}
}

View File

@@ -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&amp;charset=utf8"/>
<!-- ###- doctrine/doctrine-bundle ### -->
</php>
<testsuites>

View File

@@ -1,5 +0,0 @@
export default {
plugins: {
"@tailwindcss/postcss": {},
},
};

View File

@@ -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

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 71 KiB

View File

@@ -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');
}
}

View File

@@ -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.');
}
}

View File

@@ -2,10 +2,19 @@
namespace App\Controller;
use App\Form\ChangePasswordType;
use App\Form\UserProfileType;
use App\Service\FileUploader;
use App\Service\KazApiService;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormError;
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 +23,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 +36,126 @@ 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('/user/{email}', name: 'app_user_by_mail', methods: ['GET'])]
public function index(string $email, KazApiService $apiKazService): Response
{
$user = $apiKazService->getUserData($email);
return $this->render('user/profil_infos.html.twig', [
'user' => $user,
]);
}
/* TODO : Param l'API avec un Serializer pour la lecture du fichier JSON ? */
#[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();
$kazUser = $apiKazService->getUserData($user->getEmail());
$user = $user->updateFromKazUser($kazUser);
//TODO: modifier pour que ça communique avec l'API */
# Création du formulaire lié à l'utilisateur connecté
$form = $this->createForm(UserProfileType::class, $user);
$form->handleRequest($request);
# Traitement si l'utilisateur clique sur "Valider"
if ($form->isSubmitted() && $form->isValid()) {
/** @var UploadedFile $imageFile */
$imageFile = $form->get('image')->getData();
if ($imageFile) {
# Suppression de l'ancienne photo du serveur
$fileUploader->delete($user->getPhoto());
# Dépot de la nouvelle photo
$newFilename = $fileUploader->upload($imageFile);
# Mise à jour de l'utilisateur avec le nouveau nom
$user->setPhoto($newFilename);
}
$alternateEmail = $form->get('alternateEmail')->getData();
$regexEmail = '/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/';
if(isset($alternateEmail) && preg_match($regexEmail, $alternateEmail)) {
$user->setAlternateEmail($form->get('alternateEmail')->getData());
} else {
$alternateEmail->addError(new FormError('L\'adresse e-mail n\'est pas valide.'));
}
$telephone = $form->get('telephone')->getData();
$regexTelephone = '/^[0-9\+\s\.\-\(\)]+$/';
if(isset($telephone) && preg_match($regexTelephone, $telephone)) {
$user->setTelephone($telephone);
} else {
$telephone->addError(new FormError('Le numéro de téléphone n\'est pas valide.'));
}
# 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 !');
return $this->redirectToRoute('app_user');
}
# Affichage de la page
return $this->render('user/index.html.twig', [
'exist' => $exist,
'form' => $form->createView(),
'userData' => $user, # TODO : Mettre $userData quand connexion avec API OK
]);
}
#[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(),
]);
}
}

View File

@@ -29,33 +29,67 @@ class AppFixtures extends Fixture
for ($i = 0; $i < 10; $i++) {
# Instanciation d'un nouvel utilisateur (Adhérent)
$user = new User();
# Attribution d'un email aléatoire et unique
$user->setEmail($faker->unique()->safeEmail());
# Définition des droits d'accès de l'utilisateur
$user->setRoles(['ROLE_USER']);
$user->setRoles(['ROLE_USER', 'ROLE_ORGANISATION']);
# Hachage sécurisé du mot de passe "password"
$user->setPassword($this->hasher->hashPassword($user, 'password'));
# Définition d'un NOM et Prénom
$user->setFirstname($faker->firstName());
$user->setLastname($faker->lastName());
# autres fixtures à modifier plus tard
$user->setNextcloudQuota($faker->numberBetween(1, 20) . 'G');
$user->setQuota($faker->numberBetween(1, 10) . 'G');
$user->setEmailQuota('1G');
$user->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
$manager->persist($user);
}
// Création d'un compte de test fixe
$admin = new User();
$admin->setEmail('admin@kaz.bzh');
$admin->setRoles(['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ORGANISATION']);
$admin->setPassword($this->hasher->hashPassword($admin, 'password'));
$admin->setFirstName('Admin');
$admin->setLastName('KAZ');
// Remplissage des champs obligatoires restants pour éviter les erreurs SQL
$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
$melvin = new User();
$melvin->setEmail('melvin.leveque@kazkouil.fr');
$melvin->setRoles(['ROLE_USER', 'ROLE_ADMIN', 'ROLE_ORGANISATION']);
$melvin->setPassword($this->hasher->hashPassword($melvin, 'password'));
$melvin->setFirstName('');
$melvin->setLastName('');
$melvin->setAlternateEmail('');
$melvin->setIdentifiantKaz('MELVIN-KAZ-001');
$melvin->setQuota('5G');
$melvin->setEmailQuota('1G');
$melvin->setNextcloudQuota('10G');
$melvin->setHasNextcloudAccess(true);
$melvin->setHasMobilizon(true);
$melvin->setHasAgoraAccess(true);
$manager->persist($melvin);
# Exécution réelle des requêtes SQL (envoi vers la base), une fois la bouche finie
$manager->flush();
}

View File

@@ -3,20 +3,25 @@
namespace App\Entity;
use App\Repository\UserRepository;
use Doctrine\DBAL\Types\Types;
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,45 +30,56 @@ 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)]
private ?string $nextcloudQuota = '1G';
#[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)]
#[ORM\Column(length: 255, name: 'last_name')]
private ?string $lastName = null;
#[ORM\Column(length: 255)]
#[ORM\Column(length: 255, name: 'first_name')]
private ?string $firstName = null;
// TODO: Modifier "photo" par "image"
#[ORM\Column(length: 255, nullable: true, name: 'photo')]
private ?string $photo = null;
#[ORM\Column(length: 20, nullable: true, name: 'telephone')]
private ?string $telephone = null;
public function __construct() {
$this->emailQuota = self::EMAIL_QUOTA_DEFAULT;
}
public function getId(): ?Uuid
{
return $this->id;
@@ -104,9 +120,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 +134,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 +182,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;
}
@@ -265,4 +289,43 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): static
{
$this->photo = $photo;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(?string $telephone): static
{
$this->telephone = $telephone;
return $this;
}
public function updateFromKazUser($kazUser) : User
{
$this->setEmail($kazUser['mail']);
// Création du firstname et lastname
$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));
//TODO: Ajouter les champs manquants de l'objet User dans l'api kaz.
return $this;
}
}

View 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
]);
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace App\Form;
use App\Entity\User;
use Symfony\Component\Form\Extension\Core\Type\TelType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
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('email', EmailType::class, [
'label' => 'E-mail',
'disabled' => true,
])
->add('alternateEmail', EmailType::class, ['label' => 'E-mail de secours'])
->add('telephone', TelType::class, [
'label'=>'Téléphone',
'required' => false,
'attr' => [
'placeholder'=>'06 00 00 00 00',
'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 transition-shadow'
],
'constraints' => [
new Regex(
pattern: '/^[0-9\+\s\.\-\(\)]+$/',
message: 'Le numéro de téléphone contient des caractères non valides'
),
new Length(
max: 20,
maxMessage: 'Le numéro est trop long (maximum {{ limit }} caractères)'
),
],
])
->add('image', FileType::class, [
'label' => 'Ma photo de profil',
'mapped' => false,
'required' => false,
'constraints' => [
new Image(
maxSize: '2M',
extensions: ['jpg', 'jpeg', 'png'],
extensionsMessage: 'Veuillez déposer une image JPG, JPEG ou PNG valide',)
],
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => User::class,
]);
}
}

View File

@@ -0,0 +1,48 @@
<?php
namespace App\Service;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\String\Slugger\SluggerInterface;
class FileUploader
{
// On utilise la promotion de constructeur (PHP 8) : ultra moderne et concis
public function __construct(
private string $targetDirectory,
private SluggerInterface $slugger,
) {
}
public function upload(UploadedFile $file): string
{
$originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
$safeFilename = $this->slugger->slug($originalFilename);
$fileName = $safeFilename . '-' . uniqid() . '.' . $file->guessExtension();
try {
$file->move($this->getTargetDirectory(), $fileName);
} catch (FileException $e) {
// Ici tu peux logguer l'erreur si besoin
throw new \Exception('Erreur lors du transfert de l\'image : ' . $e->getMessage());
}
return $fileName;
}
public function delete(?string $fileName): void
{
if ($fileName) {
$filePath = $this->getTargetDirectory() . 'FileUploader.php/' . $fileName;
if (file_exists($filePath)) {
unlink($filePath);
}
}
}
public function getTargetDirectory(): string
{
return $this->targetDirectory;
}
}

View File

@@ -14,12 +14,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 +43,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']; // Ajustez la clé selon le format de votre API
return $this->token;
}
@@ -68,7 +72,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) {

View File

@@ -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": {

View File

@@ -1,11 +0,0 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./templates/**/*.html.twig",
"./assets/**/*.js",
],
theme: {
extend: {},
},
plugins: [],
}

View 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="#"
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>

View File

@@ -2,16 +2,94 @@
<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 %}
{% block importmap %}{{ importmap('app') }}{% endblock %}
{% endblock %}
</head>
<body>
{% 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 %}
<div class="flex items-center p-4 mb-4 rounded-lg border shadow-sm
{{ label == 'success' ? 'bg-green-50 border-green-200 text-green-800' :
label == 'error' ? 'bg-red-50 border-red-200 text-red-800' :
label == 'warning' ? 'bg-yellow-50 border-yellow-200 text-yellow-800' :
'bg-blue-50 border-blue-200 text-blue-800' }}"
role="alert">
{# Icône dynamique #}
<svg class="flex-shrink-0 w-5 h-5 mr-3" fill="currentColor" viewBox="0 0 20 20">
{% if label == 'success' %}
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path>
{% else %}
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"></path>
{% endif %}
</svg>
<div class="text-sm font-bold">
{{ message }}
</div>
{# Bouton Fermer #}
<button type="button"
onclick="this.parentElement.remove()"
class="text-lg font-bold hover:opacity-70 transition-opacity ml-4">
&times;
</button>
</div>
{% endfor %}
{% endfor %}
</div>
{# Contenu principal de chaque page #}
{% block body %}{% endblock %}
</main>
{# Gestion du pied-de-page du site #}
<footer class="bg-white border-t border-gris-clair py-6 sm:py-8 mt-auto w-full font-sora">
<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-4">
<div class="text-sm text-gris-fonce flex items-center gap-2 justify-center md:justify-start">
{# Logo de l'association #}
<img src="{{ asset('img/logo.svg') }}"
alt="Logo de l'association"
class="h-6 w-auto object-contain opacity-80 hover:opacity-100 transition-opacity">
{# Le texte et les liens #}
<span>
&copy; {{ 'now'|date('Y') }} | Kaz, le numérique sobre, libre, éthique et local.
</span>
</div>
<ul class="flex flex-wrap justify-center gap-4 sm:gap-6 text-sm text-gris-fonce">
<li>
<a href="https://kaz.bzh/mentions-legales/" class="hover:text-bouton transition-colors">Mentions légales et statuts</a>
</li>
<li>
<a href="https://status.kaz.bzh/status/kaz" class="hover:text-bouton transition-colors">Santé des services Kaz</a>
</li>
<li>
<a href="https://kaz.bzh/contact/" class="hover:text-bouton transition-colors">Contact</a>
</li>
</ul>
</div>
</footer>
</body>
</html>

View File

@@ -1 +0,0 @@
error404.html.twig

View 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 l'API
TODO : Gérer les données de l'API #}
<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">
Votre 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 #}
<span class="italic opacity-70">Ajouter la vraie valeur</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 #}
<span class="italic opacity-70">Ajouter la vraie valeur</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/" 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 %}

View File

@@ -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">
&copy; {{ 'now'|date('Y') }} | Kaz, le numérique sobre, libre, éthique et local.
</footer>
</body>
</html>

View File

@@ -0,0 +1,74 @@
{% 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-6 text-center">
Sécurité du compte
</h1>
{{ form_start(form) }}
<div class="space-y-4">
{# Champ Ancien Mot de Passe #}
<div class="space-y-1">
{{ form_label(form.oldPassword, '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'}
}) }}
{# 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-4 pt-2">
{# Affichage de l'erreur si les deux champs ne correspondent pas #}
<div class="text-red-500 text-xs italic">
{{ form_errors(form.newPassword) }}
</div>
<div class="space-y-1">
{{ form_label(form.newPassword.first, '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 transition-shadow'}
}) }}
{# Affichage de l'erreur de longueur (min 8 caractères) #}
<div class="text-red-500 text-xs mt-1 italic">
{{ form_errors(form.newPassword.first) }}
</div>
</div>
<div class="space-y-1">
{{ form_label(form.newPassword.second, 'Confirmer le 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 transition-shadow'}
}) }}
</div>
<div class="text-red-500 text-xs mt-1">
{{ form_errors(form.newPassword) }}
</div>
</div>
{# Bouton de validation #}
<button type="submit"
class="w-full bg-bouton hover:bg-bouton-hover text-text font-bold py-3 rounded-lg shadow-md transition-colors mt-6">
Mettre à jour mon mot de passe
</button>
</div>
{{ form_end(form) }}
</div>
</div>
{% endblock %}

View File

@@ -1,2 +1,135 @@
{# templates/hellp.html.twig #}
<h1>Hello ! {{ name }}</h1>
{% 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">
{{ form_start(form, {'attr': {'class': 'max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 grid md:grid-cols-3 gap-8'}}) }}
{# TODO: voir si c'est pertinent avec l'API et s'il y a l'utilité d'une photo de profil #}
{# Gestion de la colone avec le choix de la photo de profil #}
<div class="flex flex-col text-text items-center">
{# Affichage de la photo de profil #}
<div class="w-full md:w-64 flex-shrink-0 mt-20">
<div class="border-2 border-black p-1 bg-white shadow-[8px_8px_0px_0px_rgba(0,0,0,1)]">
{% if userData.photo %}
<img src="{{ asset('uploads/images/' ~ userData.photo) }}"
alt="Photo de profil"
class="w-full aspect-[4/3] object-cover">
{% else %}
<div class="w-full aspect-[4/3] bg-gray-50 flex items-center justify-center text-6xl">
👤
</div>
{% endif %}
</div>
</div>
<p class="text-2xl text-title font-caveat mt-4"> Ma photo</p>
{# Gestion du dépôt d'un fichier image #}
<div class="w-full mt-2">
{{ 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 file:cursor-pointer transition-colors',
'aria-describedby': 'file_input_help'
}
}) }}
<p class="mt-1 text-sm text-gris-moyen" id="file_input_help">
JPG, JPEG ou PNG (Taille max : 2Mo).
</p>
</div>
</div>
{# Gestion de la colonne avec les "infos persos" #}
<div class="md:col-span-2">
<h1 class="text-4xl font-caveat text-text mb-6 text-center sm:text-center">Mon profil</h1>
<h2 class="text-2xl font-caveat text-text mb-6 text-center sm:text-center">Mes informations personnelles</h2>
{# Gestion du formulaire qui regroupe toutes les infos perso #}
<div class="flex flex-col gap-6">
{# Champ NOM et Prénom #}
<div class="grid grid-cols-2 gap-4">
<div class="space-y-1">
{{ form_label(form.firstName, 'NOM :', {
'label_attr': {'class': 'block text-sm font-semibold text-text'}
}) }}
{{ form_widget(form.firstName, {
'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'}
}) }}
{# Implémentation d'un message d'errer en cas de problème #}
<div class="text-red-500 text-xs mt-1 italic font-sora">
{{ form_errors(form.firstName) }}
</div>
</div>
<div class="space-y-1">
{{ form_label(form.lastName, 'Prénom :', {
'label_attr': {'class': 'block text-sm font-semibold text-text'}
}) }}
{{ form_widget(form.lastName, {
'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'}
}) }}
{# Implémentation d'un message d'errer en cas de problème #}
<div class="text-red-500 text-xs mt-1 italic font-sora">
{{ form_errors(form.lastName) }}
</div>
</div>
</div>
{# Champ Téléphone #}
<div class="space-y-1">
{{ form_label(form.telephone, 'Numéro de téléphone', {
'label_attr': {'class': 'block text-sm font-semibold text-text'}
}) }}
{{ form_widget(form.telephone) }}
{# Implémentation d'un message d'errer en cas de problème #}
<div class="text-red-500 text-xs mt-1 italic">
{{ form_errors(form.telephone) }}
</div>
</div>
{# Champ E-mail #}
<div class="space-y-1">
{{ form_label(form.email, 'E-mail :', {
'label_attr': {'class': 'block text-sm font-semibold text-text'}
}) }}
{{ form_widget(form.email, {
'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'}
}) }}
{# Implémentation d'un message d'errer en cas de problème #}
<div class="text-red-500 text-xs mt-1 italic font-sora">
{{ form_errors(form.email) }}
</div>
</div>
{# Champ E-mail de secours #}
<div class="space-y-1">
{{ form_label(form.alternateEmail, 'E-mail de secours :', {
'label_attr': {'class': 'block text-sm font-semibold text-text'}
}) }}
{{ form_widget(form.alternateEmail, {
'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'}
}) }}
{# Implémentation d'un message d'errer en cas de problème #}
<div class="text-red-500 text-xs mt-1 italic font-sora">
{{ form_errors(form.alternateEmail) }}
</div>
</div>
<div class="flex flex-col sm:flex-row gap-4 pt-2">
<button type="submit"
class="flex-1 py-3 bg-bouton hover:bg-bouton-hover text-text font-bold rounded-lg shadow transition-colors">
Valider
</button>
</div>
</div>
</div>
{{ form_end(form) }}
</div>
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% 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>
<span>Identifiant : {{ user.identifiantKaz }}</span>
</div>
</div>
{% endblock %}

0
translations/.gitignore vendored Normal file
View File

View File

@@ -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();