3 namespace Wallabag\CoreBundle\Form\Type
;
5 use Symfony\Component\Form\AbstractType
;
6 use Symfony\Component\Form\FormBuilderInterface
;
7 use Symfony\Component\Security\Core\Validator\Constraints\UserPassword
;
8 use Symfony\Component\Validator\Constraints
;
10 class ChangePasswordType
extends AbstractType
12 public function buildForm(FormBuilderInterface
$builder, array $options)
15 ->add('old_password', 'password', array(
16 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')),
18 ->add('new_password', 'repeated', array(
20 'invalid_message' => 'The password fields must match.',
22 'first_options' => array('label' => 'New password'),
23 'second_options' => array('label' => 'Repeat new password'),
24 'constraints' => array(
25 new Constraints\
Length(array(
27 'minMessage' => 'Password should by at least 8 chars long',
29 new Constraints\
NotBlank(),
32 ->add('save', 'submit')
36 public function getName()
38 return 'change_passwd';