mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Added an demo mode option, where the user password change dialog is disabled.
This commit is contained in:
parent
c955a3a221
commit
89acf91fe6
4 changed files with 26 additions and 6 deletions
|
@ -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'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue