aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/UserBundle')
-rw-r--r--src/Wallabag/UserBundle/Controller/RegistrationController.php18
-rw-r--r--src/Wallabag/UserBundle/Controller/SecurityController.php21
-rw-r--r--src/Wallabag/UserBundle/DependencyInjection/Configuration.php8
-rw-r--r--src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php1
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig4
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Registration/confirmed.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig4
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Resetting/request_content.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Resetting/reset_content.html.twig2
-rw-r--r--src/Wallabag/UserBundle/Resources/views/Security/login.html.twig6
-rw-r--r--src/Wallabag/UserBundle/Resources/views/layout.html.twig2
11 files changed, 60 insertions, 10 deletions
diff --git a/src/Wallabag/UserBundle/Controller/RegistrationController.php b/src/Wallabag/UserBundle/Controller/RegistrationController.php
new file mode 100644
index 00000000..f81f3a7b
--- /dev/null
+++ b/src/Wallabag/UserBundle/Controller/RegistrationController.php
@@ -0,0 +1,18 @@
1<?php
2
3namespace Wallabag\UserBundle\Controller;
4
5use FOS\UserBundle\Controller\RegistrationController as FOSRegistrationController;
6use Symfony\Component\HttpFoundation\Request;
7
8class RegistrationController extends FOSRegistrationController
9{
10 public function registerAction(Request $request)
11 {
12 if ($this->container->getParameter('wallabag_user.registration_enabled')) {
13 return parent::registerAction($request);
14 }
15
16 return $this->redirectToRoute('fos_user_security_login', [], 301);
17 }
18}
diff --git a/src/Wallabag/UserBundle/Controller/SecurityController.php b/src/Wallabag/UserBundle/Controller/SecurityController.php
new file mode 100644
index 00000000..83fa0b20
--- /dev/null
+++ b/src/Wallabag/UserBundle/Controller/SecurityController.php
@@ -0,0 +1,21 @@
1<?php
2
3namespace Wallabag\UserBundle\Controller;
4
5use FOS\UserBundle\Controller\SecurityController as FOSSecurityController;
6
7/**
8 * Extends login form in order to pass the registration_enabled parameter.
9 */
10class SecurityController extends FOSSecurityController
11{
12 protected function renderLogin(array $data)
13 {
14 return $this->render('FOSUserBundle:Security:login.html.twig',
15 array_merge(
16 $data,
17 ['registration_enabled' => $this->container->getParameter('wallabag_user.registration_enabled')]
18 )
19 );
20 }
21}
diff --git a/src/Wallabag/UserBundle/DependencyInjection/Configuration.php b/src/Wallabag/UserBundle/DependencyInjection/Configuration.php
index 4223f8db..971ce1a0 100644
--- a/src/Wallabag/UserBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/UserBundle/DependencyInjection/Configuration.php
@@ -12,6 +12,14 @@ class Configuration implements ConfigurationInterface
12 $treeBuilder = new TreeBuilder(); 12 $treeBuilder = new TreeBuilder();
13 $rootNode = $treeBuilder->root('wallabag_user'); 13 $rootNode = $treeBuilder->root('wallabag_user');
14 14
15 $rootNode
16 ->children()
17 ->booleanNode('registration_enabled')
18 ->defaultValue(true)
19 ->end()
20 ->end()
21 ;
22
15 return $treeBuilder; 23 return $treeBuilder;
16 } 24 }
17} 25}
diff --git a/src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php b/src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php
index c12a8937..99040f69 100644
--- a/src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php
+++ b/src/Wallabag/UserBundle/DependencyInjection/WallabagUserExtension.php
@@ -16,6 +16,7 @@ class WallabagUserExtension extends Extension
16 16
17 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 17 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
18 $loader->load('services.yml'); 18 $loader->load('services.yml');
19 $container->setParameter('wallabag_user.registration_enabled', $config['registration_enabled']);
19 } 20 }
20 21
21 public function getAlias() 22 public function getAlias()
diff --git a/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig b/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig
index acf69196..c8471bdd 100644
--- a/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Authentication/form.html.twig
@@ -23,10 +23,10 @@
23 </div> 23 </div>
24 </div> 24 </div>
25 <div class="card-action center"> 25 <div class="card-action center">
26 <a href="{{ path('fos_user_security_logout') }}" class="waves-effect waves-light grey btn"><i class="material-icons left"></i> {{ 'security.login.cancel'|trans }}</a> 26 <a href="{{ path('fos_user_security_logout') }}" class="waves-effect waves-light grey btn">{{ 'security.login.cancel'|trans }}</a>
27 <button class="btn waves-effect waves-light" type="submit" name="send"> 27 <button class="btn waves-effect waves-light" type="submit" name="send">
28 {{ "scheb_two_factor.login"|trans }} 28 {{ "scheb_two_factor.login"|trans }}
29 <i class="mdi-content-send right"></i> 29 <i class="material-icons right">send</i>
30 </button> 30 </button>
31 </div> 31 </div>
32</form> 32</form>
diff --git a/src/Wallabag/UserBundle/Resources/views/Registration/confirmed.html.twig b/src/Wallabag/UserBundle/Resources/views/Registration/confirmed.html.twig
index aa4b9bca..cb8d40a4 100644
--- a/src/Wallabag/UserBundle/Resources/views/Registration/confirmed.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Registration/confirmed.html.twig
@@ -11,7 +11,7 @@
11 {% endif %} 11 {% endif %}
12 </div> 12 </div>
13 <div class="card-action center"> 13 <div class="card-action center">
14 <a href="{{ path('homepage') }}" class="waves-effect waves-light btn"><i class="material-icons left"></i> {{ 'security.register.go_to_account'|trans({},'messages') }}</a> 14 <a href="{{ path('homepage') }}" class="waves-effect waves-light btn">{{ 'security.register.go_to_account'|trans({},'messages') }}</a>
15 </div> 15 </div>
16</div> 16</div>
17{% endblock fos_user_content %} 17{% endblock fos_user_content %}
diff --git a/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig b/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig
index 7d2b45d4..d0a85fc7 100644
--- a/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Registration/register_content.html.twig
@@ -36,10 +36,10 @@
36 </div> 36 </div>
37 </div> 37 </div>
38 <div class="card-action center"> 38 <div class="card-action center">
39 <a href="{{ path('fos_user_security_login') }}" class="waves-effect waves-light grey btn"><i class="material-icons left"></i> {{ 'security.login.submit'|trans }}</a> 39 <a href="{{ path('fos_user_security_login') }}" class="waves-effect waves-light grey btn">{{ 'security.login.submit'|trans }}</a>
40 <button class="btn waves-effect waves-light" type="submit" name="send"> 40 <button class="btn waves-effect waves-light" type="submit" name="send">
41 {{ 'registration.submit'|trans({}, 'FOSUserBundle') }} 41 {{ 'registration.submit'|trans({}, 'FOSUserBundle') }}
42 <i class="mdi-content-send right"></i> 42 <i class="material-icons right">send</i>
43 </button> 43 </button>
44 </div> 44 </div>
45</form> 45</form>
diff --git a/src/Wallabag/UserBundle/Resources/views/Resetting/request_content.html.twig b/src/Wallabag/UserBundle/Resources/views/Resetting/request_content.html.twig
index 7a5ac838..010ee0d0 100644
--- a/src/Wallabag/UserBundle/Resources/views/Resetting/request_content.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Resetting/request_content.html.twig
@@ -21,7 +21,7 @@
21 </div> 21 </div>
22 <div class="card-action center"> 22 <div class="card-action center">
23 <a href="{{ path('fos_user_security_login') }}" class="waves-effect waves-light grey btn"> 23 <a href="{{ path('fos_user_security_login') }}" class="waves-effect waves-light grey btn">
24 <i class="material-icons left"></i> {{ 'security.login.submit'|trans({}, "messages") }} 24 {{ 'security.login.submit'|trans({}, "messages") }}
25 </a> 25 </a>
26 <button class="btn waves-effect waves-light" type="submit" name="send"> 26 <button class="btn waves-effect waves-light" type="submit" name="send">
27 {{ 'resetting.request.submit'|trans }} 27 {{ 'resetting.request.submit'|trans }}
diff --git a/src/Wallabag/UserBundle/Resources/views/Resetting/reset_content.html.twig b/src/Wallabag/UserBundle/Resources/views/Resetting/reset_content.html.twig
index 9d0a061c..a19dc7d2 100644
--- a/src/Wallabag/UserBundle/Resources/views/Resetting/reset_content.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Resetting/reset_content.html.twig
@@ -8,7 +8,7 @@
8 <div class="card-action center"> 8 <div class="card-action center">
9 <button class="btn waves-effect waves-light" type="submit" name="send"> 9 <button class="btn waves-effect waves-light" type="submit" name="send">
10 {{ 'resetting.reset.submit'|trans }} 10 {{ 'resetting.reset.submit'|trans }}
11 <i class="mdi-content-send right"></i> 11 <i class="material-icons right">send</i>
12 </button> 12 </button>
13 </div> 13 </div>
14 </div> 14 </div>
diff --git a/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig b/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig
index 5835330d..938f1a31 100644
--- a/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig
@@ -33,10 +33,12 @@
33 </div> 33 </div>
34 <div class="card-action center"> 34 <div class="card-action center">
35 <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" /> 35 <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
36 <a href="{{ path('fos_user_registration_register') }}" class="waves-effect waves-light grey btn"><i class="material-icons left"></i> {{ 'security.login.register'|trans }}</a> 36 {% if registration_enabled %}
37 <a href="{{ path('fos_user_registration_register') }}" class="waves-effect waves-light grey btn">{{ 'security.login.register'|trans }}</a>
38 {% endif %}
37 <button class="btn waves-effect waves-light" type="submit" name="send"> 39 <button class="btn waves-effect waves-light" type="submit" name="send">
38 {{ 'security.login.submit'|trans }} 40 {{ 'security.login.submit'|trans }}
39 <i class="mdi-content-send right"></i> 41 <i class="material-icons right">send</i>
40 </button> 42 </button>
41 </div> 43 </div>
42 <div class="row center"> 44 <div class="row center">
diff --git a/src/Wallabag/UserBundle/Resources/views/layout.html.twig b/src/Wallabag/UserBundle/Resources/views/layout.html.twig
index 1d0189ca..1f6ea255 100644
--- a/src/Wallabag/UserBundle/Resources/views/layout.html.twig
+++ b/src/Wallabag/UserBundle/Resources/views/layout.html.twig
@@ -11,7 +11,7 @@
11<main class="valign-wrapper"> 11<main class="valign-wrapper">
12 <div class="valign row"> 12 <div class="valign row">
13 <div class="card sw"> 13 <div class="card sw">
14 <div class="center"><img src="{{ asset('bundles/wallabagcore/themes/material/img/logo-other_themes.png') }}" alt="wallabag logo" /></div> 14 <div class="center"><img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png') }}" alt="wallabag logo" /></div>
15 {% block fos_user_content %} 15 {% block fos_user_content %}
16 {% endblock fos_user_content %} 16 {% endblock fos_user_content %}
17 </div> 17 </div>