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
9ac0fd70
Commit
9ac0fd70
authored
Jul 25, 2015
by
Mihail Ivanov(x0r)
Committed by
Fabien Potencier
Aug 03, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowing the use of both objects and arrays for the register()
parent
19de0cd2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
doc/changelog.rst
doc/changelog.rst
+1
-1
doc/providers/security.rst
doc/providers/security.rst
+1
-1
src/Silex/Application.php
src/Silex/Application.php
+2
-2
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+6
-1
No files found.
doc/changelog.rst
View file @
9ac0fd70
...
@@ -22,7 +22,7 @@ Changelog
...
@@ -22,7 +22,7 @@ Changelog
1.3.1 (2015-XX-XX)
1.3.1 (2015-XX-XX)
------------------
------------------
*
n/a
*
fixed session logout handler when a firewall is stateless
1.3.0 (2015-06-05)
1.3.0 (2015-06-05)
------------------
------------------
...
...
doc/providers/security.rst
View file @
9ac0fd70
...
@@ -293,7 +293,7 @@ pattern::
...
@@ -293,7 +293,7 @@ pattern::
'secured' => array(
'secured' => array(
'pattern' => '^/admin/',
'pattern' => '^/admin/',
'form' => array('login_path' => '/login', 'check_path' => '/admin/login_check'),
'form' => array('login_path' => '/login', 'check_path' => '/admin/login_check'),
'logout' => array('logout_path' => '/admin/logout'),
'logout' => array('logout_path' => '/admin/logout'
, 'invalidate_session' => true
),
// ...
// ...
),
),
...
...
src/Silex/Application.php
View file @
9ac0fd70
...
@@ -121,11 +121,11 @@ class Application extends Container implements HttpKernelInterface, TerminableIn
...
@@ -121,11 +121,11 @@ class Application extends Container implements HttpKernelInterface, TerminableIn
* Registers a service provider.
* Registers a service provider.
*
*
* @param ServiceProviderInterface $provider A ServiceProviderInterface instance
* @param ServiceProviderInterface $provider A ServiceProviderInterface instance
* @param array
$values An array
of values that customizes the provider
* @param array
|Traversable $values An array or a Traversable
of values that customizes the provider
*
*
* @return Application
* @return Application
*/
*/
public
function
register
(
ServiceProviderInterface
$provider
,
array
$values
=
array
())
public
function
register
(
ServiceProviderInterface
$provider
,
$values
=
array
())
{
{
$this
->
providers
[]
=
$provider
;
$this
->
providers
[]
=
$provider
;
...
...
src/Silex/Provider/SecurityServiceProvider.php
View file @
9ac0fd70
...
@@ -233,6 +233,8 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
...
@@ -233,6 +233,8 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
throw
new
\LogicException
(
sprintf
(
'The "%s" authentication entry is not registered.'
,
$type
));
throw
new
\LogicException
(
sprintf
(
'The "%s" authentication entry is not registered.'
,
$type
));
}
}
$options
[
'stateless'
]
=
$stateless
;
list
(
$providerId
,
$listenerId
,
$entryPointId
,
$position
)
=
$app
[
'security.authentication_listener.factory.'
.
$type
](
$name
,
$options
);
list
(
$providerId
,
$listenerId
,
$entryPointId
,
$position
)
=
$app
[
'security.authentication_listener.factory.'
.
$type
](
$name
,
$options
);
if
(
null
!==
$entryPointId
)
{
if
(
null
!==
$entryPointId
)
{
...
@@ -504,7 +506,10 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
...
@@ -504,7 +506,10 @@ class SecurityServiceProvider implements ServiceProviderInterface, EventListener
isset
(
$options
[
'with_csrf'
])
&&
$options
[
'with_csrf'
]
&&
isset
(
$app
[
'form.csrf_provider'
])
?
$app
[
'form.csrf_provider'
]
:
null
isset
(
$options
[
'with_csrf'
])
&&
$options
[
'with_csrf'
]
&&
isset
(
$app
[
'form.csrf_provider'
])
?
$app
[
'form.csrf_provider'
]
:
null
);
);
$listener
->
addHandler
(
new
SessionLogoutHandler
());
$invalidateSession
=
isset
(
$options
[
'invalidate_session'
])
?
$options
[
'invalidate_session'
]
:
true
;
if
(
true
===
$invalidateSession
&&
false
===
$options
[
'stateless'
])
{
$listener
->
addHandler
(
new
SessionLogoutHandler
());
}
return
$listener
;
return
$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