From 2db616b586f473238706e554e809086935e0f33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 13 Oct 2015 22:43:15 +0200 Subject: 2factor authentication via email --- .../CoreBundle/Form/Type/UserInformationType.php | 1 + .../views/themes/baggy/Config/index.html.twig | 8 +++ .../views/themes/material/Config/index.html.twig | 8 +++ src/Wallabag/UserBundle/Entity/User.php | 68 +++++++++++++++++++++- .../UserBundle/Resources/config/services.yml | 19 ++++++ .../themes/baggy/Authentication/form.html.twig | 32 ++++++++++ .../themes/material/Authentication/form.html.twig | 33 +++++++++++ 7 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 src/Wallabag/UserBundle/Resources/views/themes/baggy/Authentication/form.html.twig create mode 100644 src/Wallabag/UserBundle/Resources/views/themes/material/Authentication/form.html.twig (limited to 'src') diff --git a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php index 84f02013..e06c937d 100644 --- a/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php +++ b/src/Wallabag/CoreBundle/Form/Type/UserInformationType.php @@ -13,6 +13,7 @@ class UserInformationType extends AbstractType $builder ->add('name', 'text') ->add('email', 'email') + ->add('twoFactorAuthentication', 'checkbox', array('required' => false)) ->add('save', 'submit') ->remove('username') ->remove('plainPassword') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig index 64305b16..cee4f672 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig @@ -100,6 +100,14 @@ +
+
+ {{ form_label(form.user.twoFactorAuthentication) }} + {{ form_errors(form.user.twoFactorAuthentication) }} + {{ form_widget(form.user.twoFactorAuthentication) }} +
+
+ {{ form_rest(form.user) }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig index 0d8e9f24..b20c4ea5 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig @@ -132,6 +132,14 @@ +
+
+ {{ form_widget(form.user.twoFactorAuthentication) }} + {{ form_label(form.user.twoFactorAuthentication) }} + {{ form_errors(form.user.twoFactorAuthentication) }} +
+
+ + + + + +{% endblock %} diff --git a/src/Wallabag/UserBundle/Resources/views/themes/material/Authentication/form.html.twig b/src/Wallabag/UserBundle/Resources/views/themes/material/Authentication/form.html.twig new file mode 100644 index 00000000..fa0e3dc1 --- /dev/null +++ b/src/Wallabag/UserBundle/Resources/views/themes/material/Authentication/form.html.twig @@ -0,0 +1,33 @@ +{% extends "WallabagUserBundle::layout.html.twig" %} + +{% block fos_user_content %} +
+
+
+ + {% for flashMessage in app.session.flashbag.get("two_factor") %} +

{{ flashMessage|trans }}

+ {% endfor %} + +
+ + +
+ + {% if useTrustedOption %} +
+ + +
+ {% endif %} +
+
+
+ {% trans %}Cancel{% endtrans %} + +
+
+{% endblock %} -- cgit v1.2.3