Added an demo mode option, where the user password change dialog is disabled.

This commit is contained in:
Jan Böhmer 2019-10-20 00:01:06 +02:00
parent c955a3a221
commit 89acf91fe6
4 changed files with 26 additions and 6 deletions

View file

@ -197,11 +197,15 @@ class UserController extends AdminPages\BaseAdminController
* Password change form
****************************/
$demo_mode = $this->getParameter('demo_mode');
$pw_form = $this->createFormBuilder()
->add('old_password', PasswordType::class, [
'label' => 'user.settings.pw_old.label',
'disabled' => $demo_mode,
'constraints' => [new UserPassword()], ]) //This constraint checks, if the current user pw was inputted.
->add('new_password', RepeatedType::class, [
'disabled' => $demo_mode,
'type' => PasswordType::class,
'first_options' => ['label' => 'user.settings.pw_new.label'],
'second_options' => ['label' => 'user.settings.pw_confirm.label'],