]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Cleanup
authorJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 3 Oct 2015 11:30:12 +0000 (13:30 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 3 Oct 2015 11:37:21 +0000 (13:37 +0200)
- remove unecessary routing for UserBundle
- remove unused form type

app/config/routing.yml
app/config/security.yml
src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php [deleted file]
src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php [deleted file]

index f0f8f4b6ff52b28d4b90b29bf011bcca24c21870..af3e32b180178821a0451182690c5f735af3d717 100644 (file)
@@ -1,8 +1,3 @@
-wallabag_user:
-    resource: "@WallabagUserBundle/Controller/"
-    type:     annotation
-    prefix:   /
-
 wallabag_api:
     resource: "@WallabagApiBundle/Resources/config/routing.yml"
     prefix:   /
index d7d8c12b1fd8230860ecf7cb61b94987cf151c2c..576cfd25d7f7d41094f6c64004bd0c1ca93b143e 100644 (file)
@@ -18,6 +18,7 @@ security:
         oauth_token:
             pattern: ^/oauth/v2/token
             security: false
+
         api:
             pattern: /api/.*
             fos_oauth: true
diff --git a/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php
deleted file mode 100644 (file)
index 5614d8b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-namespace Wallabag\CoreBundle\Form\Type;
-
-use Symfony\Component\Form\AbstractType;
-use Symfony\Component\Form\FormBuilderInterface;
-use Symfony\Component\Validator\Constraints;
-use Symfony\Component\Validator\ExecutionContextInterface;
-use Doctrine\Bundle\DoctrineBundle\Registry;
-
-class ForgotPasswordType extends AbstractType
-{
-    private $doctrine = null;
-
-    public function __construct(Registry $doctrine)
-    {
-        $this->doctrine = $doctrine;
-    }
-
-    public function buildForm(FormBuilderInterface $builder, array $options)
-    {
-        $builder
-            ->add('email', 'email', array(
-                'required' => true,
-                'constraints' => array(
-                    new Constraints\Email(),
-                    new Constraints\NotBlank(),
-                    new Constraints\Callback(array(array($this, 'validateEmail'))),
-                ),
-            ))
-        ;
-    }
-
-    public function getName()
-    {
-        return 'forgot_password';
-    }
-
-    public function validateEmail($email, ExecutionContextInterface $context)
-    {
-        $user = $this->doctrine
-            ->getRepository('WallabagUserBundle:User')
-            ->findOneByEmail($email);
-
-        if (!$user) {
-            $context->addViolationAt(
-                'email',
-                'No user found with this email',
-                array(),
-                $email
-            );
-        }
-    }
-}
diff --git a/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php b/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php
deleted file mode 100644 (file)
index 38f1a10..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-namespace Wallabag\CoreBundle\Form\Type;
-
-use Symfony\Component\Form\AbstractType;
-use Symfony\Component\Form\FormBuilderInterface;
-use Symfony\Component\Validator\Constraints;
-
-class ResetPasswordType extends AbstractType
-{
-    public function buildForm(FormBuilderInterface $builder, array $options)
-    {
-        $builder
-            ->add('new_password', 'repeated', array(
-                'type' => 'password',
-                'invalid_message' => 'The password fields must match.',
-                'required' => true,
-                'first_options' => array('label' => 'New password'),
-                'second_options' => array('label' => 'Repeat new password'),
-                'constraints' => array(
-                    new Constraints\Length(array(
-                        'min' => 8,
-                        'minMessage' => 'Password should by at least 8 chars long',
-                    )),
-                    new Constraints\NotBlank(),
-                ),
-            ))
-        ;
-    }
-
-    public function getName()
-    {
-        return 'change_passwd';
-    }
-}