X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FChangePasswordType.php;h=81c4a6166708992524d22a4214d5a72ed04adf24;hb=e57df5611fe82ce61a71d51c762ee9296f18c3ac;hp=8bf4ca1ef6d100924e28069644c9057207a9246c;hpb=d9085c63e35bb708f560722fff5f4f5ad322c27b;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index 8bf4ca1e..81c4a616 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php @@ -1,9 +1,12 @@ add('old_password', 'password', array( - 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')), - )) - ->add('new_password', 'repeated', array( - 'type' => 'password', - 'invalid_message' => 'The password fields must match.', + ->add('old_password', PasswordType::class, [ + 'constraints' => new UserPassword(['message' => 'validator.password_wrong_value']), + 'label' => 'config.form_password.old_password_label', + ]) + ->add('new_password', RepeatedType::class, [ + 'type' => PasswordType::class, + 'invalid_message' => 'validator.password_must_match', 'required' => true, - 'first_options' => array('label' => 'New password'), - 'second_options' => array('label' => 'Repeat new password'), - 'constraints' => array( - new Constraints\Length(array( - 'min' => 6, - 'minMessage' => 'Password should by at least 6 chars long' - )), - new Constraints\NotBlank() - ) - )) - ->add('save', 'submit') + 'first_options' => ['label' => 'config.form_password.new_password_label'], + 'second_options' => ['label' => 'config.form_password.repeat_new_password_label'], + 'constraints' => [ + new Constraints\Length([ + 'min' => 8, + 'minMessage' => 'validator.password_too_short', + ]), + new Constraints\NotBlank(), + ], + 'label' => 'config.form_password.new_password_label', + ]) + ->add('save', SubmitType::class, [ + 'label' => 'config.form.save', + ]) ; } - public function getName() + public function getBlockPrefix() { return 'change_passwd'; }