mirror of
https://github.com/wallabag/wallabag.git
synced 2025-04-25 11:24:07 +00:00
Use Twig globals to pass registration_enabled
This commit is contained in:
parent
5a55a64fee
commit
bfc28d4c0b
3 changed files with 2 additions and 27 deletions
|
@ -41,6 +41,8 @@ twig:
|
||||||
form_themes:
|
form_themes:
|
||||||
- "LexikFormFilterBundle:Form:form_div_layout.html.twig"
|
- "LexikFormFilterBundle:Form:form_div_layout.html.twig"
|
||||||
exception_controller: wallabag_core.exception_controller:showAction
|
exception_controller: wallabag_core.exception_controller:showAction
|
||||||
|
globals:
|
||||||
|
registration_enabled: '%fosuser_registration%'
|
||||||
|
|
||||||
# Doctrine Configuration
|
# Doctrine Configuration
|
||||||
doctrine:
|
doctrine:
|
||||||
|
|
|
@ -41,12 +41,6 @@ homepage:
|
||||||
fos_user:
|
fos_user:
|
||||||
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
|
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
|
||||||
|
|
||||||
fos_user_security_login:
|
|
||||||
path: /login
|
|
||||||
defaults:
|
|
||||||
_controller: Wallabag\UserBundle\Controller\SecurityController::loginAction
|
|
||||||
methods: [GET, POST]
|
|
||||||
|
|
||||||
fos_user_registration_register:
|
fos_user_registration_register:
|
||||||
path: /register
|
path: /register
|
||||||
defaults:
|
defaults:
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Wallabag\UserBundle\Controller;
|
|
||||||
|
|
||||||
use FOS\UserBundle\Controller\SecurityController as FOSSecurityController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extends login form in order to pass the registration_enabled parameter.
|
|
||||||
*/
|
|
||||||
class SecurityController extends FOSSecurityController
|
|
||||||
{
|
|
||||||
protected function renderLogin(array $data)
|
|
||||||
{
|
|
||||||
return $this->render('FOSUserBundle:Security:login.html.twig',
|
|
||||||
array_merge(
|
|
||||||
$data,
|
|
||||||
['registration_enabled' => $this->container->getParameter('fosuser_registration')]
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue