Topic-icon beginner questions

Support Specialist
9 years 3 months ago #50376 by mel
Replied by mel on topic beginner questions
I just added the code that Alex had above and it worked for me. Please make sure:
1. To turn off any caching that you have on
2. The Social Profiles - JomSocial plugin is still enabled,
3. The setting in the Profiles area for 'Always Import Profile Data' is set to Yes; otherwise, the import will only happen on initial registration.

Here are the two scenarios that I tested.
1. Created a new user with Google button. Once created and logged in, hit the Facebook button to connect. After it connected, I went to my JomSocial profile page and the new profile link was present.
2. Created a new Joomla user in the backend. Went to the front end and logged in with that user. Then hit the Facebook button to connect. The new profile link is also present in the JomSocial profile.

If you're trying a scenario that is pretty different than these, please let us know what steps you are taking:

-Melissa
The topic has been locked.
Active Subscriptions:

None
9 years 3 months ago #50377 by alfredopacino
Replied by alfredopacino on topic beginner questions
I was missing the "Always Import Profile Data", because it could be very annoying for the user see his jomsocial username and avatar replaced by his facebook username and avatar.
Actually even for "pure" facebook users could be annoying they will loose their site avatar and username too each login..
I've just tried once and with that option enabled works, but I will do some other test to be sure.
Maybe there is a way to edit the mapping and replace just that field in case of "reconnection"?

In case of this issue is beginning to be confused, in 2 word: I just need to get the fb profile url when the users do a reconnection to facebook! :)
The topic has been locked.
Support Specialist
9 years 3 months ago #50385 by alzander
Replied by alzander on topic beginner questions
The Always Import Profile Data would need to be enabled in to use the code suggested above. There is no way to import just some data during a re-connection. That would take a large amount of code changes and not something we could provide you with. If you are, or have, a developer, you're free to make whatever modifications you want to import just the URL. You could also set the profiles are to only import the Facebook URL and no other information. That way, on connection, you would get the URL like you want. During registration though, that's all you'd get as well.

As noted above, we don't support specifically what you're looking for and it's not something that's been requested before. It's not something we'll be implementing soon, but we do have plans to improve the profile import process in a few ways in a future release, but I still don't know if it would be as nuanced and controllable in all the different login/registration scenarios like you're looking for.

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

None
9 years 3 months ago #50390 by alfredopacino
Replied by alfredopacino on topic beginner questions
don't worry, the main question is solved thanks to your code.
Now we're talking about secondary questions, still important, but secondary :)
If I exclude the username import, the users who login using fb button (not reconnection) will get a "random" username like I noted before like fb_123456? Am I right? Note I would keep possibly a "1 click login" using the login with facebook.
The topic has been locked.
Support Specialist
9 years 3 months ago #50404 by alzander
Replied by alzander on topic beginner questions
For the username, as noted by Melissa above:

Are you referring to the username? Please make sure to set the JFBConnect > Configuration > General > 'Auto Username Prefix' setting to something other than fb_,g_, such as first.last or firlas.

You even noted that issue as solved, so I'm not sure what your question actually is. Whenever you have Automatic registration enabled, JFBConnect will generate a username for that guest based on the format above. If you want the user to select their own username, you'll need to disable automatic registration.

Alex
The topic has been locked.
Active Subscriptions:

None
9 years 3 months ago #50407 by alfredopacino
Replied by alfredopacino on topic beginner questions
As I said, the import url works, that's the main question.
But there are some other things came up: why should I set "Always Import Profile Data" to use your code? There is a way to avoid that? I think this option could be annoying for my users..
The topic has been locked.
Support Specialist
9 years 3 months ago #50408 by alzander
Replied by alzander on topic beginner questions
When the "Always Import Profile Data" setting is disabled, then profile data is only imported during registration. Since you want it to import on connecting existing accounts, and not just registration, you need to leave it enabled.

There isn't a way to disable that setting and still import data. That's just not how JFBConnect works. If you *only* import the Facebook profile URL, then it won't overwrite any other existing data.

It's up to you to whether what options to choose for your site, but the exact functionality you're looking for is not something we support. Again, you're free to modify JFBConnect's code however you want, but I don't have suggestions on how to perform a limited import in certain scenarios. It would be difficult to do.

Alex
The topic has been locked.
Active Subscriptions:

None
9 years 3 months ago #50409 by alfredopacino
Replied by alfredopacino on topic beginner questions

alzander wrote: It's up to you to whether what options to choose for your site, but the exact functionality you're looking for is not something we support. Again, you're free to modify JFBConnect's code however you want, but I don't have suggestions on how to perform a limited import in certain scenarios. It would be difficult to do.


The limited fields import was just a proposition, I understand It could be very tricky to edit the code in this way..you know your code.
But I guess it could be easier edit the code to import the FB fields in 2 cases:
- first login with FB
- reconnection.
without using "always import profile" I mean..what do you think?


Anyway, I noticed if I delete the connection in backend jfbconnect/usermap, the jomsocial users get this in frontend edit page:
www.diigo.com/item/image/51ynl/3ojk
FB button and a message "Your account is already associated with a Facebook login."
They shouldn't be both there! :)
(obiouvsly that button is printed using {JFBCLogin show_reconnect=true} )
The topic has been locked.
Support Specialist
9 years 3 months ago #50414 by alzander
Replied by alzander on topic beginner questions

But I guess it could be easier edit the code to import the FB fields in 2 cases:
- first login with FB
- reconnection.
without using "always import profile" I mean..what do you think?

The code I provided earlier is the code to import during a reconnection. The profile plugins use the Always Import setting to determine if an import should happen. To override that behavior, you'd need to edit our plugin files which, as mentioned, is what would likely take a lot of thought and work to get right.

FB button and a message "Your account is already associated with a Facebook login."
They shouldn't be both there! current/smile
(obiouvsly that button is printed using {JFBCLogin show_reconnect=true} )

Actually, that's not from JFBConnect. My guess is that you still have the JomSocial Facebook integration enabled. You shouldn't. Please remove the API/Secret keys from JomSocial because it looks like you have previous connections in their system which is showing that text.
The topic has been locked.
Active Subscriptions:

None
9 years 3 months ago #50438 by alfredopacino
Replied by alfredopacino on topic beginner questions
It looks like your code
JFBCFactory::usermap()->getProviderUserId($jUserId, 'facebook')

doesn't work in case of reconnection..am I right or there something else is wrong in settings?
I juest need to check IF the user is connected with facebook or reconnected with facebook (in this case I don't care the different)
basically a function isFacebookConnected() returns true/false
The topic has been locked.