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
11c3943d
Commit
11c3943d
authored
Jul 09, 2012
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the Security provider for the latest Symfony code
parent
5ee635b3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
41 deletions
+72
-41
composer.lock
composer.lock
+39
-39
src/Silex/Provider/SecurityServiceProvider.php
src/Silex/Provider/SecurityServiceProvider.php
+33
-2
No files found.
composer.lock
View file @
11c3943d
...
@@ -22,8 +22,8 @@
...
@@ -22,8 +22,8 @@
{
{
"package": "symfony/event-dispatcher",
"package": "symfony/event-dispatcher",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
v2.1.0-BETA1
",
"source-reference": "
0dc437f2eca7dea19facfde6db7f7f5e8e71d0bc
",
"commit-date": "13
38018513
"
"commit-date": "13
41838460
"
},
},
{
{
"package": "symfony/http-foundation",
"package": "symfony/http-foundation",
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
{
{
"package": "symfony/http-foundation",
"package": "symfony/http-foundation",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
3e53f0a9f802dc1f34a722109df0b0d2679671a8
",
"source-reference": "
985f3aa6c9f8074b2d1a12345e0768f8c24aa72d
",
"commit-date": "1341
379664
"
"commit-date": "1341
838460
"
},
},
{
{
"package": "symfony/http-kernel",
"package": "symfony/http-kernel",
...
@@ -46,8 +46,8 @@
...
@@ -46,8 +46,8 @@
{
{
"package": "symfony/http-kernel",
"package": "symfony/http-kernel",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
6d6f55f6b07b8bfed741a192def8d1bfbf6c590f
",
"source-reference": "
3ed400b75c0c2eae3e8f6f991210a8930bdd7467
",
"commit-date": "1341
33212
0"
"commit-date": "1341
83846
0"
},
},
{
{
"package": "symfony/routing",
"package": "symfony/routing",
...
@@ -58,8 +58,8 @@
...
@@ -58,8 +58,8 @@
{
{
"package": "symfony/routing",
"package": "symfony/routing",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
622a168a3be54a87e34ad65e9d50a738fb89ff7e
",
"source-reference": "
48c201da53b7c3b787609b0f6702456b86939577
",
"commit-date": "1341
312726
"
"commit-date": "1341
838460
"
}
}
],
],
"packages-dev": [
"packages-dev": [
...
@@ -72,8 +72,8 @@
...
@@ -72,8 +72,8 @@
{
{
"package": "doctrine/common",
"package": "doctrine/common",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
d2f8a36b8696b446bf25cfe2b0b3aaf03e0835e6
",
"source-reference": "
b3afbb80506d909743475c5b0904285ab0c07941
",
"commit-date": "1341
088911
"
"commit-date": "1341
670930
"
},
},
{
{
"package": "doctrine/dbal",
"package": "doctrine/dbal",
...
@@ -94,8 +94,8 @@
...
@@ -94,8 +94,8 @@
{
{
"package": "swiftmailer/swiftmailer",
"package": "swiftmailer/swiftmailer",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
1829c40b70f3fc45a3696349bfcb99fb755aa926
",
"source-reference": "
f51b5f33c83b48faea75f1285f99a2e8f1c66f75
",
"commit-date": "1341
418063
"
"commit-date": "1341
746460
"
},
},
{
{
"package": "symfony/browser-kit",
"package": "symfony/browser-kit",
...
@@ -106,8 +106,8 @@
...
@@ -106,8 +106,8 @@
{
{
"package": "symfony/browser-kit",
"package": "symfony/browser-kit",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
v2.1.0-BETA1
",
"source-reference": "
8ea03fae14e2938b0d177a8812c5201d5510f9b7
",
"commit-date": "13
37339299
"
"commit-date": "13
41838460
"
},
},
{
{
"package": "symfony/config",
"package": "symfony/config",
...
@@ -118,8 +118,8 @@
...
@@ -118,8 +118,8 @@
{
{
"package": "symfony/config",
"package": "symfony/config",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
a261cb1571e1f3921a632541299a9f39753a62a7
",
"source-reference": "
bb18f5131f785483d3750a771df594eed1e5f863
",
"commit-date": "1341
329671
"
"commit-date": "1341
838460
"
},
},
{
{
"package": "symfony/css-selector",
"package": "symfony/css-selector",
...
@@ -130,8 +130,8 @@
...
@@ -130,8 +130,8 @@
{
{
"package": "symfony/css-selector",
"package": "symfony/css-selector",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
v2.1.0-BETA1
",
"source-reference": "
389349c90d9ac4f967ed74634186ce922d68cf93
",
"commit-date": "13
37530597
"
"commit-date": "13
41838460
"
},
},
{
{
"package": "symfony/dom-crawler",
"package": "symfony/dom-crawler",
...
@@ -142,8 +142,8 @@
...
@@ -142,8 +142,8 @@
{
{
"package": "symfony/dom-crawler",
"package": "symfony/dom-crawler",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
v2.1.0-BETA1
",
"source-reference": "
f0f531c1808745a85ada3cc5519d54bd5f9b25c2
",
"commit-date": "13
37632035
"
"commit-date": "13
41838460
"
},
},
{
{
"package": "symfony/finder",
"package": "symfony/finder",
...
@@ -154,8 +154,8 @@
...
@@ -154,8 +154,8 @@
{
{
"package": "symfony/finder",
"package": "symfony/finder",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
4d6a965beae234bd0fa7f61681bd8a54df60f042
",
"source-reference": "
fccf904140dd00656a7cea17ff6f54d78b095649
",
"commit-date": "1341
212719
"
"commit-date": "1341
838460
"
},
},
{
{
"package": "symfony/form",
"package": "symfony/form",
...
@@ -166,8 +166,8 @@
...
@@ -166,8 +166,8 @@
{
{
"package": "symfony/form",
"package": "symfony/form",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
213a6ae38699e90ce48520b670e60c56529a3b56
",
"source-reference": "
57d3b508c1522a1343f7b505b573c307e7ad0023
",
"commit-date": "1341
564098
"
"commit-date": "1341
838460
"
},
},
{
{
"package": "symfony/locale",
"package": "symfony/locale",
...
@@ -178,8 +178,8 @@
...
@@ -178,8 +178,8 @@
{
{
"package": "symfony/locale",
"package": "symfony/locale",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
34c160e7ca53800a8497fdc54f8792118e4aa57e
",
"source-reference": "
f804763887593f362156ec62c53efbee8ff04557
",
"commit-date": "1341
379868
"
"commit-date": "1341
838460
"
},
},
{
{
"package": "symfony/monolog-bridge",
"package": "symfony/monolog-bridge",
...
@@ -190,7 +190,7 @@
...
@@ -190,7 +190,7 @@
{
{
"package": "symfony/monolog-bridge",
"package": "symfony/monolog-bridge",
"version": "dev-master",
"version": "dev-master",
"source-reference": "v2.1.0-BETA
1
",
"source-reference": "v2.1.0-BETA
2
",
"commit-date": "1337360698"
"commit-date": "1337360698"
},
},
{
{
...
@@ -202,8 +202,8 @@
...
@@ -202,8 +202,8 @@
{
{
"package": "symfony/options-resolver",
"package": "symfony/options-resolver",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
30a23259bb9c82b09c7ad271e5d47027cd01466c
",
"source-reference": "
0ad85af9ec3e1696056901fcf38bffedc683d0c4
",
"commit-date": "1341
534395
"
"commit-date": "1341
838460
"
},
},
{
{
"package": "symfony/process",
"package": "symfony/process",
...
@@ -214,8 +214,8 @@
...
@@ -214,8 +214,8 @@
{
{
"package": "symfony/process",
"package": "symfony/process",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
abbb6c9a4fcbd070af4e6296753d449dcd4723aa
",
"source-reference": "
2cd16e5708670cc53ed0ae1fae20ad6759ffe3ab
",
"commit-date": "1341
334717
"
"commit-date": "1341
838460
"
},
},
{
{
"package": "symfony/security",
"package": "symfony/security",
...
@@ -226,8 +226,8 @@
...
@@ -226,8 +226,8 @@
{
{
"package": "symfony/security",
"package": "symfony/security",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
b0257cd46a78251a25c17b91acb4dbbf6890590a
",
"source-reference": "
47fcb4bfc03c74ae5b7ba6c6f2c32169e455be02
",
"commit-date": "1341
583159
"
"commit-date": "1341
840540
"
},
},
{
{
"package": "symfony/translation",
"package": "symfony/translation",
...
@@ -238,8 +238,8 @@
...
@@ -238,8 +238,8 @@
{
{
"package": "symfony/translation",
"package": "symfony/translation",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
v2.1.0-BETA1
",
"source-reference": "
1b50bdbbd88e091a9fdd362b3a0c5e1fb93cf53f
",
"commit-date": "13
37632035
"
"commit-date": "13
41838460
"
},
},
{
{
"package": "symfony/twig-bridge",
"package": "symfony/twig-bridge",
...
@@ -250,8 +250,8 @@
...
@@ -250,8 +250,8 @@
{
{
"package": "symfony/twig-bridge",
"package": "symfony/twig-bridge",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
2a577b6cf0fe32f383acf4a972c1d5d8f48ae1e
2",
"source-reference": "
33295b10cad60026f074d0ee614e9a0cbe04e23
2",
"commit-date": "134
0549862
"
"commit-date": "134
1838460
"
},
},
{
{
"package": "symfony/validator",
"package": "symfony/validator",
...
@@ -262,8 +262,8 @@
...
@@ -262,8 +262,8 @@
{
{
"package": "symfony/validator",
"package": "symfony/validator",
"version": "dev-master",
"version": "dev-master",
"source-reference": "
8e54bffa0853fe66e92bb67c96c80e3a9e1b3cf2
",
"source-reference": "
2d02293c193be5e93019fe7961922a7ce05cddb0
",
"commit-date": "1341
422834
"
"commit-date": "1341
838460
"
},
},
{
{
"package": "twig/twig",
"package": "twig/twig",
...
...
src/Silex/Provider/SecurityServiceProvider.php
View file @
11c3943d
...
@@ -26,6 +26,8 @@ use Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationPro
...
@@ -26,6 +26,8 @@ use Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationPro
use
Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider
;
use
Symfony\Component\Security\Core\Authentication\Provider\AnonymousAuthenticationProvider
;
use
Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager
;
use
Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager
;
use
Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver
;
use
Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver
;
use
Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler
;
use
Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler
;
use
Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter
;
use
Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter
;
use
Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter
;
use
Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter
;
use
Symfony\Component\Security\Core\Authorization\AccessDecisionManager
;
use
Symfony\Component\Security\Core\Authorization\AccessDecisionManager
;
...
@@ -336,6 +338,27 @@ class SecurityServiceProvider implements ServiceProviderInterface
...
@@ -336,6 +338,27 @@ class SecurityServiceProvider implements ServiceProviderInterface
});
});
});
});
$app
[
'security.authentication.success_handler._proto'
]
=
$app
->
protect
(
function
(
$name
,
$options
)
use
(
$app
)
{
return
$app
->
share
(
function
()
use
(
$name
,
$options
,
$app
)
{
return
new
DefaultAuthenticationSuccessHandler
(
$app
[
'security.http_utils'
],
$name
,
$options
);
});
});
$app
[
'security.authentication.failure_handler._proto'
]
=
$app
->
protect
(
function
(
$name
,
$options
)
use
(
$app
)
{
return
$app
->
share
(
function
()
use
(
$name
,
$options
,
$app
)
{
return
new
DefaultAuthenticationFailureHandler
(
$app
,
$app
[
'security.http_utils'
],
$options
,
$app
[
'logger'
]
);
});
});
$app
[
'security.authentication_listener.form._proto'
]
=
$app
->
protect
(
function
(
$name
,
$options
,
$class
=
null
)
use
(
$app
,
$that
)
{
$app
[
'security.authentication_listener.form._proto'
]
=
$app
->
protect
(
function
(
$name
,
$options
,
$class
=
null
)
use
(
$app
,
$that
)
{
return
$app
->
share
(
function
()
use
(
$app
,
$name
,
$options
,
$that
,
$class
)
{
return
$app
->
share
(
function
()
use
(
$app
,
$name
,
$options
,
$that
,
$class
)
{
$that
->
addFakeRoute
(
array
(
'match'
,
$tmp
=
isset
(
$options
[
'check_path'
])
?
$options
[
'check_path'
]
:
'/login_check'
,
str_replace
(
'/'
,
'_'
,
ltrim
(
$tmp
,
'/'
))));
$that
->
addFakeRoute
(
array
(
'match'
,
$tmp
=
isset
(
$options
[
'check_path'
])
?
$options
[
'check_path'
]
:
'/login_check'
,
str_replace
(
'/'
,
'_'
,
ltrim
(
$tmp
,
'/'
))));
...
@@ -344,15 +367,23 @@ class SecurityServiceProvider implements ServiceProviderInterface
...
@@ -344,15 +367,23 @@ class SecurityServiceProvider implements ServiceProviderInterface
$class
=
'Symfony\\Component\\Security\\Http\\Firewall\\UsernamePasswordFormAuthenticationListener'
;
$class
=
'Symfony\\Component\\Security\\Http\\Firewall\\UsernamePasswordFormAuthenticationListener'
;
}
}
if
(
!
isset
(
$app
[
'security.authentication.success_handler.'
.
$name
]))
{
$app
[
'security.authentication.success_handler.'
.
$name
]
=
$app
[
'security.authentication.success_handler._proto'
](
$name
,
$options
);
}
if
(
!
isset
(
$app
[
'security.authentication.failure_handler.'
.
$name
]))
{
$app
[
'security.authentication.failure_handler.'
.
$name
]
=
$app
[
'security.authentication.failure_handler._proto'
](
$name
,
$options
);
}
return
new
$class
(
return
new
$class
(
$app
[
'security'
],
$app
[
'security'
],
$app
[
'security.authentication_manager'
],
$app
[
'security.authentication_manager'
],
isset
(
$app
[
'security.session_strategy.'
.
$name
])
?
$app
[
'security.session_strategy.'
.
$name
]
:
$app
[
'security.session_strategy'
],
isset
(
$app
[
'security.session_strategy.'
.
$name
])
?
$app
[
'security.session_strategy.'
.
$name
]
:
$app
[
'security.session_strategy'
],
$app
[
'security.http_utils'
],
$app
[
'security.http_utils'
],
$name
,
$name
,
$app
[
'security.authentication.success_handler.'
.
$name
],
$app
[
'security.authentication.failure_handler.'
.
$name
],
$options
,
$options
,
isset
(
$app
[
'security.authentication.success_handler.'
.
$name
])
?
$app
[
'security.authentication.success_handler.'
.
$name
]
:
null
,
isset
(
$app
[
'security.authentication.failure_handler.'
.
$name
])
?
$app
[
'security.authentication.failure_handler.'
.
$name
]
:
null
,
$app
[
'logger'
],
$app
[
'logger'
],
$app
[
'dispatcher'
],
$app
[
'dispatcher'
],
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
...
...
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