0
votes

i'm on a Symfony project ( v2.5 ) and i'm using FOSUserBundle & OAuth for the login/sign in.

My problem is : I have different type of user with some that has more informations to edit in /profile/edit. That's why i'm trying in a simple way to get user informations to do a condition in the form builder. With one attribute i'm able to know which type of user i have and which form he needs.

After a lot of research i found this https://github.com/PUGX/PUGXMultiUserBundle/blob/master/Resources/doc/index.md but that doesn't seem to be the best for my little problem.

Best regards,

Thanks for replying

1
We had the same problem (many custom attributes, profile picture etc.) and ended up by implementing our own logic instead of using the FOSUserBundle templates and controller actions for editing profiles... - sebbo
I've not that much time to recreate a perfect user bundle :/ I'm still trying to change this - BleuBizarre
Should i pass this attribute in the $_SESSION? but how ? - BleuBizarre
ok so in the builder by $username = explode( '"' ,explode( ';' , explode(':',$_SESSION['_sf2_attributes']['_security_main'])['34'])[0])[1]; i can have the username ( that is in fact the email which is primary ) i'm now trying to have a proper way ( because what i've done is already to nasty ) to find the user attribute ;) - BleuBizarre

1 Answers

0
votes

I've found a way ( nasty but working )

Before creating the form, i've access to user, so I set the attribute in the Session, catching the attribute in the builder then unsetting the session