var/cache/dev/twig/0e/0ea8e1ed92fa4b3f1e15b1a77595a33f.php line 41

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_bc8176087b378688b17596baa831f587 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, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'5$this->source); })()), "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((isset($context["error"]) || array_key_exists("error"$context) ? $context["error"] : (function () { throw new RuntimeError('Variable "error" does not exist.'9$this->source); })()), 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, (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"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 ( !(isset($context["browserSupported"]) || array_key_exists("browserSupported"$context) ? $context["browserSupported"] : (function () { throw new RuntimeError('Variable "browserSupported" does not exist.'23$this->source); })())) {
  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, (isset($context["pimcore_csp"]) || array_key_exists("pimcore_csp"$context) ? $context["pimcore_csp"] : (function () { throw new RuntimeError('Variable "pimcore_csp" does not exist.'54$this->source); })()), "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((isset($context["csrfTokenRefreshInterval"]) || array_key_exists("csrfTokenRefreshInterval"$context) ? $context["csrfTokenRefreshInterval"] : (function () { throw new RuntimeError('Variable "csrfTokenRefreshInterval" does not exist.'90$this->source); })()), 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.     /**
  214.      * @codeCoverageIgnore
  215.      */
  216.     public function getTemplateName()
  217.     {
  218.         return "@PimcoreAdmin/Admin/Login/login.html.twig";
  219.     }
  220.     /**
  221.      * @codeCoverageIgnore
  222.      */
  223.     public function isTraitable()
  224.     {
  225.         return false;
  226.     }
  227.     /**
  228.      * @codeCoverageIgnore
  229.      */
  230.     public function getDebugInfo()
  231.     {
  232.         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,);
  233.     }
  234.     public function getSourceContext()
  235.     {
  236.         return new Source("{% extends '@PimcoreAdmin/Admin/Login/layout.html.twig' %}
  237. {% block content %}
  238. <div id=\"loginform\">
  239.     <form id=\"form-element\" method=\"post\" action=\"{{ path('pimcore_admin_login_check', {'perspective' : app.request.get('perspective')|striptags}) }}\">
  240.         {% if error is defined %}
  241.         <div class=\"text error\">
  242.             {{ error|trans([],'admin')|raw }}
  243.         </div>
  244.         {% endif %}
  245.         <input type=\"text\" name=\"username\" autocomplete=\"username\" placeholder=\"{{ 'username'|trans([], 'admin') }}\" required autofocus>
  246.         <input type=\"password\" name=\"password\" autocomplete=\"current-password\" placeholder=\"{{ 'password'|trans([], 'admin') }}\" required>
  247.         <input type=\"hidden\" name=\"csrfToken\" id=\"csrfToken\" value=\"{{ pimcore_csrf.getCsrfToken() }}\">
  248.         <button type=\"submit\">{{ 'login'|trans([], 'admin') }}</button>
  249.     </form>
  250.     <a href=\"{{ path('pimcore_admin_login_lostpassword') }}\" class=\"lostpassword\">{{ 'Forgot your password'|trans([], 'admin') }}?</a>
  251. </div>
  252. {% if not browserSupported %}
  253. <div id=\"browserinfo\">
  254.     <div class=\"text\">
  255.         {{ 'Your browser is not supported. Please install the latest version of one of the following browsers.'|trans([], 'admin') }}
  256.     </div>
  257.     <div class=\"text browserinfo\">
  258.         <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>
  259.         <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>
  260.         <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>
  261.         <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>
  262.     </div>
  263.     <a href=\"#\" onclick=\"showLogin();\">{{ 'Click here to proceed'|trans([], 'admin') }}</a>
  264. </div>
  265. <script type=\"text/javascript\">
  266.     function showLogin() {
  267.         document.getElementById('loginform').style.display = 'block';
  268.         document.getElementById('browserinfo').style.display = 'none';
  269.     }
  270. </script>
  271. <style type=\"text/css\">
  272.     #loginform {
  273.         display: none;
  274.     }
  275. </style>
  276. {% endif %}
  277. {% endblock %}
  278. {% block below_footer %}
  279. <script {{ pimcore_csp.getNonceHtmlAttribute()|raw }}>
  280.     {% if deeplink is not defined %}
  281.     // clear opened tabs store
  282.     localStorage.removeItem(\"pimcore_opentabs\");
  283.     {% endif %}
  284.     // hide symfony toolbar by default
  285.     var symfonyToolbarKey = 'symfony/profiler/toolbar/displayState';
  286.     if(!window.localStorage.getItem(symfonyToolbarKey)) {
  287.         window.localStorage.setItem(symfonyToolbarKey, 'none');
  288.     }
  289.     // CSRF token refresh
  290.     var formElement = document.getElementById('form-element');
  291.     var csrfRefreshInProgress = false;
  292.     function refreshCsrfToken() {
  293.         csrfRefreshInProgress = true;
  294.         formElement.style.opacity = '0.3';
  295.         var request = new XMLHttpRequest();
  296.         request.open('GET', '{{ path(\"pimcore_admin_login_csrf_token\") }}');
  297.         request.onload = function () {
  298.             if (this.status >= 200 && this.status < 400) {
  299.                 var res = JSON.parse(this.response);
  300.                 document.getElementById('csrfToken').setAttribute('value', res['csrfToken']);
  301.                 formElement.style.opacity = '1';
  302.                 csrfRefreshInProgress = false;
  303.             }
  304.         };
  305.         request.send();
  306.     }
  307.     document.addEventListener('visibilitychange', function(ev) {
  308.         if(document.visibilityState === 'visible') {
  309.             refreshCsrfToken();
  310.         }
  311.     });
  312.     window.setInterval(refreshCsrfToken, {{ csrfTokenRefreshInterval }});
  313.     formElement.addEventListener(\"submit\", function(evt) {
  314.         if(csrfRefreshInProgress) {
  315.             evt.preventDefault();
  316.         }
  317.     }, true);
  318. </script>
  319. {{ pimcore_breach_attack_random_content() }}
  320. {% endblock %}
  321. ""@PimcoreAdmin/Admin/Login/login.html.twig""/var/www/dev-10/vendor/pimcore/pimcore/bundles/AdminBundle/Resources/views/Admin/Login/login.html.twig");
  322.     }
  323.     
  324.     public function checkSecurity()
  325.     {
  326.         static $tags = array("if" => 7);
  327.         static $filters = array("escape" => 5"striptags" => 5"raw" => 9"trans" => 9);
  328.         static $functions = array("path" => 5"pimcore_breach_attack_random_content" => 99);
  329.         try {
  330.             $this->sandbox->checkSecurity(
  331.                 ['if'],
  332.                 ['escape''striptags''raw''trans'],
  333.                 ['path''pimcore_breach_attack_random_content']
  334.             );
  335.         } catch (SecurityError $e) {
  336.             $e->setSourceContext($this->source);
  337.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  338.                 $e->setTemplateLine($tags[$e->getTagName()]);
  339.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  340.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  341.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  342.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  343.             }
  344.             throw $e;
  345.         }
  346.     }
  347. }