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