The Framework Code

twigs/framework/util/add2fa.twig

File List

{% set usebootbox = FALSE %}

{% extends '@content/page.twig' %}

{% import '@util/formmacro.twig' as f %}

{% block headerbody %}
    <h1>Enable 2-Factor Authentication</h1>
{% endblock headerbody %}

{% block main %}
    <section class="row">
        <article class="mx-auto col-md-8">
            {% include '@util/message.twig' %}
            {% if qrcode != '' %}
                <p>Scan this QR-code using your authenticator app:</p>
                <p><img src="{{qrcode}}"/></p>
                <p>And then enter the code generated and submit the form:</p>
                {{f.startform({method: 'post'})}}
                    {{f.text({label: 'Code', name: 'validator', ph: 'Code from your app', required: TRUE})}}
                    {{f.submit({value: 'Verify'})}}
                {{f.endform()}}
            {% elseif resend %}
                <p>Enter the code generated by your app and submit the form:</p>
                {{f.startform({method: 'post'})}}
                    {{f.text({label: 'Code', name: 'validator', ph: 'Code from your app', required: TRUE})}}
                    {{f.submit({value: 'Verify'})}}
                {{f.endform()}}
            {% elseif not disabled is defined %}
                {{f.startform({method: 'post'})}}
                    {{f.hidden({name: 'disable', value: 1})}}
                    {{f.submit({value: 'Disable 2-Factor Authentication'})}}
                {{f.endform()}}
            {% endif %}
        </article>
    </section>
{% endblock main %}

{% block pagefooter %}
{% endblock pagefooter %}