From e4977b8a866f84f65f08c55c050a62f40170fdbf Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 22 Feb 2015 09:30:25 +0100 Subject: Adding new user --- .../CoreBundle/Form/Type/ChangePasswordType.php | 2 +- src/Wallabag/CoreBundle/Form/Type/NewUserType.php | 40 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/Wallabag/CoreBundle/Form/Type/NewUserType.php (limited to 'src/Wallabag/CoreBundle/Form/Type') 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(), ), diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php new file mode 100644 index 00000000..313a9aae --- /dev/null +++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php @@ -0,0 +1,40 @@ +add('username', 'text') + ->add('password', 'password', array( + 'constraints' => array( + new Constraints\Length(array( + 'min' => 8, + 'minMessage' => 'Password should by at least 8 chars long', + )), + new Constraints\NotBlank(), + ), + )) + ->add('email', 'text') + ->add('save', 'submit') + ; + } + + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Wallabag\CoreBundle\Entity\User', + )); + } + + public function getName() + { + return 'new_user'; + } +} -- cgit v1.2.3