FriendsOfSymfony/FOSUserBundle — pull request #1226 by lemoinem (2013-08-01 19:21:11+00:00)
Title: Allow the listeners for REGISTRATION_INITIALIZE to provide an alternate user at registration time

Hello,

I am creating an application in which users can invite and interact with people outside of the platform.

This requires me to create "hollow" users who exist in the system without being able to login until they registered.

However, I cannot use a listener to retrieve, populate and enable this hollow user upon registration because the user is not taken back from the UserEvent in the controller.

Sure I could override the entire controller, but it looks like an awful amount of code to duplicate for almost nothing.

Furthermore, the intended usage of listeners (as mentioned in the doc) is to provide hooks for additional logic, which fits exactly my use case.

If you could tell me what you think of this suggestion and how it could be improved if interesting at all?

Regards.