<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* @PimcoreAdmin/Admin/Login/login.html.twig */
class __TwigTemplate_61d471fb17c559447072a92a263a1c5f extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'content' => [$this, 'block_content'],
'below_footer' => [$this, 'block_below_footer'],
];
$this->sandbox = $this->extensions[SandboxExtension::class];
$this->checkSecurity();
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "@PimcoreAdmin/Admin/Login/layout.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@PimcoreAdmin/Admin/Login/login.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@PimcoreAdmin/Admin/Login/login.html.twig"));
$this->parent = $this->loadTemplate("@PimcoreAdmin/Admin/Login/layout.html.twig", "@PimcoreAdmin/Admin/Login/login.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 4
yield "<div id=\"loginform\">
<form id=\"form-element\" method=\"post\" action=\"";
// line 5
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($this->sandbox->ensureToStringAllowed(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, true, 5), "get", ["perspective"], "method", false, false, true, 5), 5, $this->source))]), "html", null, true);
yield "\">
";
// line 7
if (array_key_exists("error", $context)) {
// line 8
yield " <div class=\"text error\">
";
// line 9
yield $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");
yield "
</div>
";
}
// line 12
yield "
<input type=\"text\" name=\"username\" autocomplete=\"username\" placeholder=\"";
// line 13
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("username", [], "admin"), "html", null, true);
yield "\" required autofocus>
<input type=\"password\" name=\"password\" autocomplete=\"current-password\" placeholder=\"";
// line 14
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("password", [], "admin"), "html", null, true);
yield "\" required>
<input type=\"hidden\" name=\"csrfToken\" id=\"csrfToken\" value=\"";
// line 15
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->sandbox->ensureToStringAllowed(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, true, 15), 15, $this->source), "html", null, true);
yield "\">
<button type=\"submit\">";
// line 17
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("login", [], "admin"), "html", null, true);
yield "</button>
</form>
<a href=\"";
// line 20
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pimcore_admin_login_lostpassword");
yield "\" class=\"lostpassword\">";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Forgot your password", [], "admin"), "html", null, true);
yield "?</a>
</div>
";
// line 23
if ( !(isset($context["browserSupported"]) || array_key_exists("browserSupported", $context) ? $context["browserSupported"] : (function () { throw new RuntimeError('Variable "browserSupported" does not exist.', 23, $this->source); })())) {
// line 24
yield "<div id=\"browserinfo\">
<div class=\"text\">
";
// line 26
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);
yield "
</div>
<div class=\"text browserinfo\">
<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>
<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>
<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>
<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>
</div>
<a href=\"#\" onclick=\"showLogin();\">";
// line 36
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Click here to proceed", [], "admin"), "html", null, true);
yield "</a>
</div>
<script type=\"text/javascript\">
function showLogin() {
document.getElementById('loginform').style.display = 'block';
document.getElementById('browserinfo').style.display = 'none';
}
</script>
<style type=\"text/css\">
#loginform {
display: none;
}
</style>
";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 53
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_below_footer(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "below_footer"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "below_footer"));
// line 54
yield "<script ";
yield $this->sandbox->ensureToStringAllowed(CoreExtension::getAttribute($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", false, false, true, 54), 54, $this->source);
yield ">
";
// line 55
if ( !array_key_exists("deeplink", $context)) {
// line 56
yield " // clear opened tabs store
localStorage.removeItem(\"pimcore_opentabs\");
";
}
// line 59
yield "
// hide symfony toolbar by default
var symfonyToolbarKey = 'symfony/profiler/toolbar/displayState';
if(!window.localStorage.getItem(symfonyToolbarKey)) {
window.localStorage.setItem(symfonyToolbarKey, 'none');
}
// CSRF token refresh
var formElement = document.getElementById('form-element');
var csrfRefreshInProgress = false;
function refreshCsrfToken() {
csrfRefreshInProgress = true;
formElement.style.opacity = '0.3';
var request = new XMLHttpRequest();
request.open('GET', '";
// line 74
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("pimcore_admin_login_csrf_token");
yield "');
request.onload = function () {
if (this.status >= 200 && this.status < 400) {
var res = JSON.parse(this.response);
document.getElementById('csrfToken').setAttribute('value', res['csrfToken']);
formElement.style.opacity = '1';
csrfRefreshInProgress = false;
}
};
request.send();
}
document.addEventListener('visibilitychange', function(ev) {
if(document.visibilityState === 'visible') {
refreshCsrfToken();
}
});
window.setInterval(refreshCsrfToken, ";
// line 90
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($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", null, true);
yield ");
formElement.addEventListener(\"submit\", function(evt) {
if(csrfRefreshInProgress) {
evt.preventDefault();
}
}, true);
</script>
";
// line 99
yield $this->extensions['Pimcore\Twig\Extension\HelpersExtension']->breachAttackRandomContent();
yield "
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "@PimcoreAdmin/Admin/Login/login.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 247 => 99, 235 => 90, 216 => 74, 199 => 59, 194 => 56, 192 => 55, 187 => 54, 174 => 53, 147 => 36, 134 => 26, 130 => 24, 128 => 23, 120 => 20, 114 => 17, 109 => 15, 105 => 14, 101 => 13, 98 => 12, 92 => 9, 89 => 8, 87 => 7, 82 => 5, 79 => 4, 66 => 3, 43 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends '@PimcoreAdmin/Admin/Login/layout.html.twig' %}
{% block content %}
<div id=\"loginform\">
<form id=\"form-element\" method=\"post\" action=\"{{ path('pimcore_admin_login_check', {'perspective' : app.request.get('perspective')|striptags}) }}\">
{% if error is defined %}
<div class=\"text error\">
{{ error|trans([],'admin')|raw }}
</div>
{% endif %}
<input type=\"text\" name=\"username\" autocomplete=\"username\" placeholder=\"{{ 'username'|trans([], 'admin') }}\" required autofocus>
<input type=\"password\" name=\"password\" autocomplete=\"current-password\" placeholder=\"{{ 'password'|trans([], 'admin') }}\" required>
<input type=\"hidden\" name=\"csrfToken\" id=\"csrfToken\" value=\"{{ pimcore_csrf.getCsrfToken() }}\">
<button type=\"submit\">{{ 'login'|trans([], 'admin') }}</button>
</form>
<a href=\"{{ path('pimcore_admin_login_lostpassword') }}\" class=\"lostpassword\">{{ 'Forgot your password'|trans([], 'admin') }}?</a>
</div>
{% if not browserSupported %}
<div id=\"browserinfo\">
<div class=\"text\">
{{ 'Your browser is not supported. Please install the latest version of one of the following browsers.'|trans([], 'admin') }}
</div>
<div class=\"text browserinfo\">
<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>
<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>
<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>
<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>
</div>
<a href=\"#\" onclick=\"showLogin();\">{{ 'Click here to proceed'|trans([], 'admin') }}</a>
</div>
<script type=\"text/javascript\">
function showLogin() {
document.getElementById('loginform').style.display = 'block';
document.getElementById('browserinfo').style.display = 'none';
}
</script>
<style type=\"text/css\">
#loginform {
display: none;
}
</style>
{% endif %}
{% endblock %}
{% block below_footer %}
<script {{ pimcore_csp.getNonceHtmlAttribute()|raw }}>
{% if deeplink is not defined %}
// clear opened tabs store
localStorage.removeItem(\"pimcore_opentabs\");
{% endif %}
// hide symfony toolbar by default
var symfonyToolbarKey = 'symfony/profiler/toolbar/displayState';
if(!window.localStorage.getItem(symfonyToolbarKey)) {
window.localStorage.setItem(symfonyToolbarKey, 'none');
}
// CSRF token refresh
var formElement = document.getElementById('form-element');
var csrfRefreshInProgress = false;
function refreshCsrfToken() {
csrfRefreshInProgress = true;
formElement.style.opacity = '0.3';
var request = new XMLHttpRequest();
request.open('GET', '{{ path(\"pimcore_admin_login_csrf_token\") }}');
request.onload = function () {
if (this.status >= 200 && this.status < 400) {
var res = JSON.parse(this.response);
document.getElementById('csrfToken').setAttribute('value', res['csrfToken']);
formElement.style.opacity = '1';
csrfRefreshInProgress = false;
}
};
request.send();
}
document.addEventListener('visibilitychange', function(ev) {
if(document.visibilityState === 'visible') {
refreshCsrfToken();
}
});
window.setInterval(refreshCsrfToken, {{ csrfTokenRefreshInterval }});
formElement.addEventListener(\"submit\", function(evt) {
if(csrfRefreshInProgress) {
evt.preventDefault();
}
}, true);
</script>
{{ pimcore_breach_attack_random_content() }}
{% endblock %}
", "@PimcoreAdmin/Admin/Login/login.html.twig", "/var/www/vhosts/novo-peak.it/staging.speck-pim.novo-peak.it/vendor/pimcore/pimcore/bundles/AdminBundle/Resources/views/Admin/Login/login.html.twig");
}
public function checkSecurity()
{
static $tags = ["extends" => 1, "if" => 7];
static $filters = ["escape" => 5, "striptags" => 5, "raw" => 9, "trans" => 9];
static $functions = ["path" => 5, "pimcore_breach_attack_random_content" => 99];
try {
$this->sandbox->checkSecurity(
['extends', 'if'],
['escape', 'striptags', 'raw', 'trans'],
['path', 'pimcore_breach_attack_random_content'],
$this->source
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}