Fixed some deprecations.

This commit is contained in:
Jan Böhmer 2021-10-02 20:41:14 +02:00
parent 2a332b28a7
commit 193ecd252b
12 changed files with 66 additions and 24 deletions

View file

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