prefs_twofactor.twig 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <div class="group">
  2. <h2>
  3. {% trans "Two-factor authentication status" %}
  4. {{ Util_showDocu('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. {{ Url_getHiddenInputs() }}
  36. <input type="submit" name="2fa_remove" value="{% trans "Disable two-factor authentication" %}" />
  37. </form>
  38. </div>
  39. </div>
  40. {% elseif num_backends > 0 %}
  41. <div class="group">
  42. <h2>{% trans "Configure two-factor authentication" %}</h2>
  43. <div class="group-cnt">
  44. <form method="POST" action="prefs_twofactor.php">
  45. {{ Url_getHiddenInputs() }}
  46. {% for backend in backends %}
  47. <label>
  48. <input type="radio" name="2fa_configure" {% if backend["id"] == "" %}checked="checked"{% endif %} value="{{ backend["id"] }}"/>
  49. <strong>{{ backend["name"] }}</strong>
  50. <p>{{ backend["description"] }}</p>
  51. </label>
  52. {% endfor %}
  53. <input type="submit" value="{% trans "Configure two-factor authentication" %}" />
  54. </form>
  55. </div>
  56. </div>
  57. {% endif %}