mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Fixed some deprecations.
This commit is contained in:
parent
2a332b28a7
commit
193ecd252b
12 changed files with 66 additions and 24 deletions
|
@ -82,7 +82,7 @@ class UserController extends AdminPages\BaseAdminController
|
|||
{
|
||||
//Check if we editing a user and if we need to change the password of it
|
||||
if ($entity instanceof User && !empty($form['new_password']->getData())) {
|
||||
$password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData());
|
||||
$password = $this->passwordEncoder->hashPassword($entity, $form['new_password']->getData());
|
||||
$entity->setPassword($password);
|
||||
//By default the user must change the password afterwards
|
||||
$entity->setNeedPwChange(true);
|
||||
|
@ -134,7 +134,7 @@ class UserController extends AdminPages\BaseAdminController
|
|||
protected function additionalActionNew(FormInterface $form, AbstractNamedDBElement $entity): bool
|
||||
{
|
||||
if ($entity instanceof User && !empty($form['new_password']->getData())) {
|
||||
$password = $this->passwordEncoder->encodePassword($entity, $form['new_password']->getData());
|
||||
$password = $this->passwordEncoder->hashPassword($entity, $form['new_password']->getData());
|
||||
$entity->setPassword($password);
|
||||
//By default the user must change the password afterwards
|
||||
$entity->setNeedPwChange(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue