From 4c5e5441831430af2b8f49dbeb0c76da6993eceb Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 3 Oct 2015 13:30:12 +0200 Subject: [PATCH] Cleanup - remove unecessary routing for UserBundle - remove unused form type --- app/config/routing.yml | 5 -- app/config/security.yml | 1 + .../Form/Type/ForgotPasswordType.php | 54 ------------------- .../Form/Type/ResetPasswordType.php | 35 ------------ 4 files changed, 1 insertion(+), 94 deletions(-) delete mode 100644 src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php delete mode 100644 src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php diff --git a/app/config/routing.yml b/app/config/routing.yml index f0f8f4b6..af3e32b1 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,8 +1,3 @@ -wallabag_user: - resource: "@WallabagUserBundle/Controller/" - type: annotation - prefix: / - wallabag_api: resource: "@WallabagApiBundle/Resources/config/routing.yml" prefix: / diff --git a/app/config/security.yml b/app/config/security.yml index d7d8c12b..576cfd25 100644 --- a/app/config/security.yml +++ b/app/config/security.yml @@ -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 index 5614d8b2..00000000 --- a/src/Wallabag/CoreBundle/Form/Type/ForgotPasswordType.php +++ /dev/null @@ -1,54 +0,0 @@ -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 index 38f1a105..00000000 --- a/src/Wallabag/CoreBundle/Form/Type/ResetPasswordType.php +++ /dev/null @@ -1,35 +0,0 @@ -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'; - } -} -- 2.41.0