Topic-icon How to pick user group when connecting with facebook

Active Subscriptions:

None
Hello
I'm having 2 problems with facebook connect

1. I need to let users select their user group.
In my website, I'm displaying different content for different countries. So when users register, they select a user group from a dropdown menu.
To achieve this, I made 5 user groups named as 5 countries. Then I modified the register component to have an extra field.
How can I add this functionality to the SC Login/register? I really need this feature.

2. Users created with Facebook don't work well with ACL
Even when I manually assign a user group to a user that has used Facebook connect, they can't see the content they're supposed to.
For example, let's say we have user John Doe. He registered with Facebook. Since he doesn't have a user group assigned, I assign one to him. Now John Doe belongs to user group named "user group 1". But even then, he can't see any content that is exclusive for "user group 1".
That is really weird. How can I fix that?

This is really urgent for me. So if you can help me It would be awesome.
The topic has been locked.
Support Specialist

1. I need to let users select their user group.

The best way to do what you're looking for is to create a socialprofile plugin. Basic information on how to do so is in the documentation below:
www.sourcecoast.com/jfbconnect/docs/gene...ing-a-profile-plugin

Mainly, you'd want to:
* Implement the protected function getRegistrationForm($profileData) function - This just returns HTML you want to display on the registration page and would be your select list of different countries
* Implement the protected function createUser($profileData) function - This would simply check the value the user selected and use the Joomla assignGroup method to put them in the right group.

For a long example, see the JomSocial profile plugin. That does a ton more than what you're looking for, but it shows those two functions, which should be all you need. Of course, you'd need to make sure that Automatic Registration is disabled so the user is brought to the registration form.

2. Users created with Facebook don't work well with ACL

Something sounds very wrong here. The user should absolutely be assigned to the default Joomla user group for your site. I'm not sure why that wouldn't be happening. My honest guess is that you have a database issue as the permissions system can be finnicky when many groups are created and removed.

If you don't have your code implemented to add a user to a group they select, are they properly added to the default joomla group on registration?

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 weeks ago #44224 by guamen1
Thanks for this useful information. Now it's working. About the second issue, I didn't do anything to fix it, but it's working now. I'm still trying to figure out what happened there.
Thanks
The topic has been locked.
Support Specialist
Glad to hear you got things working how you wanted.. one way or another :) Not sure what happened before, but what you described definitely wasn't the expected behavior. I'm glad the glitch got fixed.

If you run into anything else, or have any questions, just let us know.

Thanks,
Alex
The topic has been locked.