Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
9022e420
Commit
9022e420
authored
Jun 22, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed the order of registration for authentication listeners
parent
1a194364
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+15
-3
No files found.
src/Silex/Provider/SecurityServiceProvider.php
View file @
9022e420
...
...
@@ -129,12 +129,13 @@ class SecurityServiceProvider implements ServiceProviderInterface
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
]
=
$app
[
'security.authentication.'
.
$type
.
'._proto'
](
$name
,
$options
);
}
return
array
(
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
],
$app
[
'security.entry_point.'
.
$name
.
'.'
.
$entryPoint
]);
return
array
(
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
],
$app
[
'security.entry_point.'
.
$name
.
'.'
.
$entryPoint
]
,
$type
);
});
}
$app
[
'security.firewall_map'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
$map
=
new
FirewallMap
();
$positions
=
array
(
'logout'
,
'pre_auth'
,
'form'
,
'http'
,
'remember_me'
,
'anonymous'
);
foreach
(
$app
[
'security.firewalls'
]
as
$name
=>
$firewall
)
{
$entryPoint
=
'form'
;
$pattern
=
isset
(
$firewall
[
'pattern'
])
?
$firewall
[
'pattern'
]
:
null
;
...
...
@@ -159,6 +160,11 @@ class SecurityServiceProvider implements ServiceProviderInterface
$listeners
[]
=
$app
[
'security.context_listener.'
.
$name
];
$factories
=
array
();
foreach
(
$positions
as
$position
)
{
$factories
[
$position
]
=
array
();
}
foreach
(
$firewall
as
$type
=>
$options
)
{
// normalize options
if
(
!
is_array
(
$options
))
{
...
...
@@ -173,9 +179,15 @@ class SecurityServiceProvider implements ServiceProviderInterface
throw
new
\LogicException
(
sprintf
(
'The "%s" authentication entry is not registered.'
,
$type
));
}
list
(
$listener
,
$entryPoint
)
=
$app
[
'security.authentication.factory.'
.
$type
](
$name
,
$options
);
list
(
$listener
,
$entryPoint
,
$position
)
=
$app
[
'security.authentication.factory.'
.
$type
](
$name
,
$options
);
$listeners
[]
=
$listener
;
$factories
[
$position
][]
=
$listener
;
}
foreach
(
$positions
as
$position
)
{
foreach
(
$factories
[
$position
]
as
$listener
)
{
$listeners
[]
=
$listener
;
}
}
$listeners
[]
=
$app
[
'security.access_listener'
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment