Compare commits

...

10 Commits

Author SHA1 Message Date
b3e2b0c81a add extracted translations 2024-07-16 11:57:39 +02:00
6857cad565 add active class for nav 2024-07-16 11:44:30 +02:00
9a6405e418 account infos 2024-07-16 11:04:21 +02:00
0e9cc0b912 add more structure in base template 2024-07-16 10:58:47 +02:00
6aa77329e6 feat: adds nav on account page 2024-07-16 10:54:05 +02:00
17af3ac345 add readme 2024-07-16 10:13:21 +02:00
e1be9d613f 🎨 feat: add Vuejs, TS and SCSS support, basic style 2024-07-16 10:12:02 +02:00
b9babc7dc6 add register form 2024-07-15 23:23:27 +02:00
c34a2c16d9 fix login screen 2024-07-15 23:09:52 +02:00
c55d5766b1 add templates for account 2024-07-15 23:04:23 +02:00
53 changed files with 8230 additions and 79 deletions

8
.env
View File

@ -39,5 +39,11 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
###< symfony/messenger ###
###> symfony/mailer ###
# MAILER_DSN=null://null
MAILER_DSN=null://null
###< symfony/mailer ###
###> symfony/lock ###
# Choose one of the stores below
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=flock
###< symfony/lock ###

7
.gitignore vendored
View File

@ -22,3 +22,10 @@
###> phpstan/phpstan ###
phpstan.neon
###< phpstan/phpstan ###
###> symfony/webpack-encore-bundle ###
/node_modules/
/public/build/
npm-debug.log
yarn-error.log
###< symfony/webpack-encore-bundle ###

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# Symfony avec compte utilisateur intégré
Cette version du framework Symfony inclut une gestion des utilisateurs par défaut.
Fonctionne avec node 18+, yarn, et une config .env.

23
assets/app.js Normal file
View File

@ -0,0 +1,23 @@
/*
* Welcome to your app's main JavaScript file!
*
* We recommend including the built version of this JavaScript file
* (and its CSS file) in your base layout (base.html.twig).
*/
// any CSS you import will output into a single css file (app.css in this case)
import './styles/app.scss';
// start the Stimulus application
import './bootstrap';
export default {
name: 'App',
render() {
return (
<div>
Appli VueJS
</div>
)
}
}

11
assets/bootstrap.js vendored Normal file
View File

@ -0,0 +1,11 @@
import { startStimulusApp } from '@symfony/stimulus-bridge';
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context(
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.[jt]sx?$/
));
// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);

4
assets/controllers.json Normal file
View File

@ -0,0 +1,4 @@
{
"controllers": [],
"entrypoints": []
}

View File

@ -0,0 +1,16 @@
import { Controller } from '@hotwired/stimulus';
/*
* This is an example Stimulus controller!
*
* Any element with a data-controller="hello" attribute will cause
* this controller to be executed. The name "hello" comes from the filename:
* hello_controller.js -> "hello"
*
* Delete this file or adapt it for your use!
*/
export default class extends Controller {
connect() {
this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js';
}
}

View File

@ -0,0 +1,20 @@
#account_main{
display: flex;
#account_nav{
width: 20rem;
padding: 1rem;
ul{
list-style-type: none;
margin-right: 1rem;
li{
margin-bottom: 0.25rem;
a{
display: block;
}
}
}
}
#account_main_content{
width: 30rem;
}
}

View File

@ -0,0 +1,29 @@
.clickable{
cursor:pointer;
}
a{
@extend .clickable;
padding: 0.5rem 1rem;
display: inline-block;
color: $primary_color;
text-decoration: none;
border: solid 1px $bg_color;
&:hover{
color: $primary_color_darker;
}
&.active{
background: $bg_active_link;
color: $active_link_text;
}
}
button{
@extend .clickable;
padding: 1rem 2rem;
border: solid 1px $bg_color;
background: $primary_color;
border-radius: 0.25rem;
&:hover{
background: $primary_color_darker;
}
}

30
assets/styles/_forms.scss Normal file
View File

@ -0,0 +1,30 @@
form {
label {
min-width: 15rem;
display: inline-block;
height: 1.5rem;
}
input {
&[type="checkbox"] {
width: 1.5rem;
height: 1.5rem;
margin-left: 0rem;
}
&[type="text"],
&[type="number"],
{
min-height: 1.5rem;
margin-top: 0.5rem;
margin-bottom: 0.5rem;
}
}
button {
&[type="submit"] {
float: right;
margin-top: 2rem;
}
}
}

View File

@ -0,0 +1,12 @@
body {
background-color: $bg_color;
font-family: "Calibri", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
#main_content{
margin: 0 auto;
padding: 2rem 4rem;
min-width: 40rem;
max-width: 60rem;
min-height: 100vh;
background-color: $bg_main_color;
}

7
assets/styles/_nav.scss Normal file
View File

@ -0,0 +1,7 @@
#nav_menu{
padding: 0.5rem;
border-bottom: solid 1px $bg_color;
a{
margin-right: 1rem;
}
}

View File

@ -0,0 +1,6 @@
$bg_color:lightgray;
$bg_main_color: white;
$primary_color: #98c87e;
$primary_color_darker: #537b3d;
$bg_active_link: $primary_color_darker;
$active_link_text: white;

8
assets/styles/app.scss Normal file
View File

@ -0,0 +1,8 @@
@import 'variables';
@import 'global';
@import 'nav';
@import 'account';
@import 'forms';
@import 'clickables';

View File

@ -7,6 +7,7 @@
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"amphp/http-client": "^4.2.1",
"doctrine/dbal": "^3",
"doctrine/doctrine-bundle": "^2.12",
"doctrine/doctrine-migrations-bundle": "^3.3",
@ -30,6 +31,7 @@
"symfony/process": "6.1.*",
"symfony/property-access": "6.1.*",
"symfony/property-info": "6.1.*",
"symfony/rate-limiter": "6.1.*",
"symfony/runtime": "6.1.*",
"symfony/security-bundle": "6.1.*",
"symfony/serializer": "6.1.*",
@ -38,7 +40,9 @@
"symfony/twig-bundle": "6.1.*",
"symfony/validator": "6.1.*",
"symfony/web-link": "6.1.*",
"symfony/webpack-encore-bundle": "^1.17",
"symfony/yaml": "6.1.*",
"symfonycasts/verify-email-bundle": "^1.17",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
},

1656
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -11,4 +11,6 @@ return [
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
];

View File

@ -1,7 +1,8 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
secret: '%env(APP_SECRET)%'
#csrf_protection: true
ide: 'myide://open?url=file://%%f&line=%%l'
csrf_protection: true
http_method_override: false
# Enables session support. Note that the session will ONLY be started if you read or write from it.
@ -22,3 +23,4 @@ when@test:
test: true
session:
storage_factory_id: session.storage.factory.mock_file

View File

