× Joomla Facebook Connect support forum

Topic-icon JFB auto associate to email feature

Active Subscriptions:

None
15 years 3 months ago #7783 by fb_545418911
Hi!

My JFB migration has been put on hold becos of a problem we recently discovered. Our joomla has been modified to make use of email as username. The problem comes in when a new Facebook user registers for a new account (for exp, This email address is being protected from spambots. You need JavaScript enabled to view it.) and the user chooses to associate the facebook to an existing normal registered account (lets say This email address is being protected from spambots. You need JavaScript enabled to view it.). We have tested JFB and found that the default behavior is that the previously defined email was retained (which is OK). The problem is when said user decides to register a new account (via the normal joomla registration) with the email This email address is being protected from spambots. You need JavaScript enabled to view it., then when the user next logs in with facebook, JFB auto associates the This email address is being protected from spambots. You need JavaScript enabled to view it. account, leaving This email address is being protected from spambots. You need JavaScript enabled to view it. disassociated. This problem may also arise due to the fact that we allow users to change their email.

Is there a way to check if a particular FaceBook ID already exists in the user_mapping table before going ahead and auto-associating? Thanks!
The topic has been locked.
Support Specialist
15 years 3 months ago #7795 by alzander
To start, I'm assuming you've made these changes yourself to allow for email/username as the same. If you're using a 3rd party extension, let us know.

Yes, right now, JFBConnect does not re-update the user's email address on login. It's something we have a task to add (as an option) to force email updates on every login. If you'd like the code to do this yourself, it should be pretty easy to provide (and may fix your problem immediately).

As for checking the user_mapping table before auto-associating, try the following (very minor) code change. In the /components/com_jfbconnect/controller.php file, at line 44, add the && !$jUserId below:
if ($configModel->getSetting('facebook_auto_map_by_email') && !$jUserId))
That will check if both the auto-mapping setting is enabled and there isn't already a User associated with that Facebook user.

We haven't tested that change directly, but reading through the code, it seems like it will do what you're looking for. I've added it to my test branch, and it will likely be included in the 3.2 release, simply because we don't see any ill-effects from it.. and I think that's correct behavior (only auto-map IF that user doesn't already have a mapping).

Please let us know if either of the above options help, and thanks for being very clear with what you're looking for.. it really helps!
The topic has been locked.
Active Subscriptions:

None
15 years 3 months ago #7823 by fb_545418911
Cool thanks! Will update you on how it works out!
The topic has been locked.
Active Subscriptions:

None
15 years 3 months ago #7949 by fb_545418911
Hi sorry for the late update,

The feature works, but it lead to another slight problem. The problem is the reverse of the original problem, where a user attempts to Fconnect using a facebook account whose email already exists in the account and is already user mapped. Current behavior is that it just bounces the user back to the main page. I think a simple solution to this would be to add some sort of pop-up notification. If you guys can help me on how too add this notification that would be great.

At any rate, going to go ahead with my migration anyways as this problem happening should be an isolated case. Thanks for the help!
The topic has been locked.
Active Subscriptions:

None
15 years 3 months ago #8142 by fb_545418911
Hi Alex,

Any advise on the pop-up notification?
The topic has been locked.
Support Specialist
15 years 3 months ago #8167 by alzander
Lam,
Sorry, I think I missed the pop-up request when you made it before. What kind of pop up are you looking for? We can't really make something that says "Which account do you want to associate this with?", as it can give information out about accounts that some users might not want out there. If it's a general "We're associating you to account 'xyz'", we could probably help you with that.

A little more explanation would help, and we still have this in our tracker to see if there's any better way we can do this (so far, the answer is no). The best solution we have, for admins who don't like this scenario, is to disable auto linking, which will bring the user to the Login/Register page where they can choose the account to associate with.
The topic has been locked.
Active Subscriptions:

None
15 years 2 months ago #8240 by fb_545418911
Hi Alzander,

Sorry for the late reply, been seriously busy. As for what sort of notification, a simple message will do: "An account with the same email as your facebook primary account has already been mapped to another facebook account. If this is in error, please contact us at This email address is being protected from spambots. You need JavaScript enabled to view it.".
The topic has been locked.
Active Subscriptions:

None
15 years 2 months ago #8287 by fb_545418911
Hi Alzander,

Any idea how to pop the message?
The topic has been locked.