diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-23 20:56:09 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-02-23 20:56:09 +0100 |
commit | 0e7971d8354b0923d2e8f38690b9fe46e695dd93 (patch) | |
tree | 7026acde83f5d38a9ad94d92f926d880aa233dbe /src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php | |
parent | 2f6a596760c62efd9e43602f787fa44400d522b3 (diff) | |
parent | c641baad0ec52198d77f2018c7bf8acdfe5957ce (diff) | |
download | wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.tar.gz wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.tar.zst wallabag-0e7971d8354b0923d2e8f38690b9fe46e695dd93.zip |
Merge pull request #1095 from wallabag/v2-config
V2 config
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php new file mode 100644 index 00000000..e141789f --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php | |||
@@ -0,0 +1,39 @@ | |||
1 | <?php | ||
2 | namespace Wallabag\CoreBundle\Form\Type; | ||
3 | |||
4 | use Symfony\Component\Form\AbstractType; | ||
5 | use Symfony\Component\Form\FormBuilderInterface; | ||
6 | use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; | ||
7 | use Symfony\Component\Validator\Constraints; | ||
8 | |||
9 | class ChangePasswordType extends AbstractType | ||
10 | { | ||
11 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
12 | { | ||
13 | $builder | ||
14 | ->add('old_password', 'password', array( | ||
15 | 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')), | ||
16 | )) | ||
17 | ->add('new_password', 'repeated', array( | ||
18 | 'type' => 'password', | ||
19 | 'invalid_message' => 'The password fields must match.', | ||
20 | 'required' => true, | ||
21 | 'first_options' => array('label' => 'New password'), | ||
22 | 'second_options' => array('label' => 'Repeat new password'), | ||
23 | 'constraints' => array( | ||
24 | new Constraints\Length(array( | ||
25 | 'min' => 8, | ||
26 | 'minMessage' => 'Password should by at least 8 chars long', | ||
27 | )), | ||
28 | new Constraints\NotBlank(), | ||
29 | ), | ||
30 | )) | ||
31 | ->add('save', 'submit') | ||
32 | ; | ||
33 | } | ||
34 | |||
35 | public function getName() | ||
36 | { | ||
37 | return 'change_passwd'; | ||
38 | } | ||
39 | } | ||