@ -0,0 +1,2 @@
framework:
lock: '%env(LOCK_DSN)%'

View File

@ -1,4 +1,7 @@
security:
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH ]
# https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords
password_hashers:
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
@ -16,18 +19,42 @@ security:
main:
lazy: true
provider: app_user_provider
# by default, the feature allows 5 login attempts per minute
# login_throttling: null
remember_me:
secret: '%kernel.secret%' # required
lifetime: 604800 # 1 week in seconds
# by default, the feature is enabled by checking a
# checkbox in the login form (see below), uncomment the
# following line to always enable it.
#always_remember_me: true
# configure the maximum login attempts
login_throttling:
max_attempts: 3 # per minute ...
interval: '5 minutes' # ... or in a custom period
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#the-firewall
# https://symfony.com/doc/current/security/impersonating_user.html
switch_user: true
form_login:
login_path: app_login
check_path: app_login
enable_csrf: true
logout:
path: app_logout
# where to redirect after logout
# target: app_any_route
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
# - { path: ^/admin, roles: ROLE_ADMIN }
# - { path: ^/profile, roles: ROLE_USER }
- { path: ^/admin, roles: ROLE_ADMIN }
- { path: ^/profile, roles: ROLE_USER }
- { path: ^/account, roles: ROLE_USER }
when@test:
security:

View File

@ -1,5 +1,5 @@
framework:
default_locale: en
default_locale: fr
translator:
default_path: '%kernel.project_dir%/translations'
fallbacks:

View File

@ -0,0 +1,45 @@
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

