496d55c030d8d0acf77af172547f07daba7d039cd929b3fdb16ad94a8d9a713f.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /* forms/fields/2fa_secret/2fa_secret.html.twig */
  3. class __TwigTemplate_02d9defc2b9c0eade27913446a5bdea983e84008d19eb8dd30da02125aa963e9 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. // line 1
  9. $this->parent = $this->loadTemplate("forms/field.html.twig", "forms/fields/2fa_secret/2fa_secret.html.twig", 1);
  10. $this->blocks = array(
  11. 'input' => array($this, 'block_input'),
  12. );
  13. }
  14. protected function doGetParent(array $context)
  15. {
  16. return "forms/field.html.twig";
  17. }
  18. protected function doDisplay(array $context, array $blocks = array())
  19. {
  20. $this->parent->display($context, array_merge($this->blocks, $blocks));
  21. }
  22. // line 3
  23. public function block_input($context, array $blocks = array())
  24. {
  25. // line 4
  26. echo " <div class=\"form-input-wrapper twofa-wrapper\">
  27. ";
  28. // line 5
  29. $this->getAttribute(($context["admin"] ?? null), "get2FAData", array(0 => ($context["value"] ?? null)), "method");
  30. // line 6
  31. echo " ";
  32. $context["data"] = $this->getAttribute(($context["admin"] ?? null), "json_response", array());
  33. // line 7
  34. echo " ";
  35. if (($this->getAttribute(($context["data"] ?? null), "status", array()) == "success")) {
  36. // line 8
  37. echo "
  38. <img style=\"border: 1px solid #ddd\" data-2fa-image src=\"";
  39. // line 9
  40. echo twig_escape_filter($this->env, $this->getAttribute(($context["data"] ?? null), "image", array()), "html", null, true);
  41. echo "\" />
  42. <div>
  43. <span>";
  44. // line 11
  45. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.2FA_SECRET"), "html", null, true);
  46. echo ": </span><span class=\"twofa-secret-code\" data-2fa-secret>";
  47. echo twig_escape_filter($this->env, $this->getAttribute(($context["data"] ?? null), "secret", array()), "html", null, true);
  48. echo "</span>
  49. </div>
  50. <div class=\"danger\">
  51. <button data-hint=\"";
  52. // line 14
  53. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Plugin\Admin\AdminTwigExtension')->tuFilter("PLUGIN_ADMIN.2FA_REGEN_HINT"), "html", null, true);
  54. echo "\" class=\"button button-small hint--bottom\" data-2fa-regenerate><i class=\"fa fa-fw fa-refresh\"></i> ";
  55. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Common\Twig\TwigExtension')->translate("PLUGIN_ADMIN.2FA_REGENERATE"), "html", null, true);
  56. echo "</button>
  57. </div>
  58. <input type=\"text\" style=\"display:none;\" name=\"";
  59. // line 16
  60. echo twig_escape_filter($this->env, $this->env->getExtension('Grav\Common\Twig\TwigExtension')->fieldNameFilter((($context["scope"] ?? null) . $this->getAttribute(($context["field"] ?? null), "name", array()))), "html", null, true);
  61. echo "\" data-2fa-value value=\"";
  62. echo twig_escape_filter($this->env, twig_replace_filter($this->getAttribute(($context["data"] ?? null), "secret", array()), array(" " => "")), "html", null, true);
  63. echo "\" />
  64. ";
  65. } else {
  66. // line 19
  67. echo " <div class=\"notice error\">
  68. <p>";
  69. // line 20
  70. echo twig_escape_filter($this->env, $this->getAttribute(($context["data"] ?? null), "message", array()), "html", null, true);
  71. echo "</p>
  72. </div>
  73. ";
  74. }
  75. // line 23
  76. echo " </div>
  77. ";
  78. }
  79. public function getTemplateName()
  80. {
  81. return "forms/fields/2fa_secret/2fa_secret.html.twig";
  82. }
  83. public function isTraitable()
  84. {
  85. return false;
  86. }
  87. public function getDebugInfo()
  88. {
  89. return array ( 82 => 23, 76 => 20, 73 => 19, 65 => 16, 58 => 14, 50 => 11, 45 => 9, 42 => 8, 39 => 7, 36 => 6, 34 => 5, 31 => 4, 28 => 3, 11 => 1,);
  90. }
  91. /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
  92. public function getSource()
  93. {
  94. @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
  95. return $this->getSourceContext()->getCode();
  96. }
  97. public function getSourceContext()
  98. {
  99. return new Twig_Source("{% extends \"forms/field.html.twig\" %}
  100. {% block input %}
  101. <div class=\"form-input-wrapper twofa-wrapper\">
  102. {% do admin.get2FAData(value) %}
  103. {% set data = admin.json_response %}
  104. {% if data.status == 'success' %}
  105. <img style=\"border: 1px solid #ddd\" data-2fa-image src=\"{{ data.image }}\" />
  106. <div>
  107. <span>{{ 'PLUGIN_ADMIN.2FA_SECRET'|tu }}: </span><span class=\"twofa-secret-code\" data-2fa-secret>{{ data.secret }}</span>
  108. </div>
  109. <div class=\"danger\">
  110. <button data-hint=\"{{ 'PLUGIN_ADMIN.2FA_REGEN_HINT'|tu }}\" class=\"button button-small hint--bottom\" data-2fa-regenerate><i class=\"fa fa-fw fa-refresh\"></i> {{ 'PLUGIN_ADMIN.2FA_REGENERATE'|t }}</button>
  111. </div>
  112. <input type=\"text\" style=\"display:none;\" name=\"{{ (scope ~ field.name)|fieldName }}\" data-2fa-value value=\"{{ data.secret|replace({' ':''}) }}\" />
  113. {% else %}
  114. <div class=\"notice error\">
  115. <p>{{ data.message }}</p>
  116. </div>
  117. {% endif %}
  118. </div>
  119. {% endblock %}
  120. ", "forms/fields/2fa_secret/2fa_secret.html.twig", "/home/kevin/Sites/static-ethica.net/user/plugins/admin/themes/grav/templates/forms/fields/2fa_secret/2fa_secret.html.twig");
  121. }
  122. }