Files
Froxlor/templates/Froxlor/user/2fa.html.twig
2022-03-18 11:41:07 +01:00

49 lines
1.7 KiB
Twig

{% extends "Froxlor/userarea.html.twig" %}
{% block content %}
<div class="container">
<div class="row justify-content-center">
{% if userinfo.type_2fa == 0 %}
{% set linkeraction = 'add' %}
{% else %}
{% set linkeraction = 'delete' %}
{% endif %}
<form action="{{ linker({'section':'index','action':linkeraction}) }}" class="col-12 max-w-420 d-flex flex-column" method="post" enctype="application/x-www-form-urlencoded">
<div class="card shadow">
<div class="card-body">
<h5 class="card-title">{{ lng('login.2fa') }}</h5>
<div>
{% if userinfo.type_2fa == 0 %}
<label for="type_2fa" class="col-form-label">{{ lng('2fa.2fa_overview_desc')|raw }}</label>
<select class="form-select" name="type_2fa" id="type_2fa" required>
{% for val,opt in type_select_values %}
<option value="{{ val }}">{{ opt }}</option>
{% endfor %}
</select>
{% elseif userinfo.type_2fa == 2 %}
<label for="qrcode" class="col-form-label">{{ lng('2fa.2fa_ga_desc')|raw }}</label>
<img src="{{ ga_qrcode }}" class="img-fluid" alt="QRCode" id="qrcode"/>
{% endif %}
</div>
</div>
<div class="card-body d-grid gap-2">
<input type="hidden" name="page" value="{{ page }}"/>
<input type="hidden" name="send" value="send"/>
{% if userinfo.type_2fa == 0 %}
<button class="btn btn-primary rounded-top-0" type="submit" name="add">
{{ lng('2fa.2fa_add') }}</button>
{% else %}
<button class="btn btn-warning rounded-top-0" type="submit" name="delete">
{{ lng('2fa.2fa_delete') }}</button>
{% endif %}
</div>
</div>
</form>
</div>
</div>
{% endblock %}