{% extends "admin/base_admin.html.twig" %} {% import "helper.twig" as helper %} {# @var entity \App\Entity\UserSystem\User #} {% block card_title %} {% trans %}user.edit.caption{% endtrans %} {% endblock %} {% block comment %}{% endblock %} {% block additional_pills %}
{% trans %}user.edit.tfa.google_active{% endtrans %}: {{ helper.boolean(entity.googleAuthenticatorEnabled) }}
{% trans %}tfa_backup.remaining_tokens{% endtrans %}: {{ entity.backupCodes | length }}
{% trans %}tfa_backup.generation_date{% endtrans %}: {% if entity.backupCodesGenerationDate is not null %} {{ entity.backupCodesGenerationDate | format_datetime }} {% else %} {% trans %}user.edit.tfa.disabled{% endtrans %} {% endif %}
{% trans %}user.edit.tfa.u2f_keys_count{% endtrans %}: {% if entity.webAuthnAuthenticatorEnabled %} {{ (entity.webauthnKeys | length) + (entity.legacyU2FKeys | length) }} {% else %} {% trans %}user.edit.tfa.disabled{% endtrans %} {% endif %}
{% set tfa_disable_disabled = not is_granted('set_password', entity) %} {# Disable button when he has no 2FA activated #} {% if not entity.webAuthnAuthenticatorEnabled and not entity.googleAuthenticatorEnabled and entity.backupCodes is empty %} {% set tfa_disable_disabled = true %} {% endif %}