Re: [symfony-users] Re: [sf2] [FOSUserBundle] How to override the user_provider

2011-06-16 Thread Christophe COEVOET

Le 16/06/2011 10:10, winzou a écrit :
Ok I've define my own service. It works well, as expected. But can you 
have a look: 
https://github.com/winzou/AssoManager/commit/b45729baaa7873cb740ab07a8813483b257cac92 



It's a lot of code just to override my findUserByUsername($username) 
method. It must be a easier way but I can't find out.


Any idea?

I don't understand why you are extending the FOSUB UserManager for your 
class. Just define your own class implementing the UserProviderInterface 
to have your own provider. And if you really need to use the methods of 
the UserManager in it, it is easier to inject it in your class instead 
of extending the class and passing all parameters again.


--
Christophe | Stof

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: [sf2] [FOSUserBundle] How to override the user_provider

2011-06-16 Thread winzou
I extend the UserManager (which implements UserProviderInterface) because I 
don't want to write a new one from scratch, as it perfectly fits my needs.
I may have been not so clear: my point is to use the UserManager of FOS, but 
with just a little modification of the findUserByUsername() method.

Inject it in my own user provider instead of extending it seems cool, but I 
should write a __call() method to be able to use a 
$myUserProvider-aFOSUserManagerMethod(), and I don't really like it.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: [sf2] [FOSUserBundle] How to override the user_provider

2011-06-16 Thread Alexandre Bacco
You're right I was. And UserProviderInterface is easier than I thought, I
will implement it myself. Thanks!

--
Sent with my HTC.
On Jun 16, 2011 6:06 PM, Christophe COEVOET s...@notk.org wrote:

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en