]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
Change the way to enable 2FA
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / material / Config / index.html.twig
index 5b00eb7bd1e011cf61c4c00f3d69f2fee3c59484..412c18f49f3bdac46dba42d4fe52df54aa8ec2e6 100644 (file)
                                 </div>
                             </div>
 
+                            {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
+
                             {% if twofactor_auth %}
+                                <br/>
+                                <br/>
                                 <div class="row">
-                                    {{ 'config.form_user.two_factor_description'|trans }}
-
-                                    <div class="input-field col s11">
-                                        {{ form_widget(form.user.emailTwoFactor) }}
-                                        {{ form_label(form.user.emailTwoFactor) }}
-                                        {{ form_errors(form.user.emailTwoFactor) }}
-                                    </div>
-                                    <div class="input-field col s11">
-                                        {{ form_widget(form.user.googleTwoFactor) }}
-                                        {{ form_label(form.user.googleTwoFactor) }}
-                                        {{ form_errors(form.user.googleTwoFactor) }}
-                                    </div>
+                                    <h5>{{ 'config.otp.page_title'|trans }}</h5>
+
+                                    <p>{{ 'config.form_user.two_factor_description'|trans }}</p>
+
+                                    <table>
+                                        <thead>
+                                            <tr>
+                                                <th>{{ 'config.form_user.two_factor.table_method'|trans }}</th>
+                                                <th>{{ 'config.form_user.two_factor.table_state'|trans }}</th>
+                                                <th>{{ 'config.form_user.two_factor.table_action'|trans }}</th>
+                                            </tr>
+                                        </thead>
+
+                                        <tbody>
+                                            <tr>
+                                                <td>{{ 'config.form_user.two_factor.emailTwoFactor_label'|trans }}</td>
+                                                <td>{% if app.user.isEmailTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
+                                                <td><a href="{{ path('config_otp_email') }}" class="waves-effect waves-light btn{% if app.user.isEmailTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_email'|trans }}</a></td>
+                                            </tr>
+                                            <tr>
+                                                <td>{{ 'config.form_user.two_factor.googleTwoFactor_label'|trans }}</td>
+                                                <td>{% if app.user.isGoogleTwoFactor %}<b>{{ 'config.form_user.two_factor.state_enabled'|trans }}</b>{% else %}{{ 'config.form_user.two_factor.state_disabled'|trans }}{% endif %}</td>
+                                                <td><a href="{{ path('config_otp_app') }}" class="waves-effect waves-light btn{% if app.user.isGoogleTwoFactor %} disabled{% endif %}">{{ 'config.form_user.two_factor.action_app'|trans }}</a></td>
+                                            </tr>
+                                        </tbody>
+                                    </table>
                                 </div>
-
-                                {% for OtpQrCode in app.session.flashbag.get('OtpQrCode') %}
-                                    <div class="card-panel yellow darken-1 black-text">
-                                        {{ 'config.form_user.two_factor_code_description_1'|trans }}
-                                        <br/>
-                                        {{ 'config.form_user.two_factor_code_description_2'|trans }}
-                                        <br/><br/>
-                                        <img id="2faQrcode" class="hide-on-med-and-down" />
-                                        <script>
-                                            document.getElementById('2faQrcode').src = jrQrcode.getQrBase64('{{ OtpQrCode }}');
-                                        </script>
-                                        <br/><br/>
-                                        {{ 'config.form_user.two_factor_code_description_3'|trans }}
-                                        <br/><br/>
-                                        <strong>{{ app.user.getGoogleAuthenticatorSecret }}</strong>
-                                        <br/><br/>
-                                        {{ 'config.form_user.two_factor_code_description_4'|trans }}
-                                        <br/><br/>
-                                        <strong>{{ app.user.getBackupCodes|join("\n")|nl2br }}</strong>
-                                    </div>
-                                {% endfor %}
                             {% endif %}
-
-                            {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
                             {{ form_widget(form.user._token) }}
                         </form>
                     </div>