From d9085c63e35bb708f560722fff5f4f5ad322c27b Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 17 Feb 2015 21:03:23 +0100 Subject: Handle password change --- .../CoreBundle/Form/Type/ChangePasswordType.php | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php (limited to 'src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php') diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php new file mode 100644 index 00000000..8bf4ca1e --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php @@ -0,0 +1,40 @@ +add('old_password', 'password', array( + 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')), + )) + ->add('new_password', 'repeated', array( + 'type' => 'password', + 'invalid_message' => 'The password fields must match.', + 'required' => true, + 'first_options' => array('label' => 'New password'), + 'second_options' => array('label' => 'Repeat new password'), + 'constraints' => array( + new Constraints\Length(array( + 'min' => 6, + 'minMessage' => 'Password should by at least 6 chars long' + )), + new Constraints\NotBlank() + ) + )) + ->add('save', 'submit') + ; + } + + public function getName() + { + return 'change_passwd'; + } +} -- cgit v1.2.3 From c0d9eba07f40a52bdfcfca3e7a926163b17d83ab Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 17 Feb 2015 22:45:20 +0100 Subject: Updating logged in user (email, name, etc ..) --- src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php') diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index 8bf4ca1e..de0ad537 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php @@ -3,7 +3,6 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; use Symfony\Component\Validator\Constraints; @@ -23,11 +22,11 @@ class ChangePasswordType extends AbstractType 'second_options' => array('label' => 'Repeat new password'), 'constraints' => array( new Constraints\Length(array( - 'min' => 6, - 'minMessage' => 'Password should by at least 6 chars long' + 'min' => 8, + 'minMessage' => 'Password should by at least 6 chars long', )), - new Constraints\NotBlank() - ) + new Constraints\NotBlank(), + ), )) ->add('save', 'submit') ; -- cgit v1.2.3 From e4977b8a866f84f65f08c55c050a62f40170fdbf Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 22 Feb 2015 09:30:25 +0100 Subject: Adding new user --- src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php') diff --git a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php index de0ad537..e141789f 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php @@ -23,7 +23,7 @@ class ChangePasswordType extends AbstractType 'constraints' => array( new Constraints\Length(array( 'min' => 8, - 'minMessage' => 'Password should by at least 6 chars long', + 'minMessage' => 'Password should by at least 8 chars long', )), new Constraints\NotBlank(), ), -- cgit v1.2.3