Skip to content
Permalink
Browse files

Fix some minor issues

  • Loading branch information...
leofeyer committed Jul 9, 2019
1 parent 01ca3e1 commit 43b4a54e1accf926b24a975019f8b2e6884402f1
@@ -138,6 +138,6 @@ public function onKernelRequest(GetResponseEvent $event): void
}
}
throw new UnauthorizedHttpException('', 'Missing two-factor authentication.');
throw new UnauthorizedHttpException('', 'Missing two-factor authentication');
}
}
@@ -55,6 +55,16 @@ services:
tags:
- { name: kernel.event_listener, event: kernel.terminate, method: onKernelTerminate }

contao.listener.csrf_token_cookie:
class: Contao\CoreBundle\EventListener\CsrfTokenCookieListener
arguments:
- '@contao.csrf.token_storage'
- '%contao.csrf_cookie_prefix%'
tags:
# The priority must be higher than the one of the Symfony route listener (defaults to 32)
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 36 }
- { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }

contao.listener.data_container_callback:
class: Contao\CoreBundle\EventListener\DataContainerCallbackListener
tags:
@@ -183,16 +193,6 @@ services:
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }

contao.listener.csrf_token_cookie:
class: Contao\CoreBundle\EventListener\CsrfTokenCookieListener
arguments:
- '@contao.csrf.token_storage'
- '%contao.csrf_cookie_prefix%'
tags:
# The priority must be higher than the one of the Symfony route listener (defaults to 32)
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest, priority: 36 }
- { name: kernel.event_listener, event: kernel.response, method: onKernelResponse }

contao.listener.user_session:
class: Contao\CoreBundle\EventListener\UserSessionListener
arguments:
@@ -157,7 +157,7 @@
'regular' => '{title_legend},title,alias,type;{meta_legend},pageTitle,robots,description;{protected_legend:hide},protected;{layout_legend:hide},includeLayout;{cache_legend:hide},includeCache;{chmod_legend:hide},includeChmod;{expert_legend:hide},cssClass,sitemap,hide,noSearch,guests,requireItem;{tabnav_legend:hide},tabindex,accesskey;{publish_legend},published,start,stop',
'forward' => '{title_legend},title,alias,type;{meta_legend},pageTitle;{redirect_legend},jumpTo,redirect;{protected_legend:hide},protected;{layout_legend:hide},includeLayout;{cache_legend:hide},includeCache;{chmod_legend:hide},includeChmod;{expert_legend:hide},cssClass,sitemap,hide,guests;{tabnav_legend:hide},tabindex,accesskey;{publish_legend},published,start,stop',
'redirect' => '{title_legend},title,alias,type;{meta_legend},pageTitle;{redirect_legend},redirect,url,target;{protected_legend:hide},protected;{layout_legend:hide},includeLayout;{cache_legend:hide},includeCache;{chmod_legend:hide},includeChmod;{expert_legend:hide},cssClass,sitemap,hide,guests;{tabnav_legend:hide},tabindex,accesskey;{publish_legend},published,start,stop',
'root' => '{title_legend},title,alias,type;{meta_legend},pageTitle;{dns_legend},dns,useSSL,language,fallback;{global_legend:hide},dateFormat,timeFormat,datimFormat,adminEmail,staticFiles,staticPlugins;{alias_legend:hide},validAliasCharacters;{sitemap_legend:hide},createSitemap;{protected_legend:hide},protected;{layout_legend},includeLayout;{cache_legend:hide},includeCache;{chmod_legend:hide},includeChmod;{twoFactor_legend:hide},enforceTwoFactor;{publish_legend},published,start,stop',
'root' => '{title_legend},title,alias,type;{meta_legend},pageTitle;{dns_legend},dns,useSSL,language,fallback;{global_legend:hide},dateFormat,timeFormat,datimFormat,adminEmail,staticFiles,staticPlugins;{alias_legend:hide},validAliasCharacters;{sitemap_legend:hide},createSitemap;{protected_legend:hide},protected;{layout_legend},includeLayout;{twoFactor_legend:hide},enforceTwoFactor;{cache_legend:hide},includeCache;{chmod_legend:hide},includeChmod;{publish_legend},published,start,stop',
'logout' => '{title_legend},title,alias,type;{forward_legend},jumpTo,redirectBack;{protected_legend:hide},protected;{chmod_legend:hide},includeChmod;{expert_legend:hide},hide;{publish_legend},published,start,stop',
'error_401' => '{title_legend},title,alias,type;{meta_legend},pageTitle,robots,description;{forward_legend},autoforward;{layout_legend:hide},includeLayout;{cache_legend:hide},includeCache;{chmod_legend:hide},includeChmod;{expert_legend:hide},cssClass;{publish_legend},published,start,stop',
'error_403' => '{title_legend},title,alias,type;{meta_legend},pageTitle,robots,description;{forward_legend},autoforward;{layout_legend:hide},includeLayout;{cache_legend:hide},includeCache;{chmod_legend:hide},includeChmod;{expert_legend:hide},cssClass;{publish_legend},published,start,stop',
@@ -18,7 +18,7 @@
</div>
<div class="widget w50">
<p><?= $this->textCode ?></p>
<code><?= $this->secret ?></code>
<code style="word-break:break-all"><?= $this->secret ?></code>
</div>
<div class="widget w50 clr">
<h3><label for="verify"<?php if ($this->error): ?> class="error"<?php endif; ?>><?= $this->verify ?></label></h3>
@@ -625,9 +625,6 @@ input[type=search]::-webkit-search-decoration {
background-color:transparent;
background-position-y:center;
}
.two-factor code {
word-wrap:break-word;
}

