forked from wallabag/wallabag
Adding new user
This commit is contained in:
@ -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(),
|
||||
),
|
||||
|
||||
40
src/Wallabag/CoreBundle/Form/Type/NewUserType.php
Normal file
40
src/Wallabag/CoreBundle/Form/Type/NewUserType.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
use Symfony\Component\Validator\Constraints;
|
||||
|
||||
class NewUserType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user