summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2011-12-23 08:28:15 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2011-12-23 08:28:15 +0100
commit44dcf4513ab2ec3b86c5ed95b5d719f211a6fa3f (patch)
tree41802b7071bb656b90e8669d6627fc1ea38d6524 /Http
parentc65b37ce9b93a1bbfc6f33a41e834ff080d24c0f (diff)
downloadsymfony-security-44dcf4513ab2ec3b86c5ed95b5d719f211a6fa3f.zip
symfony-security-44dcf4513ab2ec3b86c5ed95b5d719f211a6fa3f.tar.gz
symfony-security-44dcf4513ab2ec3b86c5ed95b5d719f211a6fa3f.tar.bz2
[Security] made the logout path check configurable
Diffstat (limited to 'Http')
-rw-r--r--Http/Firewall/LogoutListener.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/Http/Firewall/LogoutListener.php b/Http/Firewall/LogoutListener.php
index 01ff145..bb90b6a 100644
--- a/Http/Firewall/LogoutListener.php
+++ b/Http/Firewall/LogoutListener.php
@@ -16,6 +16,7 @@ use Symfony\Component\Security\Http\Logout\LogoutSuccessHandlerInterface;
use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Http\HttpUtils;
+use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@@ -71,7 +72,7 @@ class LogoutListener implements ListenerInterface
{
$request = $event->getRequest();
- if (!$this->httpUtils->checkRequestPath($request, $this->logoutPath)) {
+ if (!$this->requiresLogout($request)) {
return;
}
@@ -96,4 +97,20 @@ class LogoutListener implements ListenerInterface
$event->setResponse($response);
}
+
+ /**
+ * Whether this request is asking for logout.
+ *
+ * The default implementation only processed requests to a specific path,
+ * but a subclass could change this to logout requests where
+ * certain parameters is present.
+ *
+ * @param Request $request
+ *
+ * @return Boolean
+ */
+ protected function requiresLogout(Request $request)
+ {
+ return $this->httpUtils->checkRequestPath($request, $this->logoutPath);
+ }
}