svg
This commit is contained in:
parent
4b7fd19685
commit
c1aa1026a7
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"editor.fontSize": 14,
|
"editor.fontSize": 14,
|
||||||
"php-cs-fixer.executablePath": "${workspaceFolder}/vendor/bin/php-cs-fixer",
|
"php-cs-fixer.executablePath": "${workspaceFolder}/vendor/bin/php-cs-fixer",
|
||||||
"php-cs-fixer.onsave": true, // Active l'exécution à la sauvegarde
|
"php-cs-fixer.onsave": true,
|
||||||
"php-cs-fixer.rules": null // Null pour utiliser les règles définies dans .php-cs-fixer.dist.php
|
"php-cs-fixer.rules": "@Symfony",
|
||||||
|
"php-cs-fixer.config": ".php-cs-fixer.dist.php"
|
||||||
}
|
}
|
@ -68,15 +68,17 @@ class UserController extends AbstractController
|
|||||||
if (!$user) {
|
if (!$user) {
|
||||||
return $this->redirectToRoute('app_admin_user');
|
return $this->redirectToRoute('app_admin_user');
|
||||||
}
|
}
|
||||||
$oldpassword=$user->getPassword();
|
$hashedPassword = $user->getPassword();
|
||||||
$form = $this->createForm(UserType::class, $user, ['mode' => 'update']);
|
$form = $this->createForm(UserType::class, $user, ['mode' => 'update']);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$user = $form->getData();
|
$user = $form->getData();
|
||||||
$hashedPassword = $passwordHasher->hashPassword(
|
if (!$user->getPassword()) {
|
||||||
$user,
|
$hashedPassword = $passwordHasher->hashPassword(
|
||||||
$user->getPassword()
|
$user,
|
||||||
);
|
$user->getPassword()
|
||||||
|
);
|
||||||
|
}
|
||||||
$user->setPassword($hashedPassword);
|
$user->setPassword($hashedPassword);
|
||||||
|
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
@ -110,7 +110,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
return $this->password;
|
return $this->password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setPassword(string $password): static
|
public function setPassword(?string $password): static
|
||||||
{
|
{
|
||||||
$this->password = $password;
|
$this->password = $password;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user