Commit dbd9d71d authored by Fabien Potencier's avatar Fabien Potencier

merged branch DerManoMann/form-listener-class (PR #463)

This PR was merged into the master branch.

Commits
-------

49cde048 Change 'security.authentication_listener.form._proto' definition to the same signature all other _protos have.

Discussion
----------

Change 'security.authentication_listener.form._proto' definition to the ...

...same signature all other _protos have.

This is a fix to remove the unussed (third) $class parameter from the 'security.authentication_listener.form._proto' definition and allow to customize the class via $options['listener_class'] instead.

Fixes https://github.com/fabpot/Silex/issues/459

---------------------------------------------------------------------------

by sli-systems at 2012-08-29T23:20:15Z

Any feedback on this? I'd love to get this sorted so if there are issues let me know and I'll address them.

---------------------------------------------------------------------------

by sli-systems at 2012-09-11T20:55:26Z

bump again - feedback either way would be appreciated.

---------------------------------------------------------------------------

by sli-systems at 2012-09-30T21:54:04Z

bump again (again) - it would be helpful to know if there is interest in this - it seems pointless to keep rebasing without any way of knowing if it is worthwhile...

---------------------------------------------------------------------------

by sli-systems at 2012-10-23T21:54:12Z

Just did another rebase - how long does it usually take for a one line PR to get accepted or rejected? Sorry, but I do not know what else to do other than bumping this thread every now and then...

If this PR is not good, please just reject it so I do not have to waste any more time on it.

Thanks, mano
parents 271e77a8 49cde048
......@@ -362,13 +362,11 @@ class SecurityServiceProvider implements ServiceProviderInterface
});
});
$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) {
$app['security.authentication_listener.form._proto'] = $app->protect(function ($name, $options) use ($app, $that) {
return $app->share(function () use ($app, $name, $options, $that) {
$that->addFakeRoute(array('match', $tmp = isset($options['check_path']) ? $options['check_path'] : '/login_check', str_replace('/', '_', ltrim($tmp, '/'))));
if (null === $class) {
$class = 'Symfony\\Component\\Security\\Http\\Firewall\\UsernamePasswordFormAuthenticationListener';
}
$class = isset($options['listener_class']) ? $options['listener_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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment