var/cache/dev/twig/9d/9d69a6d6571c9292c1d084ecde2dfb6a.php line 51

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