X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FChangePasswordType.php;h=7d05a5d81442cb5f3ba04852f7c33b3fcd8b47fc;hb=5c895a7fd15822856fb407910264c5d95e1e223c;hp=b4224e3df69df004f15e148afb10777abf8770d5;hpb=2878416f8b4d94fb5e64c2fa61861526a7654d3d;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index b4224e3d..7d05a5d8 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php @@ -3,6 +3,9 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\PasswordType; +use Symfony\Component\Form\Extension\Core\Type\RepeatedType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; use Symfony\Component\Validator\Constraints; @@ -12,14 +15,14 @@ class ChangePasswordType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('old_password', 'password', array( + ->add('old_password', PasswordType::class, array( 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')), )) - ->add('new_password', 'repeated', array( - 'type' => 'password', + ->add('new_password', RepeatedType::class, array( + 'type' => PasswordType::class, 'invalid_message' => 'The password fields must match.', 'required' => true, - 'first_options' => array('label' => 'New password'), + 'first_options' => array('label' => 'New password'), 'second_options' => array('label' => 'Repeat new password'), 'constraints' => array( new Constraints\Length(array( @@ -29,11 +32,11 @@ class ChangePasswordType extends AbstractType new Constraints\NotBlank(), ), )) - ->add('save', 'submit') + ->add('save', SubmitType::class) ; } - public function getName() + public function getBlockPrefix() { return 'change_passwd'; }