SCLogin not following user mappin

SCLogin not following user mappin

When I log via FB, the user connect button dissapears, but:

  • If while logged i reload the page, it is there

  • If I log using Jª user details, it is there

  • If I log via LinkedIn, it is there


  • Notice this only happens with FB button, LinkedIn one does not appear again after linking to user

    If I check JFBC usermap, my user is corfrectly maped

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    Not sure. It sounds like JFBConnect isn't detecting the user properly. That can be caused by a few things, usually expired or missing authentication tokens which Facebook provides.

    Can you send us details of the site so we can see what's happening on the front-end? If possible, super admin credentials would help as well to check how you have things configured.

    Also, has this site run with earlier versions of JFBConnect? Did you have the issues then, or did this just start after the v5.0 upgrade?

    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
    23813 Posts
    Support Specialist
    Administrator has disabled public posting. Please login or register in order to proceed.

    Re: SCLogin not following user mappin

    alzander wrote:

    Also, has this site run with earlier versions of JFBConnect? Did you have the issues then, or did this just start after the v5.0 upgrade?

    No, it's a new site I'm working on done in J3, so I had to wait for a comatible release current/wink

    It's a clean JFCB install

    I send you details in a PM

    Thanks!

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    alzander wrote:

    Can you send us details of the site so we can see what's happening on the front-end? If possible, super admin credentials would help as well to check how you have things configured.

    Could you give a look? current/wink

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    Johnny,
    Sorry for the delay. I just got into your site and tested a bit.

    I wasn't able to recreate the issue of reloading the page to see the Connect this account button when I had connected with JFBConnect. However, I could see the Connect button when logging in with Joomla credentials. I think this is likely due to an optimization in the latest release to try to speed up page loads for guests. Basically, we don't load some Facebook features for guests if you don't have Automatically log Facebook users in. Without that extra call, the FB Javascript isn't notifying us that a specific user is logged in already, so JFBConnect doesn't see anyone, and therefore it asks if they want to connect.

    Honestly, the SCLogin module shouldn't present that option if the user has ever connected before (not if they just currently aren't logged into Facebook), so it seems like there's a logic issue with what we're doing.

    Please test again for the cConnect button showing after you login with Facebook. We were testing on the JomSocial home page with the site Online. We'll look into a modification of the SCLogin module to hide the connect button if the user has ever connected, regardless of if they're logged into Facebook at that moment.

    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
    23813 Posts
    Support Specialist
    Administrator has disabled public posting. Please login or register in order to proceed.

    Re: SCLogin not following user mappin

    alzander wrote:

    lease test again for the cConnect button showing after you login with Facebook. We were testing on the JomSocial home page with the site Online. We'll look into a modification of the SCLogin module to hide the connect button if the user has ever connected, regardless of if they're logged into Facebook at that moment.

    I already tried it, when I login through facebook, the button does not appear current/smile

    BUT, if after that login, I ctrl+r the page, it reappears current/sad

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    I just tested again, and I can't recreate that problem. Not saying it doesn't exist, I do believe you. When I tested this last time, I logged in on the home page. I hit ctrl+r a few times and then navigated to a few different pages. Each time, I checked the login drop down and things were fine.

    Can you let me know:
    * What browser you're using?
    * Try with another FB user and see if you have the same problem.
    * Does this happen on every page that you login from, or just specific ones.
    * Can you try switching your template to a Joomla-standard one and try again?

    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
    23813 Posts
    Support Specialist
    Administrator has disabled public posting. Please login or register in order to proceed.

    Re: SCLogin not following user mappin

    I'm gonna try recording a video as I just opened the site, and jy JConnect button is there current/wink

    Gimme some minutes

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    alzander wrote:

    Can you let me know:
    * What browser you're using?
    * Try with another FB user and see if you have the same problem.
    * Does this happen on every page that you login from, or just specific ones.
    * Can you try switching your template to a Joomla-standard one and try again?

    1.- Chrome
    2- as the site is offline I have just logged from OFFLINE page current/tongue
    3- Tried with protostar in the video with same result current/wink

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    Johnny,
    The problem is pretty much what I described above. Your account is actually 'linked', but SCLogin only checks if your user is 'mapped' in JFBConnect *AND* currently logged into Facebook. Since your site is in Offline mode, that throws another monkey wrench into things.

    As we mentioned above, and definitely seeing it from your video, the problem is:

    the SCLogin module shouldn't present that option if the user has ever connected before (not if they just currently aren't logged into Facebook), so it seems like there's a logic issue with what we're doing.

    If you're up for implementing and testing a quick change, we'd love your feedback. Please edit the /modules/mod_sclogin/helper.php file. Around line 340, you'll see:

    Code:

        function getJLinkedConnectButton()
    
        {
            $buttonHtml = "";
            if (!$this->jlinkedLibrary->getMappedLinkedInUserId())
            {

    Change that to:

    Code:

        function getJLinkedConnectButton()
    
        {
            $buttonHtml = "";
            $userMapModel = new JFBConnectModelUserMap();
            $jUser = JFactory::getUser();

            $fbMapping = $userMapModel->getFacebookUserId($jUser->get('id'));
            if (!empty($fbMapping))
            {

    That should simply check if the user has any mapping in Joomla to a Facebook user. Not if they have a mapping and are currently logged in. The code hasn't been tested, I just wrote it, but it looks right. Let me know how it goes, please.

    Best of luck, and thanks for the report. I can see adding this to an update of the SCLogin module in the future due to the obvious confusion it's current check can cause.

    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
    23813 Posts
    Support Specialist
    Administrator has disabled public posting. Please login or register in order to proceed.

    Re: SCLogin not following user mappin

    Ok,  I'll try it tonight when I make it home. current/wink

    In fact,  I see it as in improvement rather than a bug fix,  I think it 's the correct approach,  if I' m logged out not should have no relevance for connecting again or not. Also you do one less check current/wink

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    The original thinking behind why we checked if the user was logged into Facebook as well was because some features require the user to be logged in. Like, Comment, Activity, Recommendations, Open Graph Actions, etc. So, that button is there in case you login with 'just Joomla', you have an easy way to also login to Facebook so that everything works as expected.

    However, with the current text of "Connect this to your social network" or whatever, that's extra confusing.

    Hope that makes sense, and of course, feedback is welcome now that you know the origins current/smile

    Alex

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

    alzander
    Alex
    useravatar
    Offline
    23813 Posts
    Support Specialist
    Administrator has disabled public posting. Please login or register in order to proceed.

    Re: SCLogin not following user mappin

    Wouldn't better then if not logged in Facebook, for those actions to load a pup when trying to use them urging to login to use?  Maybe grey them and popular saying you must be logged,  dunno...  I see it confusing otherwise,  I will still not be able to use them,  but can not notice why... Or if you don't use likes, comments, etc plugins you're doing an unnecessary check don't you think?

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    Some features you can do that with, others, like automatically posting if a user is reading something, isn't as do-able since it defeats the 'automatically' purpose. Other widgets, like the Like and Comment button actually already do present a Login button when used while not logged in. Long ago, they didn't. So, I think our check is simply outdated for the features that Facebook currently has.

    Definitely let us know how your testing goes and any other feedback you may have.

    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
    23813 Posts
    Support Specialist
    Administrator has disabled public posting. Please login or register in order to proceed.

    Re: SCLogin not following user mappin

    Ok, so result with the new code is:

    Facebook button still there

    Now LinkedIn button is there also current/wink

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    My first block above was the wrong code. I told you to modify the getJLinkedConnectButton when you should be changing the getJFBConnectButton. Re-modify things. When done, the JLinkedButton code should be back to original and both functions should look like:

    Code:

        function getJFBCConnectButton()
    
        {
            $buttonHtml = "";
            $userMapModel = new JFBConnectModelUserMap();
            $jUser = JFactory::getUser();

            $fbMapping = $userMapModel->getFacebookUserId($jUser->get('id'));
            if (!empty($fbMapping))
            {
                $buttonHtml = '<div class="fb_connect_user">';
                $buttonHtml .= '<div class="fb-login-button" onlogin="javascript:jfbc.login.on_login();">' . JText::_('MOD_SCLOGIN_CONNECT_BUTTON') .'</div>';
                $buttonHtml .= '</div>';
            }
            return $buttonHtml;
        }

        function getJLinkedConnectButton()
        {
            $buttonHtml = "";
            if (!$this->jlinkedLibrary->getMappedLinkedInUserId())
            {
                $buttonHtml = '<link rel="stylesheet" href="components/com_jlinked/assets/jlinked.css" type="text/css" />';
                $buttonHtml .= '<div class="li_connect_user">';
                $buttonHtml .= '<div class="jLinkedLogin"><a href="' . $this->jlinkedLibrary->getLoginURL() . '"><span class="jlinkedButton"></span><span class="jlinkedLoginButton">'.JText::_('MOD_SCLOGIN_CONNECT_BUTTON').'</span></a></div>';
                $buttonHtml .= '</div>';
            }
            return $buttonHtml;
        }

    Sorry about that silly mixup! Let us know how that goes,
    Alex

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

    alzander
    Alex
    useravatar
    Offline
    23813 Posts
    Support Specialist
    Administrator has disabled public posting. Please login or register in order to proceed.

    Re: SCLogin not following user mappin

    Opps, sorry, I posted in the wrong thread :blush:

    Anyway, result, jlinked works normally again, facebook button still missbehaves current/sad

    I'm returning it to the "stock" code for next try current/wink

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    Johnny,
    Alright. Actually got into the code to test what I was dishing out above. There's one minor, minor code issue with what I posted.. but of course, that's enough. You'll need to re-implement the code above, but where we check for "if (!empty($fbMapping))", there shouldn't be the ! in there. So, the getJFBCConnectButton function should look like:

    Code:

        function getJFBCConnectButton()
    
        {
            $buttonHtml = "";
            $userMapModel = new JFBConnectModelUserMap();
            $jUser = JFactory::getUser();

            $fbMapping = $userMapModel->getFacebookUserId($jUser->get('id'));
            if (empty($fbMapping))
            {
                $buttonHtml = '<div class="fb_connect_user">';
                $buttonHtml .= '<div class="fb-login-button" onlogin="javascript:jfbc.login.on_login();">' . JText::_('MOD_SCLOGIN_CONNECT_BUTTON') . '</div>';
                $buttonHtml .= '</div>';
            }
            return $buttonHtml;
        }

    Test it out and let us know.

    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
    23813 Posts
    Support Specialist
    Administrator has disabled public posting. Please login or register in order to proceed.

    Re: SCLogin not following user mappin

    Aparently, this fixed it current/smile have to test for a while more, but I just loaded the page and the connect button wasn't there anymore current/wink

    Are you implementing it or should I go with overrides?

    johnnydement
    useravatar
    Offline
    78 Posts
    Active Subscriptions:

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

    Re: SCLogin not following user mappin

    There's another user we referred to this thread as well. I'd like to hear that it works from them as well and do a little more thought and testing. I'm pretty confident this will make it into the next SCLogin release, which is going to be a big overhaul of the design (it'll look a lot nicer with more template designs built in). We're expecting it out in mid/late March.

    Thanks for the feedback,
    Alex

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

    alzander
    Alex
    useravatar
    Offline
    23813 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:
    11498
    Total Polls:
    0
    Total Posts:
    48407
    Posts today:
    6
    User Info
     
    Total Users:
    47473
    Newest User:
    martinpleon
    Members Online:
    0
    Guests Online:
    1048

    Online: 
    There are no members online
    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