Forum is closed

New Jlinked question

New Jlinked question

It's great to see that the next version of JLinked has been released.  Does it automatically connect the uesr's JLinked account to his existing Joomla account?

- JW

jwhelan
John
useravatar
Offline
71 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: New Jlinked question

JW,
Sorry for the delay in responding. No, this release doesn't have that feature. We planned to add that and the ability to auto-create accounts. The migration to the "Social Profile" plugins and the compatibility with Joomla 3.0 proved too much to test, implement, and be confident with for this release. We are planning the next 2.1 release of JLinked though which will definitely have these features. With the new Social Profile plugins, that makes things much easier to develop since they are compatible with JFBConnect and simply require less development and testing going forward.

With all that said, if you just want the automatic mapping by email.. so that if a user clicks the Login with LinkedIn button and already has a Joomla account on your site with the same email address, they will be automatically associated and logged in, we can help you now.

The code below has been tested, but not thoroughly gone through all our checks and full test suite. It should do what you're looking for though. To implement, edit the /components/com_jlinked/controller.php file. In the loginLinkedInUser function, around like 56, you'll see:

Code:

            if ($jUserId == null)

            { # User not in system, create new users setting enabled. Redirect to the login/register form

Directly *above* that, add the following big ole' block of code. I left the 2 lines above at the bottom of the block so you can see how it flows.

Code:

            if (!$jUserId)

            {
                $profileLibrary = JLinkedProfileLibrary::getInstance();
                $linkedInProfile = $profileLibrary->fetchProfile($liMemberId, array('email-address'));

                $liEmail = $linkedInProfile->get('email-address', null);
                if ($liEmail != null)
                {
                    $jUserEmailId = $userMapModel->getJoomlaUserIdFromEmail($liEmail);
                    if (!empty($jUserEmailId))
                    {
                        // Found a user with the same email address
                        // do final check to make sure there isn't a FB account already mapped to it
                            SCSocialUtilities::clearJLinkedNewMappingEnabled();
                            if ($userMapModel->mapUser($liMemberId, $jlinkedLibrary->getToken(), $jUserEmailId))
                                $app->enqueueMessage(JText::_('COM_JLINKED_MAP_USER_SUCCESS'));
                            else
                                $app->enqueueMessage(JText::_('COM_JLINKED_MAP_USER_FAIL'));

                            $jUserId = $jUserEmailId; // Update the temp jId so that we login below
                    }
                }
            }

            if ($jUserId == null)
            { # User not in system, create new users setting enabled. Redirect to the login/register form

Test, test, and test again. You can delete the 'mapping' in the JLinked User Map admin area. That will leave the Joomla account. On the next login with JLinked, the User Map row should be re-added.

Let us know how that goes. We're considering a 2.0.1 release with this code, and having positive feedback would help get that prioritized.

Thanks,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
23906 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11549
Total Polls:
0
Total Posts:
48583
Posts today:
1
User Info
 
Total Users:
47563
Newest User:
dhotañ
Members Online:
1
Guests Online:
1160

Online: 
Clarenceljw
Social Stream
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program