You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug symfony#25272 [SecurityBundle] fix setLogoutOnUserChange calls for context listeners (dmaicher)
This PR was squashed before being merged into the 3.4 branch (closessymfony#25272).
Discussion
----------
[SecurityBundle] fix setLogoutOnUserChange calls for context listeners
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | symfony#25267
| License | MIT
| Doc PR | -
As pointed out in symfony#25267 the `setLogoutOnUserChange` method calls were added to the parent definition `security.context_listener` instead of the concrete child definitions `security.context_listener.*`.
ping @iltar@chalasr
Commits
-------
4eff146 [SecurityBundle] fix setLogoutOnUserChange calls for context listeners
Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,7 @@ class SecurityExtension extends Extension
43
43
private$factories = array();
44
44
private$userProviderFactories = array();
45
45
private$expressionLanguage;
46
+
private$logoutOnUserChangeByContextKey = array();
46
47
47
48
publicfunction__construct()
48
49
{
@@ -276,12 +277,6 @@ private function createFirewalls($config, ContainerBuilder $container)
276
277
$customUserChecker = true;
277
278
}
278
279
279
-
if (!isset($firewall['logout_on_user_change']) || !$firewall['logout_on_user_change']) {
280
-
@trigger_error(sprintf('Not setting "logout_on_user_change" to true on firewall "%s" is deprecated as of 3.4, it will always be true in 4.0.', $name), E_USER_DEPRECATED);
if (!$logoutOnUserChange = $firewall['logout_on_user_change']) {
369
+
@trigger_error(sprintf('Not setting "logout_on_user_change" to true on firewall "%s" is deprecated as of 3.4, it will always be true in 4.0.', $id), E_USER_DEPRECATED);
370
+
}
371
+
372
+
if (isset($this->logoutOnUserChangeByContextKey[$contextKey]) && $this->logoutOnUserChangeByContextKey[$contextKey][1] !== $logoutOnUserChange) {
373
+
thrownewInvalidConfigurationException(sprintf('Firewalls "%s" and "%s" need to have the same value for option "logout_on_user_change" as they are sharing the context "%s"', $this->logoutOnUserChangeByContextKey[$contextKey][0], $id, $contextKey));
* @expectedExceptionMessage Firewalls "some_firewall" and "some_other_firewall" need to have the same value for option "logout_on_user_change" as they are sharing the context "my_context"
0 commit comments