× Joomla Facebook Connect support forum

Topic-icon Use FB email to populate email field for full joomla user registration

Active Subscriptions:

None
Hey guys and gals, I need some help with getting the JFBC integrated full joomla user registration to do what my users need.

Currently, when a user logs in with their FB info, they are taken to the integrated registration page that as you know allows them to associate their FB with an existing account or create a new site account. What I would like to see is the removal of the email field from the new registration portion of this page. I would like the users email to populate from the users FB profile, similar to the way it does for the Facebook only user option.

Essentially, what I need is allow all users to choose a username at their first login or registration, because I have another component that uses the username to create other user pages that will be titled in the username, and is difficult for admin to change for each user if it is not created when they first arrive. If the email field can be populated as mentioned above, I can just send users through the integrated full Joomla user registration page. Otherwise, I need an option to have users select a replacement username to fb_xxxxxxxxxxxxxxx, prior to first login.

I appreciate all of the support you have provided and hope this one can be solved easily.
The topic has been locked.
Support Specialist
I think I know of a pretty quick solution you can do for this functionality, but let me make sure I understand what you want:
On the right form of the "Login / Register" page, the registration side, there should just be username, password, and verify password (no email).

This is one of those things that is there for legacy versions, but we've never removed the requirement for email address on that form. We've added it as task to create an option for not having email on that form, but, like I said, I can send you (I think) 4 lines of code that will accomplish the same thing.

Give me a day or so (early next week) to come up with something and test, and if it works as expected, I'll post it back here. We'll also include this option in the 3.1 release as we think it's a good idea as well :)

Thanks!
The topic has been locked.
Active Subscriptions:

None
Perfect. Yes this is exactly what I am after. Thanks again.
The topic has been locked.
Support Specialist
Ben (assuming that's your first name),
Try the following minor update below. We normally don't recommend direct changes to template files, and would suggest a template override. However, we're planning to put this as a configuration option (or as the only option) in the 3.1 release.. so having this change overridden with an upgrade should be find. Anyways, on to the change. Modify the /components/com_jfbconnect/views/loginregister/views/default.php:
In the middle of the file, at line 51, change the following:
<div class="label email"><label><?php echo JText::_('E-mail Address')?></label></div><input type="text" class="inputbox" id="email" name="email" value="" size="20" onblur="jfbcCheckEmailAvailable('emailSuccess')" /><br/>
<div id="emailSuccess"></div>
To:
<input type="hidden" class="inputbox" id="email" name="email" size="20" value="<?php echo $this->fbUserProfile['email']; ?>" />

This basically changes the input field to a pre-filled field with the email address already set. Please make sure that you have the "Require Email Permission" option set to "Yes" in JFBConnect Configuration. Otherwise, the user will not have an email address to automatically fill in. Also, please note that the user can choose to not give their real email address, which Facebook will then provide a long 'proxy' email address. You can still use this to contact your users, but Facebook will do some cursory checks on it to ensure it's not spam.

Good luck, sorry for the delay, let us know how it goes, have a good weekend, and other pleasantries :)

Alex
The topic has been locked.
Active Subscriptions:

None
Works great, thanks.
The topic has been locked.
Support Specialist
Great to hear it. It will definitely be included in the 3.1 release (likely as an option).
The topic has been locked.
Active Subscriptions:

None
Hello, I've made the change:
<input type="hidden" class="inputbox" id="email" name="email" size="20" value="<?php echo $this->fbUserProfile; ?>" />

But when the user choose to not give their real email address and Facebook provide a long 'proxy' email address:
[email protected]

Then when the user try to register a message appears:
"Unable to save user. Please try again and ensure that your username and email address are not already taken."

The user that I've introduced is right, then the problem is the email.

Any ideas?

Thanks
The topic has been locked.
Support Specialist
We'll have to test with the Proxy email addresses that Facebook hands out. The ability to pre-populate the email field is already in the upcoming 3.1 release. We'll make sure we add some test cases for the long email addresses that Facebook provides and figure out what the issue is that you're running into.
The topic has been locked.