From 5a55a64feecb9109032389bae341a1bbbda796cf Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Thu, 5 May 2022 23:39:26 +0200 Subject: [PATCH] Use fosuser_registration directly instead of wallabag_user.registration_enabled --- app/config/wallabag.yml | 3 --- .../ApiBundle/Controller/WallabagRestController.php | 2 +- .../UserBundle/Controller/RegistrationController.php | 2 +- src/Wallabag/UserBundle/Controller/SecurityController.php | 2 +- .../UserBundle/DependencyInjection/Configuration.php | 8 -------- .../DependencyInjection/WallabagUserExtension.php | 1 - 6 files changed, 3 insertions(+), 15 deletions(-) diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index 6f5315b98..6ceeab15d 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml @@ -178,9 +178,6 @@ wallabag_core: - rule: _all ~ "https?://www\.lemonde\.fr/tiny.*" -wallabag_user: - registration_enabled: "%fosuser_registration%" - wallabag_import: allow_mimetypes: ['application/octet-stream', 'application/json', 'text/plain', 'text/csv'] resource_dir: "%kernel.project_dir%/web/uploads/import" diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 44fd96835..76bf201b1 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -39,7 +39,7 @@ class WallabagRestController extends AbstractFOSRestController $info = [ 'appname' => 'wallabag', 'version' => $this->container->getParameter('wallabag_core.version'), - 'allowed_registration' => $this->container->getParameter('wallabag_user.registration_enabled'), + 'allowed_registration' => $this->container->getParameter('fosuser_registration'), ]; return (new JsonResponse())->setJson($this->get('jms_serializer')->serialize($info, 'json')); diff --git a/src/Wallabag/UserBundle/Controller/RegistrationController.php b/src/Wallabag/UserBundle/Controller/RegistrationController.php index f81f3a7b4..2df36d6c9 100644 --- a/src/Wallabag/UserBundle/Controller/RegistrationController.php +++ b/src/Wallabag/UserBundle/Controller/RegistrationController.php @@ -9,7 +9,7 @@ class RegistrationController extends FOSRegistrationController { public function registerAction(Request $request) { - if ($this->container->getParameter('wallabag_user.registration_enabled')) { + if ($this->container->getParameter('fosuser_registration')) { return parent::registerAction($request); } diff --git a/src/Wallabag/UserBundle/Controller/SecurityController.php b/src/Wallabag/UserBundle/Controller/SecurityController.php index 83fa0b20f..5a9aadd2f 100644 --- a/src/Wallabag/UserBundle/Controller/SecurityController.php +++ b/src/Wallabag/UserBundle/Controller/SecurityController.php @@ -14,7 +14,7 @@ class SecurityController extends FOSSecurityController return $this->render('FOSUserBundle:Security:login.html.twig', array_merge( $data, - ['registration_enabled' => $this->container->getParameter('wallabag_user.registration_enabled')] + ['registration_enabled' => $this->container->getParameter('fosuser_registration')] ) ); } diff --git a/src/Wallabag/UserBundle/DependencyInjection/Configuration.php b/src/Wallabag/UserBundle/DependencyInjection/Configuration.php index 971ce1a0f..4223f8dba 100644 --- a/src/Wallabag/UserBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/UserBundle/DependencyInjection/Configuration.php @@ -12,14 +12,6 @@ class Configuration implements ConfigurationInterface $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('wallabag_user'); - $rootNode - ->children() - ->booleanNode('registration_enabled') - ->defaultValue(true) - ->end() - ->end() - ; - return $treeBuilder; } } diff --git a/src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php b/src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php index 5ca3482e6..eb2870127 100644 --- a/src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php +++ b/src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php @@ -16,7 +16,6 @@ class WallabagUserExtension extends Extension $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('services.yml'); - $container->setParameter('wallabag_user.registration_enabled', $config['registration_enabled']); } public function getAlias()