main.twig 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <div class="group">
  2. <h2>
  3. {% trans "Two-factor authentication status" %}
  4. {{ show_docu('two_factor') }}
  5. </h2>
  6. <div class="group-cnt">
  7. {% if enabled %}
  8. {% if num_backends == 0 %}
  9. <p>{% trans "Two-factor authentication is not available, please install optional dependencies to enable authentication backends." %}</p>
  10. <p>{% trans "Following composer packages are missing:" %}</p>
  11. <ul>
  12. {% for item in missing %}
  13. <li><code>{{ item.dep }}</code> ({{ item.class }})</li>
  14. {% endfor %}
  15. </ul>
  16. {% else %}
  17. {% if backend_id %}
  18. <p>{% trans "Two-factor authentication is available and configured for this account." %}</p>
  19. {% else %}
  20. <p>{% trans "Two-factor authentication is available, but not configured for this account." %}</p>
  21. {% endif %}
  22. {% endif %}
  23. {% else %}
  24. <p>{% trans "Two-factor authentication is not available, enable phpMyAdmin configuration storage to use it." %}</p>
  25. {% endif %}
  26. </div>
  27. </div>
  28. {% if backend_id %}
  29. <div class="group">
  30. <h2>{{ backend_name }}</h2>
  31. <div class="group-cnt">
  32. <p>{% trans "You have enabled two factor authentication." %}</p>
  33. <p>{{ backend_description }}</p>
  34. <form method="post" action="prefs_twofactor.php">
  35. {{ get_hidden_inputs() }}
  36. <input class="btn btn-secondary" type="submit" name="2fa_remove" value="
  37. {%- trans "Disable two-factor authentication" %}">
  38. </form>
  39. </div>
  40. </div>
  41. {% elseif num_backends > 0 %}
  42. <div class="group">
  43. <h2>{% trans "Configure two-factor authentication" %}</h2>
  44. <div class="group-cnt">
  45. <form method="post" action="prefs_twofactor.php">
  46. {{ get_hidden_inputs() }}
  47. {% for backend in backends %}
  48. <label class="displayblock">
  49. <input type="radio" name="2fa_configure" value="{{ backend["id"] }}"
  50. {{- backend["id"] == "" ? ' checked' }}>
  51. <strong>{{ backend["name"] }}</strong>
  52. <p>{{ backend["description"] }}</p>
  53. </label>
  54. {% endfor %}
  55. <input class="btn btn-secondary" type="submit" value="{% trans "Configure two-factor authentication" %}">
  56. </form>
  57. </div>
  58. </div>
  59. {% endif %}