aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php2
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/NewUserType.php58
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig1
3 files changed, 1 insertions, 60 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 51d8bdd1..91cdcae5 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -2,8 +2,6 @@
2 2
3namespace Wallabag\CoreBundle\Controller; 3namespace Wallabag\CoreBundle\Controller;
4 4
5use FOS\UserBundle\Event\UserEvent;
6use FOS\UserBundle\FOSUserEvents;
7use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 5use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
8use Symfony\Bundle\FrameworkBundle\Controller\Controller; 6use Symfony\Bundle\FrameworkBundle\Controller\Controller;
9use Symfony\Component\HttpFoundation\JsonResponse; 7use Symfony\Component\HttpFoundation\JsonResponse;
diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
deleted file mode 100644
index 6a6f63d1..00000000
--- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php
+++ /dev/null
@@ -1,58 +0,0 @@
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\Extension\Core\Type\EmailType;
7use Symfony\Component\Form\Extension\Core\Type\PasswordType;
8use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
9use Symfony\Component\Form\Extension\Core\Type\SubmitType;
10use Symfony\Component\Form\Extension\Core\Type\TextType;
11use Symfony\Component\Form\FormBuilderInterface;
12use Symfony\Component\OptionsResolver\OptionsResolver;
13use Symfony\Component\Validator\Constraints;
14
15class NewUserType extends AbstractType
16{
17 public function buildForm(FormBuilderInterface $builder, array $options)
18 {
19 $builder
20 ->add('username', TextType::class, [
21 'required' => true,
22 'label' => 'config.form_new_user.username_label',
23 ])
24 ->add('plainPassword', RepeatedType::class, [
25 'type' => PasswordType::class,
26 'invalid_message' => 'validator.password_must_match',
27 'first_options' => ['label' => 'config.form_new_user.password_label'],
28 'second_options' => ['label' => 'config.form_new_user.repeat_new_password_label'],
29 'constraints' => [
30 new Constraints\Length([
31 'min' => 8,
32 'minMessage' => 'validator.password_too_short',
33 ]),
34 new Constraints\NotBlank(),
35 ],
36 'label' => 'config.form_new_user.plain_password_label',
37 ])
38 ->add('email', EmailType::class, [
39 'label' => 'config.form_new_user.email_label',
40 ])
41 ->add('save', SubmitType::class, [
42 'label' => 'config.form.save',
43 ])
44 ;
45 }
46
47 public function configureOptions(OptionsResolver $resolver)
48 {
49 $resolver->setDefaults([
50 'data_class' => 'Wallabag\UserBundle\Entity\User',
51 ]);
52 }
53
54 public function getBlockPrefix()
55 {
56 return 'new_user';
57 }
58}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
index 4fd4d317..30fd0d85 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
@@ -42,6 +42,7 @@
42 </li>--> 42 </li>-->
43 <li><a href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a></li> 43 <li><a href="{{ path('config') }}">{{ 'menu.left.config'|trans }}</a></li>
44 {% if is_granted('ROLE_SUPER_ADMIN') %} 44 {% if is_granted('ROLE_SUPER_ADMIN') %}
45 <li><a href="{{ path('user_index') }}">{{ 'menu.left.users_management'|trans }}</a></li>
45 <li><a href="{{ path('craue_config_settings_modify') }}">{{ 'menu.left.internal_settings'|trans }}</a></li> 46 <li><a href="{{ path('craue_config_settings_modify') }}">{{ 'menu.left.internal_settings'|trans }}</a></li>
46 {% endif %} 47 {% endif %}
47 <li><a href="{{ path('import') }}">{{ 'menu.left.import'|trans }}</a></li> 48 <li><a href="{{ path('import') }}">{{ 'menu.left.import'|trans }}</a></li>