This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Fabien Potencier 1bb53b8b7f merged branch Abhoryo/patch-1 (PR #1956)
Commits
-------

e9d2a67 CS
3a64b08 Search in others user providers when a user is not found in the first user provider and throws the right exception.

Discussion
----------

Chain user provider doesn't search in all user providers

I commit these changes because Chain user provider doesn't search in all user providers.

Example with the Acme/DemoBundle:

    // security.yml
    ...
        providers:
            chain_provider:
                providers: [in_memory, in_memory_extend]
            in_memory_extend:
                users:
                    admin2: { password: adminpass2, roles: [ 'ROLE_ADMIN' ] }
            in_memory:
                users:
                    user:  { password: userpass, roles: [ 'ROLE_USER' ] }
    ...
        firewalls:
    ...
            secured_area:
                pattern:    ^/demo/secured/
                provider: chain_provider OR in_memory_extend
    ...

We can see these logs :

    security.INFO: User "admin2" has been authenticated successfully [] []
    security.DEBUG: Write SecurityContext in the session [] []
    security.DEBUG: Read SecurityContext from the session [] []
    security.DEBUG: Reloading user from user provider. [] []
    security.WARNING: Username "admin2" could not be found. [] []

The new code search in others user providers when a user is not found in the first user provider and throws the right exception.

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

by lsmith77 at 2011/08/14 12:20:04 -0700

I wonder if it should be a provider option to continue on a failed user lookup. I can see cases where you really dont want to iterate over all providers and others where you do.

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

by Abhoryo at 2011/08/14 17:27:16 -0700

If someone need a provider like you describe, he can create one.
Here we talk about a chain user provider.

Doc : [using-multiple-user-providers](http://symfony.com/doc/current/book/security.html#using-multiple-user-providers)

We can read in the doc: "The chain_provider will, in turn, try to load the user from both the in_memory and user_db providers."
But its not the case right now.
2011-08-23 08:52:35 +02:00
src/Symfony merged branch Abhoryo/patch-1 (PR #1956) 2011-08-23 08:52:35 +02:00
tests merged branch stloyd/issue_1986 (PR #2000) 2011-08-23 08:44:09 +02:00
.gitignore Added vendor directory to .gitignore 2010-06-24 10:44:28 +02:00
autoload.php.dist fixed autoloader when tests are run on a machine without intl installed 2011-07-20 14:27:10 +02:00
check_cs fixed root search path to include only './src' and './tests' 2011-06-08 18:11:05 +02:00
CONTRIBUTORS.md fixed name 2011-07-27 23:12:39 +02:00
LICENSE added the LICENSE file for the YAML component 2011-02-18 11:52:11 +01:00
phpunit.xml.dist [Security] cleaned up opt-in to benchmark test 2011-03-06 20:06:13 +01:00
README.md updated the README file 2011-05-24 17:27:37 +02:00
UPDATE.ja.md updated translation of UPDATE file (Japanese RC5 added) 2011-07-30 02:08:25 +09:00
UPDATE.md updated UPDATE file 2011-07-22 17:45:02 +02:00
vendors.php updated Twig dep 2011-07-17 16:00:18 +02:00

README

What is Symfony2?

Symfony2 is a PHP 5.3 full-stack web framework. It is written with speed and flexibility in mind. It allows developers to build better and easy to maintain websites with PHP.

Symfony can be used to develop all kind of websites, from your personal blog to high traffic ones like Dailymotion or Yahoo! Answers.

Requirements

Symfony2 is only supported on PHP 5.3.2 and up.

Installation

The best way to install Symfony2 is to download the Symfony Standard Edition available at http://symfony.com/download.

Documentation

The "Quick Tour" tutorial gives you a first feeling of the framework. If, like us, you think that Symfony2 can help speed up your development and take the quality of your work to the next level, read the official Symfony2 documentation.