From: Jeremy Benoist Date: Sat, 3 Oct 2015 11:30:12 +0000 (+0200) Subject: Cleanup X-Git-Tag: 2.0.0-alpha.1~28^2~4 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=4c5e5441831430af2b8f49dbeb0c76da6993eceb;p=github%2Fwallabag%2Fwallabag.git Cleanup - remove unecessary routing for UserBundle - remove unused form type --- 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'; - } -}