forked from wallabag/wallabag
Updating logged in user (email, name, etc ..)
This commit is contained in:
@ -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')
|
||||
;
|
||||
|
||||
@ -21,7 +21,7 @@ class ConfigType extends AbstractType
|
||||
'solarized_dark' => 'Solarized Dark',
|
||||
),
|
||||
))
|
||||
->add('items_per_page')
|
||||
->add('items_per_page', 'text')
|
||||
->add('language')
|
||||
->add('save', 'submit')
|
||||
;
|
||||
|
||||
31
src/Wallabag/CoreBundle/Form/Type/UserType.php
Normal file
31
src/Wallabag/CoreBundle/Form/Type/UserType.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
|
||||
class UserType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('username', 'text')
|
||||
->add('name', 'text')
|
||||
->add('email', 'text')
|
||||
->add('save', 'submit')
|
||||
;
|
||||
}
|
||||
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'Wallabag\CoreBundle\Entity\User',
|
||||
));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'user';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user