|
@@ -131,7 +131,7 @@ class SecurityExtension extends Extension
|
|
|
if (isset($access['host'])) {
|
|
|
$host = $access['host'];
|
|
|
}
|
|
|
- if (count($tMethods = $this->fixConfig($access, 'method')) > 0) {
|
|
|
+ if (count($tMethods = $this->normalizeConfig($access, 'method')) > 0) {
|
|
|
$methods = $tMethods;
|
|
|
}
|
|
|
if (isset($access['ip'])) {
|
|
@@ -139,7 +139,7 @@ class SecurityExtension extends Extension
|
|
|
}
|
|
|
|
|
|
$matchAttributes = array();
|
|
|
- $attributes = $this->fixConfig($access, 'attribute');
|
|
|
+ $attributes = $this->normalizeConfig($access, 'attribute');
|
|
|
foreach ($attributes as $key => $attribute) {
|
|
|
if (isset($attribute['key'])) {
|
|
|
$key = $attribute['key'];
|
|
@@ -158,7 +158,7 @@ class SecurityExtension extends Extension
|
|
|
|
|
|
$this->createEncoders($config, $container);
|
|
|
|
|
|
- if (!$firewalls = $this->fixConfig($config, 'firewall')) {
|
|
|
+ if (!$firewalls = $this->normalizeConfig($config, 'firewall')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -177,7 +177,7 @@ class SecurityExtension extends Extension
|
|
|
$loader = new XmlFileLoader($c, array(__DIR__.'/../Resources/config', __DIR__.'/Resources/config'));
|
|
|
$loader->load('security_templates.xml');
|
|
|
|
|
|
- foreach ($this->fixConfig($config, 'template') as $template) {
|
|
|
+ foreach ($this->normalizeConfig($config, 'template') as $template) {
|
|
|
$loader->load($c->getParameterBag()->resolveValue($template));
|
|
|
}
|
|
|
$container->merge($c);
|
|
@@ -260,7 +260,7 @@ class SecurityExtension extends Extension
|
|
|
$listener->addMethodCall('addHandler', array(new Reference('security.logout.handler.session')));
|
|
|
}
|
|
|
|
|
|
- if (count($cookies = $this->fixConfig($firewall['logout'], 'cookie')) > 0) {
|
|
|
+ if (count($cookies = $this->normalizeConfig($firewall['logout'], 'cookie')) > 0) {
|
|
|
$cookieHandlerId = 'security.logout.handler.cookie_clearing.'.$id;
|
|
|
$cookieHandler = $container->setDefinition($cookieHandlerId, clone $container->getDefinition('security.logout.handler.cookie_clearing'));
|
|
|
$cookieHandler->setArguments(array($cookies));
|
|
@@ -348,7 +348,7 @@ class SecurityExtension extends Extension
|
|
|
// Parses user providers and returns an array of their ids
|
|
|
protected function createUserProviders($config, ContainerBuilder $container)
|
|
|
{
|
|
|
- $providers = $this->fixConfig($config, 'provider');
|
|
|
+ $providers = $this->normalizeConfig($config, 'provider');
|
|
|
if (!$providers) {
|
|
|
return array();
|
|
|
}
|
|
@@ -369,7 +369,7 @@ class SecurityExtension extends Extension
|
|
|
|
|
|
protected function createEncoders($config, ContainerBuilder $container)
|
|
|
{
|
|
|
- $encoders = $this->fixConfig($config, 'encoder');
|
|
|
+ $encoders = $this->normalizeConfig($config, 'encoder');
|
|
|
if (!$encoders) {
|
|
|
return array();
|
|
|
}
|
|
@@ -514,7 +514,7 @@ class SecurityExtension extends Extension
|
|
|
// In-memory DAO provider
|
|
|
$definition = $container->register($name, '%security.user.provider.in_memory.class%');
|
|
|
$definition->setPublic(false);
|
|
|
- foreach ($this->fixConfig($provider, 'user') as $username => $user) {
|
|
|
+ foreach ($this->normalizeConfig($provider, 'user') as $username => $user) {
|
|
|
if (isset($user['name'])) {
|
|
|
$username = $user['name'];
|
|
|
}
|
|
@@ -667,21 +667,4 @@ class SecurityExtension extends Extension
|
|
|
{
|
|
|
return 'security';
|
|
|
}
|
|
|
-
|
|
|
- protected function fixConfig($config, $key)
|
|
|
- {
|
|
|
- $values = array();
|
|
|
- if (isset($config[$key.'s'])) {
|
|
|
- $values = $config[$key.'s'];
|
|
|
- } elseif (isset($config[$key])) {
|
|
|
- if (is_string($config[$key]) || !is_int(key($config[$key]))) {
|
|
|
- // only one
|
|
|
- $values = array($config[$key]);
|
|
|
- } else {
|
|
|
- $values = $config[$key];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return $values;
|
|
|
- }
|
|
|
}
|