Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
Allowed shared ContextListener for firewalls
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrasho authored and fabpot committed Jul 23, 2015
1 parent aed232e commit fcefc53
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Silex/Provider/SecurityServiceProvider.php
Expand Up @@ -200,7 +200,8 @@ public function register(Application $app)
$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);

Expand All @@ -216,7 +217,7 @@ public function register(Application $app)
}

if (false === $stateless) {
$listeners[] = 'security.context_listener.'.$name;
$listeners[] = 'security.context_listener.'.$context;
}

$factories = array();
Expand Down

0 comments on commit fcefc53

Please sign in to comment.