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
9ab6ee63
Commit
9ab6ee63
authored
Jun 22, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed CS
parent
0221eeb4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+13
-13
No files found.
src/Silex/Provider/SecurityServiceProvider.php
View file @
9ab6ee63
...
...
@@ -117,19 +117,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
);
});
$app
[
'security.authentication.factory._proto'
]
=
$app
->
protect
(
function
(
$name
,
$options
,
$type
,
$entryPoint
=
'form'
)
use
(
$app
)
{
if
(
!
isset
(
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
]))
{
if
(
!
isset
(
$app
[
'security.entry_point.'
.
$entryPoint
.
'.'
.
$name
]))
{
$app
[
'security.entry_point.'
.
$entryPoint
.
'.'
.
$name
]
=
$app
[
'security.entry_point.'
.
$entryPoint
.
'._proto'
](
$name
);
}
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
]
=
$app
[
'security.authentication.'
.
$type
.
'._proto'
](
$name
,
$options
);
}
return
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
];
});
foreach
(
array
(
'logout'
,
'pre_auth'
,
'form'
,
'http'
,
'remember_me'
,
'anonymous'
)
as
$type
)
{
$entryPoint
=
$type
==
'http'
?
'http'
:
'form'
;
$app
[
'security.authentication.factory.'
.
$type
]
=
$app
->
protect
(
function
(
$name
,
$options
)
use
(
$type
,
$app
,
$entryPoint
)
{
...
...
@@ -166,7 +154,6 @@ class SecurityServiceProvider implements ServiceProviderInterface
$listeners
[]
=
$app
[
'security.context_listener.'
.
$name
];
foreach
(
$firewall
as
$type
=>
$options
)
{
// normalize options
if
(
!
is_array
(
$options
))
{
if
(
!
$options
)
{
...
...
@@ -178,6 +165,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
if
(
isset
(
$app
[
'security.authentication.factory.'
.
$type
]))
{
list
(
$listener
,
$entryPoint
)
=
$app
[
'security.authentication.factory.'
.
$type
](
$name
,
$options
);
$listeners
[]
=
$listener
;
}
}
...
...
@@ -395,6 +383,18 @@ class SecurityServiceProvider implements ServiceProviderInterface
$app
[
'security.authentication_provider.anonymous._proto'
]
=
$app
->
protect
(
function
(
$name
)
use
(
$app
)
{
return
new
AnonymousAuthenticationProvider
(
$name
);
});
$app
[
'security.authentication.factory._proto'
]
=
$app
->
protect
(
function
(
$name
,
$options
,
$type
,
$entryPoint
=
'form'
)
use
(
$app
)
{
if
(
!
isset
(
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
]))
{
if
(
!
isset
(
$app
[
'security.entry_point.'
.
$entryPoint
.
'.'
.
$name
]))
{
$app
[
'security.entry_point.'
.
$entryPoint
.
'.'
.
$name
]
=
$app
[
'security.entry_point.'
.
$entryPoint
.
'._proto'
](
$name
);
}
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
]
=
$app
[
'security.authentication.'
.
$type
.
'._proto'
](
$name
,
$options
);
}
return
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
];
});
}
public
function
boot
(
Application
$app
)
...
...
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