Commit 215251cf authored by Fabien Potencier's avatar Fabien Potencier

feature #964 Allowed shared ContextListener for firewalls (ibrasho)

This PR was squashed before being merged into the 2.0.x-dev branch (closes #964).

Discussion
----------

Allowed shared ContextListener for firewalls

In response to #963.

Checks for a `context` key in the firewall configuration, if it's not there use `name`.

Commits
-------

a56d0fa4 Allowed shared ContextListener for firewalls
parents 9834f3c1 a56d0fa4
......@@ -171,7 +171,8 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
$users = isset($firewall['users']) ? $firewall['users'] : array();
$security = isset($firewall['security']) ? (bool) $firewall['security'] : true;
$stateless = isset($firewall['stateless']) ? (bool) $firewall['stateless'] : false;
unset($firewall['pattern'], $firewall['users'], $firewall['security'], $firewall['stateless']);
$context = isset($firewall['context']) ? $firewall['context'] : $name;
unset($firewall['pattern'], $firewall['users'], $firewall['security'], $firewall['stateless'], $firewall['context']);
$protected = false === $security ? false : count($firewall);
......@@ -187,7 +188,7 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
}
if (false === $stateless) {
$listeners[] = 'security.context_listener.'.$name;
$listeners[] = 'security.context_listener.'.$context;
}
$factories = array();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment