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
960ab44b
Commit
960ab44b
authored
Jun 23, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed security.authentication* services to security.authentication_listener*
parent
a9d57bfb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+12
-12
No files found.
src/Silex/Provider/SecurityServiceProvider.php
View file @
960ab44b
...
...
@@ -121,13 +121,13 @@ class SecurityServiceProvider implements ServiceProviderInterface
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
)
{
$app
[
'security.authentication
_listener
.factory.'
.
$type
]
=
$app
->
protect
(
function
(
$name
,
$options
)
use
(
$type
,
$app
,
$entryPoint
)
{
if
(
!
isset
(
$app
[
'security.entry_point.'
.
$name
.
'.'
.
$entryPoint
]))
{
$app
[
'security.entry_point.'
.
$name
.
'.'
.
$entryPoint
]
=
$app
[
'security.entry_point.'
.
$entryPoint
.
'._proto'
](
$name
);
}
if
(
!
isset
(
$app
[
'security.authentication.'
.
$name
.
'.'
.
$type
]))
{
$app
[
'security.authentication
.'
.
$name
.
'.'
.
$type
]
=
$app
[
'security.authentication
.'
.
$type
.
'._proto'
](
$name
,
$options
);
if
(
!
isset
(
$app
[
'security.authentication
_listener
.'
.
$name
.
'.'
.
$type
]))
{
$app
[
'security.authentication
_listener.'
.
$name
.
'.'
.
$type
]
=
$app
[
'security.authentication_listener
.'
.
$type
.
'._proto'
](
$name
,
$options
);
}
if
(
!
isset
(
$app
[
'security.authentication_provider.'
.
$name
]))
{
...
...
@@ -136,7 +136,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
return
array
(
'security.authentication_provider.'
.
$name
,
'security.authentication.'
.
$name
.
'.'
.
$type
,
'security.authentication
_listener
.'
.
$name
.
'.'
.
$type
,
'security.entry_point.'
.
$name
.
'.'
.
$entryPoint
,
$type
);
...
...
@@ -183,11 +183,11 @@ class SecurityServiceProvider implements ServiceProviderInterface
$options
=
array
();
}
if
(
!
isset
(
$app
[
'security.authentication.factory.'
.
$type
]))
{
if
(
!
isset
(
$app
[
'security.authentication
_listener
.factory.'
.
$type
]))
{
throw
new
\LogicException
(
sprintf
(
'The "%s" authentication entry is not registered.'
,
$type
));
}
list
(
$providerId
,
$listenerId
,
$entryPointId
,
$position
)
=
$app
[
'security.authentication.factory.'
.
$type
](
$name
,
$options
);
list
(
$providerId
,
$listenerId
,
$entryPointId
,
$position
)
=
$app
[
'security.authentication
_listener
.factory.'
.
$type
](
$name
,
$options
);
if
(
null
!==
$entryPointId
)
{
$entryPoint
=
$entryPointId
;
...
...
@@ -206,7 +206,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
$listeners
[]
=
'security.access_listener'
;
if
(
isset
(
$firewall
[
'switch_user'
]))
{
$app
[
'security.switch_user.'
.
$name
]
=
$app
[
'security.authentication.switch_user._proto'
](
$name
,
$firewall
[
'switch_user'
]);
$app
[
'security.switch_user.'
.
$name
]
=
$app
[
'security.authentication
_listener
.switch_user._proto'
](
$name
,
$firewall
[
'switch_user'
]);
$listeners
[]
=
'security.switch_user.'
.
$name
;
}
...
...
@@ -327,7 +327,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
});
});
$app
[
'security.authentication.form._proto'
]
=
$app
->
protect
(
function
(
$providerKey
,
$options
)
use
(
$app
,
$that
)
{
$app
[
'security.authentication
_listener
.form._proto'
]
=
$app
->
protect
(
function
(
$providerKey
,
$options
)
use
(
$app
,
$that
)
{
return
$app
->
share
(
function
()
use
(
$app
,
$providerKey
,
$options
,
$that
)
{
$that
->
addFakeRoute
(
array
(
'post'
,
$tmp
=
isset
(
$options
[
'check_path'
])
?
$options
[
'check_path'
]
:
'/login_check'
,
str_replace
(
'/'
,
'_'
,
ltrim
(
$tmp
,
'/'
))));
...
...
@@ -347,7 +347,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
});
});
$app
[
'security.authentication.http._proto'
]
=
$app
->
protect
(
function
(
$providerKey
,
$options
)
use
(
$app
)
{
$app
[
'security.authentication
_listener
.http._proto'
]
=
$app
->
protect
(
function
(
$providerKey
,
$options
)
use
(
$app
)
{
return
$app
->
share
(
function
()
use
(
$app
,
$providerKey
,
$options
)
{
return
new
BasicAuthenticationListener
(
$app
[
'security'
],
...
...
@@ -359,7 +359,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
});
});
$app
[
'security.authentication.anonymous._proto'
]
=
$app
->
protect
(
function
(
$providerKey
,
$options
)
use
(
$app
)
{
$app
[
'security.authentication
_listener
.anonymous._proto'
]
=
$app
->
protect
(
function
(
$providerKey
,
$options
)
use
(
$app
)
{
return
$app
->
share
(
function
()
use
(
$app
,
$providerKey
,
$options
)
{
return
new
AnonymousAuthenticationListener
(
$app
[
'security'
],
...
...
@@ -369,7 +369,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
});
});
$app
[
'security.authentication.logout._proto'
]
=
$app
->
protect
(
function
(
$providerKey
,
$options
)
use
(
$app
,
$that
)
{
$app
[
'security.authentication
_listener
.logout._proto'
]
=
$app
->
protect
(
function
(
$providerKey
,
$options
)
use
(
$app
,
$that
)
{
return
$app
->
share
(
function
()
use
(
$app
,
$providerKey
,
$options
,
$that
)
{
$that
->
addFakeRoute
(
array
(
'get'
,
$tmp
=
isset
(
$options
[
'logout_path'
])
?
$options
[
'logout_path'
]
:
'/logout'
,
str_replace
(
'/'
,
'_'
,
ltrim
(
$tmp
,
'/'
))));
...
...
@@ -387,7 +387,7 @@ class SecurityServiceProvider implements ServiceProviderInterface
});
});
$app
[
'security.authentication.switch_user._proto'
]
=
$app
->
protect
(
function
(
$name
,
$options
)
use
(
$app
,
$that
)
{
$app
[
'security.authentication
_listener
.switch_user._proto'
]
=
$app
->
protect
(
function
(
$name
,
$options
)
use
(
$app
,
$that
)
{
return
$app
->
share
(
function
()
use
(
$app
,
$name
,
$options
,
$that
)
{
return
new
SwitchUserListener
(
$app
[
'security'
],
...
...
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