Topic-icon Question on login use

Active Subscriptions:

None
8 years 10 months ago #62331 by HelloFF
I'd like to use your extension not to create new Joomla accounts but to pre-populate a form with data...

I have this form:


I need it so that when you click Register with LinkedIn it brings you back to this page but fills that form out with your information.

Is this possible with your module?
Could I set the callback to this page then get the info from POST or GET of the data from the callback?

Thanks.
The topic has been locked.
Support Specialist
8 years 10 months ago #62335 by alzander
Replied by alzander on topic Question on login use
This is not something JFBConnect supports out of the box. We really focus on registrations only, but you could definitely modify things to pre-fill out your own form if that's what you wanted to do. Our Social Profile plugins can let you redirect the user to your own custom page after they register and then pre-fill any fields on that page.

In general, that should work even if the user never creates an account. That's not something we've ever investigated or tried to implement though, so it would definitely take some development work to get JFBConnect to pre-fill the fields on your form above. If you have a developer, we can gladly help point you in the right direction. I don't think it'd be a herculean effort to get things going.
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62337 by HelloFF
Replied by HelloFF on topic Question on login use
Hi Pal,

Luckily I am the developer working on this site and am willing to put the work into getting this working!!

Where shall we start? I'm assuming the first step is to change the callback url to that of the page I want it to go to then look at extracting the data pulled back to the page from the linkedin login?

Thanks.
The topic has been locked.
Support Specialist
8 years 10 months ago #62338 by alzander
Replied by alzander on topic Question on login use
Nope :)

First step is copying the /socialprofiles/jomsocail/ plugin to your own plugin name. Update the names from JomSocial to whatever you call the plugin. The *only* functions you should need are:
__construct
prefillRegistration
getProfileFields - Returns an array of fields to be displayed in the JFBConnect -> Profiles configuration area (see the K2 plugin for a real easy example of this)
processField (possibly, if you need to manipulate how a field is shown)

Steps:
* In __construct you need to set the registration_url to the page your form will live on and change the displayName to your plugin name
* Install your new plugin
* In the JFBConnect -> Configuration area, set the Registration Component to whatever you set in the displayName field
* Then muck with the prefillRegistration function to grab the user's profile data in the $profileData object (already done) and use prefillRegistration to set the data in the form (it sets it as though the user POSTed the value, which works for most forms).

That's the really short and skinny of it, but hopefully it helps give you a starting point. Let us know when/where you get stuck!
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62339 by HelloFF
Replied by HelloFF on topic Question on login use
Thanks for your prompt response Alex. I'll be getting on this first thing in the morning and will reach out if I need any support :)

I'll let you know how it goes as well!

Thanks.
The topic has been locked.
Support Specialist
8 years 10 months ago #62342 by alzander
Replied by alzander on topic Question on login use
No problem. Good luck :)
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62347 by HelloFF
Replied by HelloFF on topic Question on login use
Hello!

So I've started on this first thing, I opened your extensions main zip file (jfbconnect_v7.2.1.zip) and from there I went to /packages/plugins/socialprofiles/ I then extracted jomsocial.zip.
I renamed jomsocial.zip to mnblin.zip and renamed the root files from jomsocial.php, jomsocial.xml and jomsocial_rule.xml to the mnblin equivalent.

So I need to do this to the folder in there called jomsocial as well?

You mentioned the methods I would need in the main .php file, do I just remove all the other ones that I don't need?

I also can't find `processField ` as a method.

Thanks,
The topic has been locked.
Active Subscriptions:

None
8 years 10 months ago #62348 by HelloFF
Replied by HelloFF on topic Question on login use
Hello again,

I've removed all the methods I don't need and changed the file names in install.php (to match my new ones) so that it actually installs. I changed the names of files in the xml file as well as that was also required with me changing the actual file names.

So I've managed to install the plugin with these changes but I now cannot find any reference to it in the configuration and the only thing on the Registration Component drop down is JFBConnect.

Thanks.
The topic has been locked.
Support Specialist
8 years 10 months ago #62352 by alzander
Replied by alzander on topic Question on login use
After you installed, did you enable/publish it? If so, the displayName you setup should show in the Registration Component as long as the registration_url value is set to some URL.

You won't see processField. It's in the root library at /libraries/sourcecoast/plugins/socialprofile.php, which all profile plugins are a subclass of.

Let me know if publishing helps get you going there (or not) and we can keep pushing ahead :)
The topic has been locked.