var/cache/dev/twig/11/11f73f9024e5666e58358f82e3bfb1e7.php line 44

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* @PimcoreAdmin/Admin/Login/login.html.twig */
  16. class __TwigTemplate_9d61fea1b2e5f7c067231c780242164a extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->blocks = [
  28. 'content' => [$this, 'block_content'],
  29. 'below_footer' => [$this, 'block_below_footer'],
  30. ];
  31. }
  32. protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  33. {
  34. // line 1
  35. return "@PimcoreAdmin/Admin/Login/layout.html.twig";
  36. }
  37. protected function doDisplay(array $context, array $blocks = []): iterable
  38. {
  39. $macros = $this->macros;
  40. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  41. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@PimcoreAdmin/Admin/Login/login.html.twig"));
  42. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  43. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@PimcoreAdmin/Admin/Login/login.html.twig"));
  44. $this->parent = $this->load("@PimcoreAdmin/Admin/Login/layout.html.twig", 1);
  45. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  46. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  47. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  48. }
  49. // line 3
  50. /**
  51. * @return iterable<null|scalar|\Stringable>
  52. */
  53. public function block_content(array $context, array $blocks = []): iterable
  54. {
  55. $macros = $this->macros;
  56. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  57. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
  58. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  59. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
  60. // line 4
  61. yield "<div id=\"loginform\">
  62. <form id=\"form-element\" method=\"post\" action=\"";
  63. // line 5
  64. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pimcore_admin_login_check", ["perspective" => Twig\Extension\CoreExtension::striptags(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 5, $this->source); })()), "request", [], "any", false, false, false, 5), "get", ["perspective"], "method", false, false, false, 5))]), "html", null, true);
  65. yield "\">
  66. ";
  67. // line 7
  68. if (array_key_exists("error", $context)) {
  69. // line 8
  70. yield " <div class=\"text error\">
  71. ";
  72. // line 9
  73. yield $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans((isset($context["error"]) || array_key_exists("error", $context) ? $context["error"] : (function () { throw new RuntimeError('Variable "error" does not exist.', 9, $this->source); })()), [], "admin");
  74. yield "
  75. </div>
  76. ";
  77. }
  78. // line 12
  79. yield "
  80. <input type=\"text\" name=\"username\" autocomplete=\"username\" placeholder=\"";
  81. // line 13
  82. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("username", [], "admin"), "html", null, true);
  83. yield "\" required autofocus>
  84. <input type=\"password\" name=\"password\" autocomplete=\"current-password\" placeholder=\"";
  85. // line 14
  86. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("password", [], "admin"), "html", null, true);
  87. yield "\" required>
  88. <input type=\"hidden\" name=\"csrfToken\" id=\"csrfToken\" value=\"";
  89. // line 15
  90. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["pimcore_csrf"]) || array_key_exists("pimcore_csrf", $context) ? $context["pimcore_csrf"] : (function () { throw new RuntimeError('Variable "pimcore_csrf" does not exist.', 15, $this->source); })()), "getCsrfToken", [], "method", false, false, false, 15), "html", null, true);
  91. yield "\">
  92. <button type=\"submit\">";
  93. // line 17
  94. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("login", [], "admin"), "html", null, true);
  95. yield "</button>
  96. </form>
  97. <a href=\"";
  98. // line 20
  99. yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pimcore_admin_login_lostpassword");
  100. yield "\" class=\"lostpassword\">";
  101. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Forgot your password", [], "admin"), "html", null, true);
  102. yield "?</a>
  103. </div>
  104. ";
  105. // line 23
  106. if ((($tmp = !(isset($context["browserSupported"]) || array_key_exists("browserSupported", $context) ? $context["browserSupported"] : (function () { throw new RuntimeError('Variable "browserSupported" does not exist.', 23, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  107. // line 24
  108. yield "<div id=\"browserinfo\">
  109. <div class=\"text\">
  110. ";
  111. // line 26
  112. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Your browser is not supported. Please install the latest version of one of the following browsers.", [], "admin"), "html", null, true);
  113. yield "
  114. </div>
  115. <div class=\"text browserinfo\">
  116. <a href=\"https://www.google.com/chrome\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Chrome\"><img src=\"/bundles/pimcoreadmin/img/login/chrome.svg\" alt=\"Chrome\"/></a>
  117. <a href=\"https://www.mozilla.org/firefox\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Firefox\"><img src=\"/bundles/pimcoreadmin/img/login/firefox.svg\" alt=\"Firefox\"/></a>
  118. <a href=\"https://www.apple.com/safari\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Safari\"><img src=\"/bundles/pimcoreadmin/img/login/safari.svg\" alt=\"Safari\"/></a>
  119. <a href=\"https://www.microsoft.com/edge\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Edge\"><img src=\"/bundles/pimcoreadmin/img/login/edge.svg\" alt=\"Edge\"/></a>
  120. </div>
  121. <a href=\"#\" onclick=\"showLogin();\">";
  122. // line 36
  123. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Click here to proceed", [], "admin"), "html", null, true);
  124. yield "</a>
  125. </div>
  126. <script type=\"text/javascript\">
  127. function showLogin() {
  128. document.getElementById('loginform').style.display = 'block';
  129. document.getElementById('browserinfo').style.display = 'none';
  130. }
  131. </script>
  132. <style type=\"text/css\">
  133. #loginform {
  134. display: none;
  135. }
  136. </style>
  137. ";
  138. }
  139. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  140. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  141. yield from [];
  142. }
  143. // line 53
  144. /**
  145. * @return iterable<null|scalar|\Stringable>
  146. */
  147. public function block_below_footer(array $context, array $blocks = []): iterable
  148. {
  149. $macros = $this->macros;
  150. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  151. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "below_footer"));
  152. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  153. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "below_footer"));
  154. // line 54
  155. yield "<script>
  156. ";
  157. // line 55
  158. if ((($tmp = !array_key_exists("deeplink", $context)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  159. // line 56
  160. yield " // clear opened tabs store
  161. localStorage.removeItem(\"pimcore_opentabs\");
  162. ";
  163. }
  164. // line 59
  165. yield "
  166. // hide symfony toolbar by default
  167. var symfonyToolbarKey = 'symfony/profiler/toolbar/displayState';
  168. if(!window.localStorage.getItem(symfonyToolbarKey)) {
  169. window.localStorage.setItem(symfonyToolbarKey, 'none');
  170. }
  171. // CSRF token refresh
  172. var formElement = document.getElementById('form-element');
  173. var csrfRefreshInProgress = false;
  174. function refreshCsrfToken() {
  175. csrfRefreshInProgress = true;
  176. formElement.style.opacity = '0.3';
  177. var request = new XMLHttpRequest();
  178. request.open('GET', '";
  179. // line 74
  180. yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pimcore_admin_login_csrf_token");
  181. yield "');
  182. request.onload = function () {
  183. if (this.status >= 200 && this.status < 400) {
  184. var res = JSON.parse(this.response);
  185. document.getElementById('csrfToken').setAttribute('value', res['csrfToken']);
  186. formElement.style.opacity = '1';
  187. csrfRefreshInProgress = false;
  188. }
  189. };
  190. request.send();
  191. }
  192. document.addEventListener('visibilitychange', function(ev) {
  193. if(document.visibilityState === 'visible') {
  194. refreshCsrfToken();
  195. }
  196. });
  197. window.setInterval(refreshCsrfToken, ";
  198. // line 90
  199. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["csrfTokenRefreshInterval"]) || array_key_exists("csrfTokenRefreshInterval", $context) ? $context["csrfTokenRefreshInterval"] : (function () { throw new RuntimeError('Variable "csrfTokenRefreshInterval" does not exist.', 90, $this->source); })()), "html", null, true);
  200. yield ");
  201. formElement.addEventListener(\"submit\", function(evt) {
  202. if(csrfRefreshInProgress) {
  203. evt.preventDefault();
  204. }
  205. }, true);
  206. </script>
  207. ";
  208. // line 99
  209. yield $this->extensions['Pimcore\Twig\Extension\HelpersExtension']->breachAttackRandomContent();
  210. yield "
  211. ";
  212. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  213. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  214. yield from [];
  215. }
  216. /**
  217. * @codeCoverageIgnore
  218. */
  219. public function getTemplateName(): string
  220. {
  221. return "@PimcoreAdmin/Admin/Login/login.html.twig";
  222. }
  223. /**
  224. * @codeCoverageIgnore
  225. */
  226. public function isTraitable(): bool
  227. {
  228. return false;
  229. }
  230. /**
  231. * @codeCoverageIgnore
  232. */
  233. public function getDebugInfo(): array
  234. {
  235. return array ( 243 => 99, 231 => 90, 212 => 74, 195 => 59, 190 => 56, 188 => 55, 185 => 54, 172 => 53, 145 => 36, 132 => 26, 128 => 24, 126 => 23, 118 => 20, 112 => 17, 107 => 15, 103 => 14, 99 => 13, 96 => 12, 90 => 9, 87 => 8, 85 => 7, 80 => 5, 77 => 4, 64 => 3, 41 => 1,);
  236. }
  237. public function getSourceContext(): Source
  238. {
  239. return new Source("{% extends '@PimcoreAdmin/Admin/Login/layout.html.twig' %}
  240. {% block content %}
  241. <div id=\"loginform\">
  242. <form id=\"form-element\" method=\"post\" action=\"{{ path('pimcore_admin_login_check', {'perspective' : app.request.get('perspective')|striptags}) }}\">
  243. {% if error is defined %}
  244. <div class=\"text error\">
  245. {{ error|trans([],'admin')|raw }}
  246. </div>
  247. {% endif %}
  248. <input type=\"text\" name=\"username\" autocomplete=\"username\" placeholder=\"{{ 'username'|trans([], 'admin') }}\" required autofocus>
  249. <input type=\"password\" name=\"password\" autocomplete=\"current-password\" placeholder=\"{{ 'password'|trans([], 'admin') }}\" required>
  250. <input type=\"hidden\" name=\"csrfToken\" id=\"csrfToken\" value=\"{{ pimcore_csrf.getCsrfToken() }}\">
  251. <button type=\"submit\">{{ 'login'|trans([], 'admin') }}</button>
  252. </form>
  253. <a href=\"{{ path('pimcore_admin_login_lostpassword') }}\" class=\"lostpassword\">{{ 'Forgot your password'|trans([], 'admin') }}?</a>
  254. </div>
  255. {% if not browserSupported %}
  256. <div id=\"browserinfo\">
  257. <div class=\"text\">
  258. {{ 'Your browser is not supported. Please install the latest version of one of the following browsers.'|trans([], 'admin') }}
  259. </div>
  260. <div class=\"text browserinfo\">
  261. <a href=\"https://www.google.com/chrome\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Chrome\"><img src=\"/bundles/pimcoreadmin/img/login/chrome.svg\" alt=\"Chrome\"/></a>
  262. <a href=\"https://www.mozilla.org/firefox\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Firefox\"><img src=\"/bundles/pimcoreadmin/img/login/firefox.svg\" alt=\"Firefox\"/></a>
  263. <a href=\"https://www.apple.com/safari\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Safari\"><img src=\"/bundles/pimcoreadmin/img/login/safari.svg\" alt=\"Safari\"/></a>
  264. <a href=\"https://www.microsoft.com/edge\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"Edge\"><img src=\"/bundles/pimcoreadmin/img/login/edge.svg\" alt=\"Edge\"/></a>
  265. </div>
  266. <a href=\"#\" onclick=\"showLogin();\">{{ 'Click here to proceed'|trans([], 'admin') }}</a>
  267. </div>
  268. <script type=\"text/javascript\">
  269. function showLogin() {
  270. document.getElementById('loginform').style.display = 'block';
  271. document.getElementById('browserinfo').style.display = 'none';
  272. }
  273. </script>
  274. <style type=\"text/css\">
  275. #loginform {
  276. display: none;
  277. }
  278. </style>
  279. {% endif %}
  280. {% endblock %}
  281. {% block below_footer %}
  282. <script>
  283. {% if deeplink is not defined %}
  284. // clear opened tabs store
  285. localStorage.removeItem(\"pimcore_opentabs\");
  286. {% endif %}
  287. // hide symfony toolbar by default
  288. var symfonyToolbarKey = 'symfony/profiler/toolbar/displayState';
  289. if(!window.localStorage.getItem(symfonyToolbarKey)) {
  290. window.localStorage.setItem(symfonyToolbarKey, 'none');
  291. }
  292. // CSRF token refresh
  293. var formElement = document.getElementById('form-element');
  294. var csrfRefreshInProgress = false;
  295. function refreshCsrfToken() {
  296. csrfRefreshInProgress = true;
  297. formElement.style.opacity = '0.3';
  298. var request = new XMLHttpRequest();
  299. request.open('GET', '{{ path(\"pimcore_admin_login_csrf_token\") }}');
  300. request.onload = function () {
  301. if (this.status >= 200 && this.status < 400) {
  302. var res = JSON.parse(this.response);
  303. document.getElementById('csrfToken').setAttribute('value', res['csrfToken']);
  304. formElement.style.opacity = '1';
  305. csrfRefreshInProgress = false;
  306. }
  307. };
  308. request.send();
  309. }
  310. document.addEventListener('visibilitychange', function(ev) {
  311. if(document.visibilityState === 'visible') {
  312. refreshCsrfToken();
  313. }
  314. });
  315. window.setInterval(refreshCsrfToken, {{ csrfTokenRefreshInterval }});
  316. formElement.addEventListener(\"submit\", function(evt) {
  317. if(csrfRefreshInProgress) {
  318. evt.preventDefault();
  319. }
  320. }, true);
  321. </script>
  322. {{ pimcore_breach_attack_random_content() }}
  323. {% endblock %}
  324. ", "@PimcoreAdmin/Admin/Login/login.html.twig", "/home/pim/pim-world/vendor/pimcore/pimcore/bundles/AdminBundle/Resources/views/Admin/Login/login.html.twig");
  325. }
  326. }