× Joomla Facebook Connect support forum

Topic-icon JConnector migration to JFB Connect

Active Subscriptions:

None
15 years 4 months ago #7395 by fb_545418911
Hi,

I'm in the midst of trying to figure out what is the best way to migrate my Joomla users to JFB Connect. My current setup is that I have users that have registered normally via the standard joomla registration process and I have those that registered using JConnector. The problem here is that I never asked for access to real the Facebook email. Given that joomla's account system requires that all emails be unique, what would be the best way too "merge" these accounts? I suppose I can create a feature that allows my users to specify which accounts they want to merge but I'm wondering if there might be a more automated way of going about this.
The topic has been locked.
Support Specialist
15 years 4 months ago #7405 by alzander
Lam,
It's been a while since we've investigated jConnector.. so I just downloaded it again and am doing some testing. I'll give my quick suggestions below, but please feel free to advise me on anything I might be missing as I'm still trying to understand/remember how jConnector worked.
Basic Migration
1) We're going to release an importer at some point which will let you (the admin) import all previous connections from jConnector into JFBConnect. These connections map a user's Facebook account to the account that was created for them in Joomla. If you have the ability to run a SQL query, you'd want to run the line below. This will take care of it all for you. If you can't, or don't want to, let us know, and we can whip something up for you to run:
INSERT INTO jos_jfbconnect_user_map (j_user_id, fb_user_id, created_at, updated_at) SELECT user_id, facebook_id, now(), now() FROM jos_jconnector_ids;
2) Once that's done, then users who've connected on your site using jConnector should be able to log into your site with their Facebook credentials and will be automatically logged into the previously created Joomla account.
Note: You must disable the jConnector module.

Emails
These are a bit trickier. I didn't realize that jConnector just left the user's email blank. That sucks. To fix is easy, but may cause some issues depending on your site and users.
1) Edit the following file: /plugins/authentication/jfbconnectauth.php. At line 71, you'll see the following:
if (!$configModel->getSetting('create_new_users'))
Change it to:
if (!$configModel->getSetting('create_new_users') || $jUser->email == "")

This will have the effect of always checking if the user's email address is blank when they're logging in, and if so, update it to the Facebook email address.

Something to look out for..
Finally, the last setting I'd have to mention is that if a user tries to log in via Facebook and already is using their FB email on your site, there can be problems (duplicate emails - as you noted above). For this case, we'd recommend making sure the "Automatically Link Facebook Users by Email:" setting is enabled in the JFBConnect User config area. What this will ultimately do is, when the user logs in through Facebook, it will associate the Facebook account automatically with the Joomla account using the same email. It will, however, leave the 'old' Facebook mapped account (from jConnector with blank email and all) as a derelict entry as from that point on, the user wouldn't be able to log in with that specific account. Hopefully, this won't matter as they'll have their Joomla account now mapped to FB. But, if the user had a lot of activity, articles, forum posts, etc on the 'old jConnector/FB' account, it could be confusing and something for you to be aware of.

Whew. Hopefully this makes your little avatar guys' head not want to explode.. it's getting close. I certainly hope this helps, but if you run into any stumbling blocks, want to discuss what-if's or just have any other general questions, you know where to find us!
The topic has been locked.
Support Specialist
15 years 4 months ago #7406 by alzander
2 things I forgot to mention, just to make this longer..
1) You should enable the "Require Email Permission" setting. This will make sure we get an email address from Facebook. I didn't test with this disabled, so I don't know what would happen. It should still work, you just will be in the same situation as before (no email addresses for the user).
2) Test, test, test. I installed jConnector on a test site, registered through it, then made the changes above to migrate. Everything worked for me, with this one user. On a 'live' site though, anything can happen, so just watch the results closely for a few days.

Best of luck!
The topic has been locked.
Active Subscriptions:

None
15 years 4 months ago #7407 by fb_545418911
Cool thanks! Gimme a bit time digest all this! LOLX! Will drop by again if I have any questions!
The topic has been locked.
Active Subscriptions:

None
15 years 4 months ago #7408 by fb_545418911
Hi Alex,

I noticed that we can grab the email from facebook automatically. However, is it possible to get the user to enter a password for their account as well?
The topic has been locked.
Support Specialist
15 years 4 months ago #7411 by alzander
Yes, you can definitely grab the email automatically. That's what the above stuff in my lengthy code does.. helps you update the user's account with that email address.

As for a password, for new users who register, that's not a problem. Simply make sure that the "User Creation" setting is set to "Full Joomla User". This will send them to a login/register page where they create a Joomla account. After this, they can log in with either their Facebook or Joomla credentials. We don't use that on this site, cause we want users to 'get in' as quickly as possible (we use Facebook User Only). For more info on the differences, see:
www.sourcecoast.com/extensions/jfbconnec...ration-guide?start=4

For returning users though, there's no way for us to set their password for them. In this case, I'd recommend you tell them to go to their Edit Details page. This can be on the "Login Redirect" (Setup a welcome back message with a note that it's time to update their password), or a variety of other ways.

Hope this helps, and let us know if you have any other questions.
The topic has been locked.
Active Subscriptions:

None
15 years 4 months ago #7433 by fb_545418911
I see. So if I want to force the issue for returning users by redirecting them to the edit details if they did not specify a password, where can I start?
The topic has been locked.
Support Specialist
15 years 4 months ago #7434 by alzander
Basically, there's not a real way to 'force' them to add a password to their account, that I know of.. there may be some extension out there that does it, but I don't know of any off-hand.

Here's my best suggestion to get you going:
1) Create a menu item to the User -> User -> User Form Layout.
2) Create a Custom HTML module and assign it to a top module position on that page (above the component). This module position name can vary depending on the template your using.
3) In the Custom HTML text put a simple "Welcome back Facebook user" message that quickly explains that you upgraded your Facebook Connect functionality and that all users should update their password below (in the form).
4) Finally, set the Returning User Redirection (in JFBConnect) to go to this menu item.

Again, this won't force anything, but you can let user's know that if they want to be able to log into your site with a Joomla accunt (and not Facebook), they need to setup a password for their account.

Hope this helps, but let us know if you have any other questions!
The topic has been locked.
Active Subscriptions:

None
15 years 4 months ago #7440 by fb_545418911
cool thanks!
The topic has been locked.
Support Specialist
15 years 4 months ago #7443 by alzander
No problem. It's what we do. Please keep us posted on how the jConnector migration goes. It seems pretty straightforward (from our standpoint), but on a live site.. nothing's every very straightforward.

Glad we could help you out though. After you've used JFBConnect for a while, if you would like to leave a rating or review on the JED for the extension or our support, we'd appreciate it... it's of course not necessary though :)

Thanks, and good luck!
The topic has been locked.