/* Picker search */
#search {

Large diffs are not rendered by default.

@@ -376,6 +376,26 @@ public function testRegistersTheCommandSchedulerListener(): void
$this->assertSame('onKernelTerminate', $tags['kernel.event_listener'][0]['method']);
}
public function testRegistersTheCsrfTokenCookieListener(): void
{
$this->assertTrue($this->container->has('contao.listener.csrf_token_cookie'));
$definition = $this->container->getDefinition('contao.listener.csrf_token_cookie');
$this->assertSame(CsrfTokenCookieListener::class, $definition->getClass());
$this->assertTrue($definition->isPrivate());
$this->assertSame('contao.csrf.token_storage', (string) $definition->getArgument(0));
$tags = $definition->getTags();
$this->assertArrayHasKey('kernel.event_listener', $tags);
$this->assertSame('kernel.request', $tags['kernel.event_listener'][0]['event']);
$this->assertSame('onKernelRequest', $tags['kernel.event_listener'][0]['method']);
$this->assertSame(36, $tags['kernel.event_listener'][0]['priority']);
$this->assertSame('kernel.response', $tags['kernel.event_listener'][1]['event']);
$this->assertSame('onKernelResponse', $tags['kernel.event_listener'][1]['method']);
}
public function testRegistersTheDataContainerCallbackListener(): void
{
$this->assertTrue($this->container->has('contao.listener.data_container_callback'));
@@ -632,26 +652,6 @@ public function testRegistersTheTwoFactorFrontendListener(): void
$this->assertSame('onKernelRequest', $tags['kernel.event_listener'][0]['method']);
}
public function testRegistersTheCsrfTokenCookieListener(): void
{
$this->assertTrue($this->container->has('contao.listener.csrf_token_cookie'));
$definition = $this->container->getDefinition('contao.listener.csrf_token_cookie');
$this->assertSame(CsrfTokenCookieListener::class, $definition->getClass());
$this->assertTrue($definition->isPrivate());
$this->assertSame('contao.csrf.token_storage', (string) $definition->getArgument(0));
$tags = $definition->getTags();
$this->assertArrayHasKey('kernel.event_listener', $tags);
$this->assertSame('kernel.request', $tags['kernel.event_listener'][0]['event']);
$this->assertSame('onKernelRequest', $tags['kernel.event_listener'][0]['method']);
$this->assertSame(36, $tags['kernel.event_listener'][0]['priority']);
$this->assertSame('kernel.response', $tags['kernel.event_listener'][1]['event']);
$this->assertSame('onKernelResponse', $tags['kernel.event_listener'][1]['method']);
}
public function testRegistersTheUserSessionListener(): void
{
$this->assertTrue($this->container->has('contao.listener.user_session'));

0 comments on commit 43b4a54

Please sign in to comment.
You can’t perform that action at this time.