diff options
author | Jeremy <jeremy.benoist@gmail.com> | 2015-03-07 23:25:36 +0100 |
---|---|---|
committer | Jeremy <jeremy.benoist@gmail.com> | 2015-03-08 07:35:24 +0100 |
commit | 6894d48e03c397096bb64420373afa60c397fe97 (patch) | |
tree | 0deb201b05b6aea527abc82ba7989732c4afbdb9 /src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php | |
parent | f37d1427a1b75f9d7a2e273b2e9fb0e895a769ab (diff) | |
download | wallabag-6894d48e03c397096bb64420373afa60c397fe97.tar.gz wallabag-6894d48e03c397096bb64420373afa60c397fe97.tar.zst wallabag-6894d48e03c397096bb64420373afa60c397fe97.zip |
Handle forgot password
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php new file mode 100644 index 00000000..50ae800b --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php | |||
@@ -0,0 +1,34 @@ | |||
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\Validator\Constraints; | ||
7 | |||
8 | class ResetPasswordType extends AbstractType | ||
9 | { | ||
10 | public function buildForm(FormBuilderInterface $builder, array $options) | ||
11 | { | ||
12 | $builder | ||
13 | ->add('new_password', 'repeated', array( | ||
14 | 'type' => 'password', | ||
15 | 'invalid_message' => 'The password fields must match.', | ||
16 | 'required' => true, | ||
17 | 'first_options' => array('label' => 'New password'), | ||
18 | 'second_options' => array('label' => 'Repeat new password'), | ||
19 | 'constraints' => array( | ||
20 | new Constraints\Length(array( | ||
21 | 'min' => 8, | ||
22 | 'minMessage' => 'Password should by at least 8 chars long', | ||
23 | )), | ||
24 | new Constraints\NotBlank(), | ||
25 | ), | ||
26 | )) | ||
27 | ; | ||
28 | } | ||
29 | |||
30 | public function getName() | ||
31 | { | ||
32 | return 'change_passwd'; | ||
33 | } | ||
34 | } | ||