@ -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 Version20240715211713 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 is_verified TINYINT(1) 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` DROP is_verified');
}
}

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 Version20240716084111 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
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}

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 Version20240716092119 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 last_login DATE 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 last_login');
}
}

31
package.json Normal file
View File

@ -0,0 +1,31 @@
{
"devDependencies": {
"@babel/core": "^7.17.0",
"@babel/preset-env": "^7.16.0",
"@hotwired/stimulus": "^3.0.0",
"@symfony/stimulus-bridge": "^3.2.0",
"@symfony/webpack-encore": "^4.0.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
"@vue/babel-preset-jsx": "^1.4.0",
"core-js": "^3.23.0",
"regenerator-runtime": "^0.13.9",
"sass": "^1.77.8",
"sass-loader": "^14.0.0",
"ts-loader": "^9.0.0",
"typescript": "^5.5.3",
"vue": "^2.5",
"vue-loader": "^15.9.5",
"vue-template-compiler": "^2.7.16",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"webpack-notifier": "^1.15.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class AccountController extends AbstractController
{
#[Route('/account', name: 'app_account')]
public function index(): Response
{
return $this->render('account/index.html.twig', [
'controller_name' => 'AccountController',
]);
}
/***
page d'exemple
**/
#[Route('/account/history', name: 'app_account_history')]
public function history(): Response
{
return $this->render('account/history.html.twig', [
]);
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class IndexController extends AbstractController
{
#[Route('/', name: 'app_index')]
public function index(): Response
{
return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController',
]);
}
}

View File

@ -0,0 +1,84 @@
<?php
namespace App\Controller;
use App\Entity\User;
use App\Form\RegistrationFormType;
use App\Security\EmailVerifier;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Mime\Address;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface;
use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface;
class RegistrationController extends AbstractController
{
private EmailVerifier $emailVerifier;
public function __construct(EmailVerifier $emailVerifier)
{
$this->emailVerifier = $emailVerifier;
}
#[Route('/register', name: 'app_register')]
public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, EntityManagerInterface $entityManager): Response
{
$user = new User();
$form = $this->createForm(RegistrationFormType::class, $user);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
// encode the plain password
$user->setPassword(
$userPasswordHasher->hashPassword(
$user,
$form->get('plainPassword')->getData()
)
);
$entityManager->persist($user);
$entityManager->flush();
// generate a signed url and email it to the user
$this->emailVerifier->sendEmailConfirmation('app_verify_email', $user,
(new TemplatedEmail())
->from(new Address('mailer-noreply@cipherbliss.com', 'Cipherbliss Registration Service Bot'))
->to($user->getEmail())
->subject('Please Confirm your Email')
->htmlTemplate('registration/confirmation_email.html.twig')
);
// do anything else you need here, like send an email
return $this->redirectToRoute('app_account');
}
return $this->render('registration/register.html.twig', [
'registrationForm' => $form->createView(),
]);
}
#[Route('/verify/email', name: 'app_verify_email')]
public function verifyUserEmail(Request $request, TranslatorInterface $translator): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
// validate email confirmation link, sets User::isVerified=true and persists
try {
$this->emailVerifier->handleEmailConfirmation($request, $this->getUser());
} catch (VerifyEmailExceptionInterface $exception) {
$this->addFlash('verify_email_error', $translator->trans($exception->getReason(), [], 'VerifyEmailBundle'));
return $this->redirectToRoute('app_register');
}
// @TODO Change the redirect on success and handle or remove the flash message in your templates
$this->addFlash('success', 'Your email address has been verified.');
return $this->redirectToRoute('app_register');
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController
{
#[Route(path: '/login', name: 'app_login')]
public function login(AuthenticationUtils $authenticationUtils): Response
{
// get the login error if there is one
$error = $authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $authenticationUtils->getLastUsername();
return $this->render('security/login.html.twig', [
'last_username' => $lastUsername,
'error' => $error,
]);
}
#[Route(path: '/logout', name: 'app_logout')]
public function logout(): void
{
throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
}
}

View File

@ -3,12 +3,15 @@
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;
#[ORM\Entity(repositoryClass: UserRepository::class)]
#[ORM\Table(name: '`user`')]
#[UniqueEntity(fields: ['email'], message: 'There is already an account with this email')]
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
#[ORM\Id]
@ -19,6 +22,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(length: 180, unique: true)]
private ?string $email = null;
#[ORM\Column]
private array $roles = [];
@ -28,6 +32,15 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column]
private ?string $password = null;
#[ORM\Column(type: 'boolean')]
private $isVerified = false;
#[ORM\Column(length: 500, nullable: true)]
private ?string $description = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $last_login = null;
public function getId(): ?int
{
return $this->id;
@ -97,4 +110,40 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
public function isVerified(): bool
{
return $this->isVerified;
}
public function setIsVerified(bool $isVerified): static
{
$this->isVerified = $isVerified;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): static
{
$this->description = $description;
return $this;
}
public function getLastLogin(): ?\DateTimeInterface
{
return $this->last_login;
}
public function setLastLogin(?\DateTimeInterface $last_login): static
{
$this->last_login = $last_login;
return $this;
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace App\Form;
use App\Entity\User;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\IsTrue;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
class RegistrationFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email')
->add('agreeTerms', CheckboxType::class, [
'mapped' => false,
'constraints' => [
new IsTrue([
'message' => 'You should agree to our terms.',
]),
],
])
->add('plainPassword', PasswordType::class, [
// instead of being set onto the object directly,
// this is read and encoded in the controller
'mapped' => false,
'attr' => ['autocomplete' => 'new-password'],
'constraints' => [
new NotBlank([
'message' => 'Please enter a password',
]),
new Length([
'min' => 6,
'minMessage' => 'Your password should be at least {{ limit }} characters',
// max length allowed by Symfony for security reasons
'max' => 4096,
]),
],
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => User::class,
]);
}
}

View File

@ -40,28 +40,4 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
$this->getEntityManager()->flush();
}
// /**
// * @return User[] Returns an array of User objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('u')
// ->andWhere('u.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('u.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?User
// {
// return $this->createQueryBuilder('u')
// ->andWhere('u.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Security;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface;
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface;
class EmailVerifier
{
public function __construct(
private VerifyEmailHelperInterface $verifyEmailHelper,
private MailerInterface $mailer,
private EntityManagerInterface $entityManager
) {
}
public function sendEmailConfirmation(string $verifyEmailRouteName, UserInterface $user, TemplatedEmail $email): void
{
$signatureComponents = $this->verifyEmailHelper->generateSignature(
$verifyEmailRouteName,
$user->getId(),
$user->getEmail()
);
$context = $email->getContext();
$context['signedUrl'] = $signatureComponents->getSignedUrl();
$context['expiresAtMessageKey'] = $signatureComponents->getExpirationMessageKey();
$context['expiresAtMessageData'] = $signatureComponents->getExpirationMessageData();
$email->context($context);
$this->mailer->send($email);
}
/**
* @throws VerifyEmailExceptionInterface
*/
public function handleEmailConfirmation(Request $request, UserInterface $user): void
{
$this->verifyEmailHelper->validateEmailConfirmation($request->getUri(), $user->getId(), $user->getEmail());
$user->setIsVerified(true);
$this->entityManager->persist($user);
$this->entityManager->flush();
}
}

View File

@ -107,6 +107,18 @@
"src/Kernel.php"
]
},
"symfony/lock": {
"version": "6.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "5.2",
"ref": "8e937ff2b4735d110af1770f242c1107fdab4c8e"
},
"files": [
"config/packages/lock.yaml"
]
},
"symfony/mailer": {
"version": "6.1",
"recipe": {
@ -255,6 +267,28 @@
"config/routes/web_profiler.yaml"
]
},
"symfony/webpack-encore-bundle": {
"version": "1.17",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "1.10",
"ref": "eff2e505d4557c967b6710fe06bd947ba555cae5"
},
"files": [
"assets/app.js",
"assets/bootstrap.js",
"assets/controllers.json",
"assets/controllers/hello_controller.js",
"assets/styles/app.css",
"config/packages/webpack_encore.yaml",
"package.json",
"webpack.config.js"
]
},
"symfonycasts/verify-email-bundle": {
"version": "v1.17.0"
},
"twig/extra-bundle": {
"version": "v3.8.0"
}

View File

@ -0,0 +1,16 @@
{% extends 'base.html.twig' %}
{% block title %}Votre compte{% endblock %}
{% block body %}
<div id="account_main">
<div id="account_nav">
{% include 'account/nav.html.twig' %}
</div>
<div id="account_main_content">
{% block account_body %}{% endblock %}
</div>
</div>
{% endblock body %}

View File

@ -0,0 +1,22 @@
{% extends 'account/base.html.twig' %}
{% block title %}Votre historique{% endblock %}
{% block account_body %}
<div id="account_history">
<h1>
Mon compte
</h1>
<p>
Page historique
</p>
<article>
<h1>Votre historique d'actions</h1>
<p>
Blah blah blah.
</p>
</article>
</div>
</div>
{% endblock account_body %}

View File

@ -0,0 +1,28 @@
{% extends 'account/base.html.twig' %}
{% block title %}Votre compte{% endblock %}
{% block account_body %}
<div id="account_home">
<h1>
Tableau de bord
</h1>
<a href="{{ path('app_account') }}">modifier mes informations (todo)</a>
<p>
Coucou {{ app.user.email }}!
</p>
<p>
Votre description:
{{ app.user.description }}
</p>
<footer>
<p>
<a href="{{ path('app_logout') }}">Logout</a>
</p>
</footer>
</div>
</div>
{% endblock account_body %}

View File

@ -0,0 +1,17 @@
<menu>
{# Navigation de l'espace utilisateur #}
<ul>
<li>
<a href="{{ path('app_account') }}">
Tableau de bord
</a>
</li>
<li>
<a href="{{ path('app_account_history') }}">
Historique
</a>
</li>
<li>un autre</li>
<li>un bidule</li>
</ul>
</menu>

View File

@ -1,9 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<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></svg>">
<title>{% block title %}Bienvenu!{% 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></svg>">
{# Run `composer require symfony/webpack-encore-bundle` to start using Symfony UX #}
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
@ -12,8 +13,20 @@
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock %}
</head>
<body>
</head>
<body>
<div id="main_content">
<div id="main_header">
{% block header %}
{% include 'common/nav.html.twig' %}
{% endblock %}
</div>
<div id="main_body">
{% block body %}{% endblock %}
</body>
</div>
<div id="main_footer">
{% block footer %}{% endblock %}
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,23 @@
{% set currentRoute = app.request.attributes.get('_route') %}
<div id="nav_menu">
<nav>
<div class="mb-3">
<a href="{{ path('app_index') }}"
class="{% if currentRoute == 'app_index' %}active{% endif %}"
>{{ 'common.homepage'|trans }}</a>
{% if app.user %}
<a
class="account-link {% if currentRoute == 'app_account' %}active{% endif %}"
href="{{ path('app_account') }}">{{ app.user.userIdentifier }}</a>
<a href="{{ path('app_logout') }}">{{ 'user.logout'|trans }}</a>
{% else %}
<a class="account-link {% if currentRoute == 'app_login' %}active{% endif %}"
href="{{ path('app_login') }}">{{ 'user.login'|trans }}</a>
<a class="account-link {% if currentRoute == 'app_register' %}active{% endif %}"
href="{{ path('app_register') }}">{{ 'user.register'|trans }}</a>
{% endif %}
</div>
{# <a href="{{path('admin')}}">Admin</a> #}
</nav>
</div>

View File

@ -0,0 +1,12 @@
{% extends 'base.html.twig' %}
{% block title %}Hello IndexController!{% endblock %}
{% block body %}
<div class="example-wrapper">
<h1>{{ 'pages.app_index.title'|trans }}</h1>
<p>
{{ 'pages.app_index.subtitle'|trans }}
</p>
</div>
{% endblock %}

View File

@ -0,0 +1,11 @@
<h1>Hi! Please confirm your email!</h1>
<p>
Please confirm your email address by clicking the following link: <br><br>
<a href="{{ signedUrl|raw }}">Confirm my Email</a>.
This link will expire in {{ expiresAtMessageKey|trans(expiresAtMessageData, 'VerifyEmailBundle') }}.
</p>
<p>
Cheers!
</p>

View File

@ -0,0 +1,23 @@
{% extends 'base.html.twig' %}
{% block title %}Register{% endblock %}
{% block body %}
{% for flash_error in app.flashes('verify_email_error') %}
<div class="alert alert-danger" role="alert">{{ flash_error }}</div>
{% endfor %}
<h1>Register</h1>
{{ form_errors(registrationForm) }}
{{ form_start(registrationForm) }}
{{ form_row(registrationForm.email) }}
{{ form_row(registrationForm.plainPassword, {
label: 'Password'
}) }}
{{ form_row(registrationForm.agreeTerms) }}
<button type="submit" class="btn">Register</button>
{{ form_end(registrationForm) }}
{% endblock %}

View File

@ -0,0 +1,49 @@
{% extends 'base.html.twig' %}
{% block title %}Log in!{% endblock %}
{% block body %}
<form method="post">
{% if error %}
<div class="alert alert-danger">{{ 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="{{ path('app_logout') }}">Logout</a>
</div>
{% endif %}
<h1 class="h3 mb-3 font-weight-normal">Please sign in</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">Password</label>
<input type="password" name="_password" id="password" class="form-control" autocomplete="current-password" required>
<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"
>
{#
Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
See https://symfony.com/doc/current/security/remember_me.html
<div class="checkbox mb-3">
<label>
<input type="checkbox" name="_remember_me"> Remember me
</label>
</div>
#}
{#
If you want to control the URL the user is redirected to on success
#}
<input type="hidden" name="_target_path" value="/account">
<label>
<input type="checkbox" name="_remember_me" checked>
Keep me logged in
</label>
<button class="btn btn-lg btn-primary" type="submit">
Sign in
</button>
</form>
{% endblock %}

View File

@ -0,0 +1,10 @@
common:
homepage: Homepage
pages:
app_index:
title: 'Greetings noble barbarian!'
subtitle: 'Welcome to this Symfony application able to manage a user space.'
user:
login: 'Log in'
logout: 'Sign out'
register: 'Create an account'

View File

@ -0,0 +1,10 @@
common:
homepage: Accueil
pages:
app_index:
title: 'Salutations noble barbare!'
subtitle: 'Bienvenue dans cette application Symfony capable de gérer un espace utilisateur.'
user:
login: Login
logout: 'Se déconnecter'
register: 'Créer un compte'

View File

@ -0,0 +1,38 @@
'An authentication exception occurred':
'': 'An authentication exception occurred.'
'Authentication credentials could not be found':
'': 'Authentication credentials could not be found.'
'Authentication request could not be processed due to a system problem':
'': 'Authentication request could not be processed due to a system problem.'
'Invalid credentials':
'': 'Invalid credentials.'
'Cookie has already been used by someone else':
'': 'Cookie has already been used by someone else.'
'Not privileged to request the resource':
'': 'Not privileged to request the resource.'
'Invalid CSRF token':
'': 'Invalid CSRF token.'
'No authentication provider found to support the authentication token':
'': 'No authentication provider found to support the authentication token.'
'No session available, it either timed out or cookies are not enabled':
'': 'No session available, it either timed out or cookies are not enabled.'
'No token could be found':
'': 'No token could be found.'
'Username could not be found':
'': 'Username could not be found.'
'Account has expired':
'': 'Account has expired.'
'Credentials have expired':
'': 'Credentials have expired.'
'Account is disabled':
'': 'Account is disabled.'
'Account is locked':
'': 'Account is locked.'
'Too many failed login attempts, please try again later':
'': 'Too many failed login attempts, please try again later.'
'Invalid or expired login link':
'': 'Invalid or expired login link.'
'Too many failed login attempts, please try again in %minutes% minute':
'': 'Too many failed login attempts, please try again in %minutes% minute.'
'Too many failed login attempts, please try again in %minutes% minutes':
'': 'Too many failed login attempts, please try again in %minutes% minutes.'

View File

@ -0,0 +1,38 @@
'An authentication exception occurred':
'': "Une exception d'authentification s'est produite."
'Authentication credentials could not be found':
'': "Les identifiants d'authentification n'ont pas pu être trouvés."
'Authentication request could not be processed due to a system problem':
'': "La requête d'authentification n'a pas pu être executée à cause d'un problème système."
'Invalid credentials':
'': 'Identifiants invalides.'
'Cookie has already been used by someone else':
'': "Le cookie a déjà été utilisé par quelqu'un d'autre."
'Not privileged to request the resource':
'': 'Privilèges insuffisants pour accéder à la ressource.'
'Invalid CSRF token':
'': 'Jeton CSRF invalide.'
'No authentication provider found to support the authentication token':
'': "Aucun fournisseur d'authentification n'a été trouvé pour supporter le jeton d'authentification."
'No session available, it either timed out or cookies are not enabled':
'': 'Aucune session disponible, celle-ci a expiré ou les cookies ne sont pas activés.'
'No token could be found':
'': "Aucun jeton n'a pu être trouvé."
'Username could not be found':
'': "Le nom d'utilisateur n'a pas pu être trouvé."
'Account has expired':
'': 'Le compte a expiré.'
'Credentials have expired':
'': 'Les identifiants ont expiré.'
'Account is disabled':
'': 'Le compte est désactivé.'
'Account is locked':
'': 'Le compte est bloqué.'
'Too many failed login attempts, please try again later':
'': 'Plusieurs tentatives de connexion ont échoué, veuillez réessayer plus tard.'
'Invalid or expired login link':
'': 'Lien de connexion invalide ou expiré.'
'Too many failed login attempts, please try again in %minutes% minute':
'': 'Plusieurs tentatives de connexion ont échoué, veuillez réessayer dans %minutes% minute.'
'Too many failed login attempts, please try again in %minutes% minutes':
'': 'Plusieurs tentatives de connexion ont échoué, veuillez réessayer dans %minutes% minutes.'

View File

@ -0,0 +1,287 @@
'This value should be false':
'': 'This value should be false.'
'This value should be true':
'': 'This value should be true.'
'This value should be of type {{ type }}':
'': 'This value should be of type {{ type }}.'
'This value should be blank':
'': 'This value should be blank.'
'The value you selected is not a valid choice':
'': 'The value you selected is not a valid choice.'
'You must select at least {{ limit }} choice':
'|You must select at least {{ limit }} choices':
'': 'You must select at least {{ limit }} choice.|You must select at least {{ limit }} choices.'
'You must select at most {{ limit }} choice':
'|You must select at most {{ limit }} choices':
'': 'You must select at most {{ limit }} choice.|You must select at most {{ limit }} choices.'
'One or more of the given values is invalid':
'': 'One or more of the given values is invalid.'
'This field was not expected':
'': 'This field was not expected.'
'This field is missing':
'': 'This field is missing.'
'This value is not a valid date':
'': 'This value is not a valid date.'
'This value is not a valid datetime':
'': 'This value is not a valid datetime.'
'This value is not a valid email address':
'': 'This value is not a valid email address.'
'The file could not be found':
'': 'The file could not be found.'
'The file is not readable':
'': 'The file is not readable.'
'The file is too large ({{ size }} {{ suffix }})':
' Allowed maximum size is {{ limit }} {{ suffix }}':
'': 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.'
'The mime type of the file is invalid ({{ type }})':
' Allowed mime types are {{ types }}':
'': 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.'
'This value should be {{ limit }} or less':
'': 'This value should be {{ limit }} or less.'
'This value is too long':
' It should have {{ limit }} character or less':
'|This value is too long': { ' It should have {{ limit }} characters or less': { '': 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.' } }
'This value should be {{ limit }} or more':
'': 'This value should be {{ limit }} or more.'
'This value is too short':
' It should have {{ limit }} character or more':
'|This value is too short': { ' It should have {{ limit }} characters or more': { '': 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.' } }
'This value should not be blank':
'': 'This value should not be blank.'
'This value should not be null':
'': 'This value should not be null.'
'This value should be null':
'': 'This value should be null.'
'This value is not valid':
'': 'This value is not valid.'
'This value is not a valid time':
'': 'This value is not a valid time.'
'This value is not a valid URL':
'': 'This value is not a valid URL.'
'The two values should be equal':
'': 'The two values should be equal.'
'The file is too large':
' Allowed maximum size is {{ limit }} {{ suffix }}':
'': 'The file is too large. Allowed maximum size is {{ limit }} {{ suffix }}.'
'': 'The file is too large.'
'The file could not be uploaded':
'': 'The file could not be uploaded.'
'This value should be a valid number':
'': 'This value should be a valid number.'
'This file is not a valid image':
'': 'This file is not a valid image.'
'This is not a valid IP address':
'': 'This is not a valid IP address.'
'This value is not a valid language':
'': 'This value is not a valid language.'
'This value is not a valid locale':
'': 'This value is not a valid locale.'
'This value is not a valid country':
'': 'This value is not a valid country.'
'This value is already used':
'': 'This value is already used.'
'The size of the image could not be detected':
'': 'The size of the image could not be detected.'
'The image width is too big ({{ width }}px)':
' Allowed maximum width is {{ max_width }}px':
'': 'The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.'
'The image width is too small ({{ width }}px)':
' Minimum width expected is {{ min_width }}px':
'': 'The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.'
'The image height is too big ({{ height }}px)':
' Allowed maximum height is {{ max_height }}px':
'': 'The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.'
'The image height is too small ({{ height }}px)':
' Minimum height expected is {{ min_height }}px':
'': 'The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.'
"This value should be the user's current password":
'': "This value should be the user's current password."
'This value should have exactly {{ limit }} character':
'|This value should have exactly {{ limit }} characters':
'': 'This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.'
'The file was only partially uploaded':
'': 'The file was only partially uploaded.'
'No file was uploaded':
'': 'No file was uploaded.'
'No temporary folder was configured in php':
ini:
'': 'No temporary folder was configured in php.ini, or the configured folder does not exist.'
'Cannot write temporary file to disk':
'': 'Cannot write temporary file to disk.'
'A PHP extension caused the upload to fail':
'': 'A PHP extension caused the upload to fail.'
'This collection should contain {{ limit }} element or more':
'|This collection should contain {{ limit }} elements or more':
'': 'This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.'
'This collection should contain {{ limit }} element or less':
'|This collection should contain {{ limit }} elements or less':
'': 'This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.'
'This collection should contain exactly {{ limit }} element':
'|This collection should contain exactly {{ limit }} elements':
'': 'This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.'
'Invalid card number':
'': 'Invalid card number.'
'Unsupported card type or invalid card number':
'': 'Unsupported card type or invalid card number.'
'This is not a valid International Bank Account Number (IBAN)':
'': 'This is not a valid International Bank Account Number (IBAN).'
'This value is not a valid ISBN-10':
'': 'This value is not a valid ISBN-10.'
'This value is not a valid ISBN-13':
'': 'This value is not a valid ISBN-13.'
'This value is neither a valid ISBN-10 nor a valid ISBN-13':
'': 'This value is neither a valid ISBN-10 nor a valid ISBN-13.'
'This value is not a valid ISSN':
'': 'This value is not a valid ISSN.'
'This value is not a valid currency':
'': 'This value is not a valid currency.'
'This value should be equal to {{ compared_value }}':
'': 'This value should be equal to {{ compared_value }}.'
'This value should be greater than {{ compared_value }}':
'': 'This value should be greater than {{ compared_value }}.'
'This value should be greater than or equal to {{ compared_value }}':
'': 'This value should be greater than or equal to {{ compared_value }}.'
'This value should be identical to {{ compared_value_type }} {{ compared_value }}':
'': 'This value should be identical to {{ compared_value_type }} {{ compared_value }}.'
'This value should be less than {{ compared_value }}':
'': 'This value should be less than {{ compared_value }}.'
'This value should be less than or equal to {{ compared_value }}':
'': 'This value should be less than or equal to {{ compared_value }}.'
'This value should not be equal to {{ compared_value }}':
'': 'This value should not be equal to {{ compared_value }}.'
'This value should not be identical to {{ compared_value_type }} {{ compared_value }}':
'': 'This value should not be identical to {{ compared_value_type }} {{ compared_value }}.'
'The image ratio is too big ({{ ratio }})':
' Allowed maximum ratio is {{ max_ratio }}':
'': 'The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.'
'The image ratio is too small ({{ ratio }})':
' Minimum ratio expected is {{ min_ratio }}':
'': 'The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.'
'The image is square ({{ width }}x{{ height }}px)':
' Square images are not allowed':
'': 'The image is square ({{ width }}x{{ height }}px). Square images are not allowed.'
'The image is landscape oriented ({{ width }}x{{ height }}px)':
' Landscape oriented images are not allowed':
'': 'The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.'
'The image is portrait oriented ({{ width }}x{{ height }}px)':
' Portrait oriented images are not allowed':
'': 'The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.'
'An empty file is not allowed':
'': 'An empty file is not allowed.'
'The host could not be resolved':
'': 'The host could not be resolved.'
'This value does not match the expected {{ charset }} charset':
'': 'This value does not match the expected {{ charset }} charset.'
'This is not a valid Business Identifier Code (BIC)':
'': 'This is not a valid Business Identifier Code (BIC).'
Error: Error
'This is not a valid UUID':
'': 'This is not a valid UUID.'
'This value should be a multiple of {{ compared_value }}':
'': 'This value should be a multiple of {{ compared_value }}.'
'This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}':
'': 'This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.'
'This value should be valid JSON':
'': 'This value should be valid JSON.'
'This collection should contain only unique elements':
'': 'This collection should contain only unique elements.'
'This value should be positive':
'': 'This value should be positive.'
'This value should be either positive or zero':
'': 'This value should be either positive or zero.'
'This value should be negative':
'': 'This value should be negative.'
'This value should be either negative or zero':
'': 'This value should be either negative or zero.'
'This value is not a valid timezone':
'': 'This value is not a valid timezone.'
'This password has been leaked in a data breach, it must not be used':
' Please use another password':
'': 'This password has been leaked in a data breach, it must not be used. Please use another password.'
'This value should be between {{ min }} and {{ max }}':
'': 'This value should be between {{ min }} and {{ max }}.'
'This value is not a valid hostname':
'': 'This value is not a valid hostname.'
'The number of elements in this collection should be a multiple of {{ compared_value }}':
'': 'The number of elements in this collection should be a multiple of {{ compared_value }}.'
'This value should satisfy at least one of the following constraints:': 'This value should satisfy at least one of the following constraints:'
'Each element of this collection should satisfy its own set of constraints':
'': 'Each element of this collection should satisfy its own set of constraints.'
'This value is not a valid International Securities Identification Number (ISIN)':
'': 'This value is not a valid International Securities Identification Number (ISIN).'
'This value should be a valid expression':
'': 'This value should be a valid expression.'
'This value is not a valid CSS color':
'': 'This value is not a valid CSS color.'
'This value is not a valid CIDR notation':
'': 'This value is not a valid CIDR notation.'
'The value of the netmask should be between {{ min }} and {{ max }}':
'': 'The value of the netmask should be between {{ min }} and {{ max }}.'
'This form should not contain extra fields':
'': 'This form should not contain extra fields.'
'The uploaded file was too large':
' Please try to upload a smaller file':
'': 'The uploaded file was too large. Please try to upload a smaller file.'
'The CSRF token is invalid':
' Please try to resubmit the form':
'': 'The CSRF token is invalid. Please try to resubmit the form.'
'This value is not a valid HTML5 color':
'': 'This value is not a valid HTML5 color.'
'Please enter a valid birthdate':
'': 'Please enter a valid birthdate.'
'The selected choice is invalid':
'': 'The selected choice is invalid.'
'The collection is invalid':
'': 'The collection is invalid.'
'Please select a valid color':
'': 'Please select a valid color.'
'Please select a valid country':
'': 'Please select a valid country.'
'Please select a valid currency':
'': 'Please select a valid currency.'
'Please choose a valid date interval':
'': 'Please choose a valid date interval.'
'Please enter a valid date and time':
'': 'Please enter a valid date and time.'
'Please enter a valid date':
'': 'Please enter a valid date.'
'Please select a valid file':
'': 'Please select a valid file.'
'The hidden field is invalid':
'': 'The hidden field is invalid.'
'Please enter an integer':
'': 'Please enter an integer.'
'Please select a valid language':
'': 'Please select a valid language.'
'Please select a valid locale':
'': 'Please select a valid locale.'
'Please enter a valid money amount':
'': 'Please enter a valid money amount.'
'Please enter a number':
'': 'Please enter a number.'
'The password is invalid':
'': 'The password is invalid.'
'Please enter a percentage value':
'': 'Please enter a percentage value.'
'The values do not match':
'': 'The values do not match.'
'Please enter a valid time':
'': 'Please enter a valid time.'
'Please select a valid timezone':
'': 'Please select a valid timezone.'
'Please enter a valid URL':
'': 'Please enter a valid URL.'
'Please enter a valid search term':
'': 'Please enter a valid search term.'
'Please provide a valid phone number':
'': 'Please provide a valid phone number.'
'The checkbox has an invalid value':
'': 'The checkbox has an invalid value.'
'Please enter a valid email address':
'': 'Please enter a valid email address.'
'Please select a valid option':
'': 'Please select a valid option.'
'Please select a valid range':
'': 'Please select a valid range.'
'Please enter a valid week':
'': 'Please enter a valid week.'

View File

@ -0,0 +1,287 @@
'This value should be false':
'': 'Cette valeur doit être fausse.'
'This value should be true':
'': 'Cette valeur doit être vraie.'
'This value should be of type {{ type }}':
'': 'Cette valeur doit être de type {{ type }}.'
'This value should be blank':
'': 'Cette valeur doit être vide.'
'The value you selected is not a valid choice':
'': "Cette valeur doit être l'un des choix proposés."
'You must select at least {{ limit }} choice':
'|You must select at least {{ limit }} choices':
'': 'Vous devez sélectionner au moins {{ limit }} choix.|Vous devez sélectionner au moins {{ limit }} choix.'
'You must select at most {{ limit }} choice':
'|You must select at most {{ limit }} choices':
'': 'Vous devez sélectionner au maximum {{ limit }} choix.|Vous devez sélectionner au maximum {{ limit }} choix.'
'One or more of the given values is invalid':
'': 'Une ou plusieurs des valeurs soumises sont invalides.'
'This field was not expected':
'': "Ce champ n'a pas été prévu."
'This field is missing':
'': 'Ce champ est manquant.'
'This value is not a valid date':
'': "Cette valeur n'est pas une date valide."
'This value is not a valid datetime':
'': "Cette valeur n'est pas une date valide."
'This value is not a valid email address':
'': "Cette valeur n'est pas une adresse email valide."
'The file could not be found':
'': "Le fichier n'a pas été trouvé."
'The file is not readable':
'': "Le fichier n'est pas lisible."
'The file is too large ({{ size }} {{ suffix }})':
' Allowed maximum size is {{ limit }} {{ suffix }}':
'': 'Le fichier est trop volumineux ({{ size }} {{ suffix }}). Sa taille ne doit pas dépasser {{ limit }} {{ suffix }}.'
'The mime type of the file is invalid ({{ type }})':
' Allowed mime types are {{ types }}':
'': 'Le type du fichier est invalide ({{ type }}). Les types autorisés sont {{ types }}.'
'This value should be {{ limit }} or less':
'': 'Cette valeur doit être inférieure ou égale à {{ limit }}.'
'This value is too long':
' It should have {{ limit }} character or less':
'|This value is too long': { ' It should have {{ limit }} characters or less': { '': 'Cette chaîne est trop longue. Elle doit avoir au maximum {{ limit }} caractère.|Cette chaîne est trop longue. Elle doit avoir au maximum {{ limit }} caractères.' } }
'This value should be {{ limit }} or more':
'': 'Cette valeur doit être supérieure ou égale à {{ limit }}.'
'This value is too short':
' It should have {{ limit }} character or more':
'|This value is too short': { ' It should have {{ limit }} characters or more': { '': 'Cette chaîne est trop courte. Elle doit avoir au minimum {{ limit }} caractère.|Cette chaîne est trop courte. Elle doit avoir au minimum {{ limit }} caractères.' } }
'This value should not be blank':
'': 'Cette valeur ne doit pas être vide.'
'This value should not be null':
'': 'Cette valeur ne doit pas être nulle.'
'This value should be null':
'': 'Cette valeur doit être nulle.'
'This value is not valid':
'': "Cette valeur n'est pas valide."
'This value is not a valid time':
'': "Cette valeur n'est pas une heure valide."
'This value is not a valid URL':
'': "Cette valeur n'est pas une URL valide."
'The two values should be equal':
'': 'Les deux valeurs doivent être identiques.'
'The file is too large':
' Allowed maximum size is {{ limit }} {{ suffix }}':
'': 'Le fichier est trop volumineux. Sa taille ne doit pas dépasser {{ limit }} {{ suffix }}.'
'': 'Le fichier est trop volumineux.'
'The file could not be uploaded':
'': 'Le téléchargement de ce fichier est impossible.'
'This value should be a valid number':
'': 'Cette valeur doit être un nombre.'
'This file is not a valid image':
'': "Ce fichier n'est pas une image valide."
'This is not a valid IP address':
'': "Cette adresse IP n'est pas valide."
'This value is not a valid language':
'': "Cette langue n'est pas valide."
'This value is not a valid locale':
'': "Ce paramètre régional n'est pas valide."
'This value is not a valid country':
'': "Ce pays n'est pas valide."
'This value is already used':
'': 'Cette valeur est déjà utilisée.'
'The size of the image could not be detected':
'': "La taille de l'image n'a pas pu être détectée."
'The image width is too big ({{ width }}px)':
' Allowed maximum width is {{ max_width }}px':
'': "La largeur de l'image est trop grande ({{ width }}px). La largeur maximale autorisée est de {{ max_width }}px."
'The image width is too small ({{ width }}px)':
' Minimum width expected is {{ min_width }}px':
'': "La largeur de l'image est trop petite ({{ width }}px). La largeur minimale attendue est de {{ min_width }}px."
'The image height is too big ({{ height }}px)':
' Allowed maximum height is {{ max_height }}px':
'': "La hauteur de l'image est trop grande ({{ height }}px). La hauteur maximale autorisée est de {{ max_height }}px."
'The image height is too small ({{ height }}px)':
' Minimum height expected is {{ min_height }}px':
'': "La hauteur de l'image est trop petite ({{ height }}px). La hauteur minimale attendue est de {{ min_height }}px."
"This value should be the user's current password":
'': "Cette valeur doit être le mot de passe actuel de l'utilisateur."
'This value should have exactly {{ limit }} character':
'|This value should have exactly {{ limit }} characters':
'': 'Cette chaîne doit avoir exactement {{ limit }} caractère.|Cette chaîne doit avoir exactement {{ limit }} caractères.'
'The file was only partially uploaded':
'': 'Le fichier a été partiellement transféré.'
'No file was uploaded':
'': "Aucun fichier n'a été transféré."
'No temporary folder was configured in php':
ini:
'': "Aucun répertoire temporaire n'a été configuré dans le php.ini, ou le répertoire configuré n'existe pas."
'Cannot write temporary file to disk':
'': "Impossible d'écrire le fichier temporaire sur le disque."
'A PHP extension caused the upload to fail':
'': 'Une extension PHP a empêché le transfert du fichier.'
'This collection should contain {{ limit }} element or more':
'|This collection should contain {{ limit }} elements or more':
'': 'Cette collection doit contenir {{ limit }} élément ou plus.|Cette collection doit contenir {{ limit }} éléments ou plus.'
'This collection should contain {{ limit }} element or less':
'|This collection should contain {{ limit }} elements or less':
'': 'Cette collection doit contenir {{ limit }} élément ou moins.|Cette collection doit contenir {{ limit }} éléments ou moins.'
'This collection should contain exactly {{ limit }} element':
'|This collection should contain exactly {{ limit }} elements':
'': 'Cette collection doit contenir exactement {{ limit }} élément.|Cette collection doit contenir exactement {{ limit }} éléments.'
'Invalid card number':
'': 'Numéro de carte invalide.'
'Unsupported card type or invalid card number':
'': 'Type de carte non supporté ou numéro invalide.'
'This is not a valid International Bank Account Number (IBAN)':
'': "Le numéro IBAN (International Bank Account Number) saisi n'est pas valide."
'This value is not a valid ISBN-10':
'': "Cette valeur n'est pas un code ISBN-10 valide."
'This value is not a valid ISBN-13':
'': "Cette valeur n'est pas un code ISBN-13 valide."
'This value is neither a valid ISBN-10 nor a valid ISBN-13':
'': "Cette valeur n'est ni un code ISBN-10, ni un code ISBN-13 valide."
'This value is not a valid ISSN':
'': "Cette valeur n'est pas un code ISSN valide."
'This value is not a valid currency':
'': "Cette valeur n'est pas une devise valide."
'This value should be equal to {{ compared_value }}':
'': 'Cette valeur doit être égale à {{ compared_value }}.'
'This value should be greater than {{ compared_value }}':
'': 'Cette valeur doit être supérieure à {{ compared_value }}.'
'This value should be greater than or equal to {{ compared_value }}':
'': 'Cette valeur doit être supérieure ou égale à {{ compared_value }}.'
'This value should be identical to {{ compared_value_type }} {{ compared_value }}':
'': 'Cette valeur doit être identique à {{ compared_value_type }} {{ compared_value }}.'
'This value should be less than {{ compared_value }}':
'': 'Cette valeur doit être inférieure à {{ compared_value }}.'
'This value should be less than or equal to {{ compared_value }}':
'': 'Cette valeur doit être inférieure ou égale à {{ compared_value }}.'
'This value should not be equal to {{ compared_value }}':
'': 'Cette valeur ne doit pas être égale à {{ compared_value }}.'
'This value should not be identical to {{ compared_value_type }} {{ compared_value }}':
'': 'Cette valeur ne doit pas être identique à {{ compared_value_type }} {{ compared_value }}.'
'The image ratio is too big ({{ ratio }})':
' Allowed maximum ratio is {{ max_ratio }}':
'': "Le rapport largeur/hauteur de l'image est trop grand ({{ ratio }}). Le rapport maximal autorisé est {{ max_ratio }}."
'The image ratio is too small ({{ ratio }})':
' Minimum ratio expected is {{ min_ratio }}':
'': "Le rapport largeur/hauteur de l'image est trop petit ({{ ratio }}). Le rapport minimal attendu est {{ min_ratio }}."
'The image is square ({{ width }}x{{ height }}px)':
' Square images are not allowed':
'': "L'image est carrée ({{ width }}x{{ height }}px). Les images carrées ne sont pas autorisées."
'The image is landscape oriented ({{ width }}x{{ height }}px)':
' Landscape oriented images are not allowed':
'': "L'image est au format paysage ({{ width }}x{{ height }}px). Les images au format paysage ne sont pas autorisées."
'The image is portrait oriented ({{ width }}x{{ height }}px)':
' Portrait oriented images are not allowed':
'': "L'image est au format portrait ({{ width }}x{{ height }}px). Les images au format portrait ne sont pas autorisées."
'An empty file is not allowed':
'': "Un fichier vide n'est pas autorisé."
'The host could not be resolved':
'': "Le nom de domaine n'a pas pu être résolu."
'This value does not match the expected {{ charset }} charset':
'': 'Cette valeur ne correspond pas au jeu de caractères {{ charset }} attendu.'
'This is not a valid Business Identifier Code (BIC)':
'': "Ce n'est pas un code universel d'identification des banques (BIC) valide."
Error: Erreur
'This is not a valid UUID':
'': "Ceci n'est pas un UUID valide."
'This value should be a multiple of {{ compared_value }}':
'': 'Cette valeur doit être un multiple de {{ compared_value }}.'
'This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}':
'': "Ce code d'identification d'entreprise (BIC) n'est pas associé à l'IBAN {{ iban }}."
'This value should be valid JSON':
'': 'Cette valeur doit être un JSON valide.'
'This collection should contain only unique elements':
'': 'Cette collection ne doit pas comporter de doublons.'
'This value should be positive':
'': 'Cette valeur doit être strictement positive.'
'This value should be either positive or zero':
'': 'Cette valeur doit être supérieure ou égale à zéro.'
'This value should be negative':
'': 'Cette valeur doit être strictement négative.'
'This value should be either negative or zero':
'': 'Cette valeur doit être inférieure ou égale à zéro.'
'This value is not a valid timezone':
'': "Cette valeur n'est pas un fuseau horaire valide."
'This password has been leaked in a data breach, it must not be used':
' Please use another password':
'': "Ce mot de passe a été divulgué lors d'une fuite de données, il ne doit plus être utilisé. Veuillez utiliser un autre mot de passe."
'This value should be between {{ min }} and {{ max }}':
'': 'Cette valeur doit être comprise entre {{ min }} et {{ max }}.'
'This value is not a valid hostname':
'': "Cette valeur n'est pas un nom d'hôte valide."
'The number of elements in this collection should be a multiple of {{ compared_value }}':
'': "Le nombre d'éléments de cette collection doit être un multiple de {{ compared_value }}."
'This value should satisfy at least one of the following constraints:': 'Cette valeur doit satisfaire à au moins une des contraintes suivantes :'
'Each element of this collection should satisfy its own set of constraints':
'': 'Chaque élément de cette collection doit satisfaire à son propre jeu de contraintes.'
'This value is not a valid International Securities Identification Number (ISIN)':
'': "Cette valeur n'est pas un code international de sécurité valide (ISIN)."
'This value should be a valid expression':
'': 'Cette valeur doit être une expression valide.'
'This value is not a valid CSS color':
'': "Cette valeur n'est pas une couleur CSS valide."
'This value is not a valid CIDR notation':
'': "Cette valeur n'est pas une notation CIDR valide."
'The value of the netmask should be between {{ min }} and {{ max }}':
'': 'La valeur du masque de réseau doit être comprise entre {{ min }} et {{ max }}.'
'This form should not contain extra fields':
'': 'Ce formulaire ne doit pas contenir de champs supplémentaires.'
'The uploaded file was too large':
' Please try to upload a smaller file':
'': "Le fichier téléchargé est trop volumineux. Merci d'essayer d'envoyer un fichier plus petit."
'The CSRF token is invalid':
' Please try to resubmit the form':
'': 'Le jeton CSRF est invalide. Veuillez renvoyer le formulaire.'
'This value is not a valid HTML5 color':
'': "Cette valeur n'est pas une couleur HTML5 valide."
'Please enter a valid birthdate':
'': 'Veuillez entrer une date de naissance valide.'
'The selected choice is invalid':
'': 'Le choix sélectionné est invalide.'
'The collection is invalid':
'': 'La collection est invalide.'
'Please select a valid color':
'': 'Veuillez sélectionner une couleur valide.'
'Please select a valid country':
'': 'Veuillez sélectionner un pays valide.'
'Please select a valid currency':
'': 'Veuillez sélectionner une devise valide.'
'Please choose a valid date interval':
'': 'Veuillez choisir un intervalle de dates valide.'
'Please enter a valid date and time':
'': 'Veuillez saisir une date et une heure valides.'
'Please enter a valid date':
'': 'Veuillez entrer une date valide.'
'Please select a valid file':
'': 'Veuillez sélectionner un fichier valide.'
'The hidden field is invalid':
'': "Le champ masqué n'est pas valide."
'Please enter an integer':
'': 'Veuillez saisir un entier.'
'Please select a valid language':
'': 'Veuillez sélectionner une langue valide.'
'Please select a valid locale':
'': 'Veuillez sélectionner une langue valide.'
'Please enter a valid money amount':
'': 'Veuillez saisir un montant valide.'
'Please enter a number':
'': 'Veuillez saisir un nombre.'
'The password is invalid':
'': 'Le mot de passe est invalide.'
'Please enter a percentage value':
'': 'Veuillez saisir un pourcentage valide.'
'The values do not match':
'': 'Les valeurs ne correspondent pas.'
'Please enter a valid time':
'': 'Veuillez saisir une heure valide.'
'Please select a valid timezone':
'': 'Veuillez sélectionner un fuseau horaire valide.'
'Please enter a valid URL':
'': 'Veuillez saisir une URL valide.'
'Please enter a valid search term':
'': 'Veuillez saisir un terme de recherche valide.'
'Please provide a valid phone number':
'': 'Veuillez fournir un numéro de téléphone valide.'
'The checkbox has an invalid value':
'': 'La case à cocher a une valeur non valide.'
'Please enter a valid email address':
'': 'Veuillez saisir une adresse email valide.'
'Please select a valid option':
'': 'Veuillez sélectionner une option valide.'
'Please select a valid range':
'': 'Veuillez sélectionner une plage valide.'
'Please enter a valid week':
'': 'Veuillez entrer une semaine valide.'

81
webpack.config.js Normal file
View File

@ -0,0 +1,81 @@
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')
// enables the Symfony UX Stimulus bridge (used in assets/bootstrap.js)
.enableStimulusBridge('./assets/controllers.json')
// When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
.splitEntryChunks()
// 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()
.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.23'
})
// enables Sass/SCSS support
.enableSassLoader()
// uncomment if you use TypeScript
.enableTypeScriptLoader()
// uncomment if you use React
//.enableReactPreset()
// make a Vuejs app
.enableVueLoader(() => {}, {
useJsx: true
})
// 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()

4816
yarn.lock Normal file

File diff suppressed because it is too large Load Diff