]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Form/Type/NewUserType.php
Merge pull request #1436 from wallabag/v2-register
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / NewUserType.php
index da30ccd93ade8b0a0cdbc68bb9064eb4581ff7a0..8aabc8bbbc40ecffdaabc6543e7a0928678329a9 100644 (file)
@@ -4,7 +4,7 @@ namespace Wallabag\CoreBundle\Form\Type;
 
 use Symfony\Component\Form\AbstractType;
 use Symfony\Component\Form\FormBuilderInterface;
-use Symfony\Component\OptionsResolver\OptionsResolverInterface;
+use Symfony\Component\OptionsResolver\OptionsResolver;
 use Symfony\Component\Validator\Constraints;
 
 class NewUserType extends AbstractType
@@ -12,8 +12,9 @@ class NewUserType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $builder
-            ->add('username', 'text')
-            ->add('password', 'password', array(
+            ->add('username', 'text', array('required' => true))
+            ->add('plainPassword', 'repeated', array(
+                'type' => 'password',
                 'constraints' => array(
                     new Constraints\Length(array(
                         'min' => 8,
@@ -22,15 +23,15 @@ class NewUserType extends AbstractType
                     new Constraints\NotBlank(),
                 ),
             ))
-            ->add('email', 'text')
+            ->add('email', 'email')
             ->add('save', 'submit')
         ;
     }
 
-    public function setDefaultOptions(OptionsResolverInterface $resolver)
+    public function configureOptions(OptionsResolver $resolver)
     {
         $resolver->setDefaults(array(
-            'data_class' => 'Wallabag\CoreBundle\Entity\User',
+            'data_class' => 'Wallabag\UserBundle\Entity\User',
         ));
     }