X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FChangePasswordType.php;h=615b81690653b1ba34035d217df10846f11e6ee6;hb=619cc45359ead519b64129181a07e14160fbbfcb;hp=82e1954d1a871906c5220ff6a5bbf39edbf01e53;hpb=516022d60ea5c4e0c18a222590d23190a2c7765f;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index 82e1954d..615b8169 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,10 +15,10 @@ 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( + ->add('new_password', RepeatedType::class, array( 'type' => 'password', 'invalid_message' => 'The password fields must match.', 'required' => true, @@ -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'; }