× Joomla Facebook Connect support forum

Topic-icon Other users posting to my wall.

Active Subscriptions:

None
13 years 11 months ago #24019 by Ivan
I have a component that gives users achievements after certain activities on my site. Now while i am logged in I am getting the posts that should be for others users wall on my wall. Even graph actions to my activity wall. Im not sure why this is happening . At first i thought it was because I was an app administrator but now really uncertain.

If the code is executing should i check to make sure the logged in fb user is the same as the user getting an achievement?


I have code such as
        $jfbcLibraryFile = JPATH_ROOT.DS.'components'.DS.'com_jfbconnect'.DS.'libraries'.DS.'facebook.php';
        if (!JFile::exists($jfbcLibraryFile)) {
        echo "JFBConnect not found. Please reinstall.";
        return;
        }
        require_once ($jfbcLibraryFile);

           $fbClient = JFBConnectFacebookLibrary::getInstance();
        $fbUserId = $fbClient->getFbUserId();

           if($fbUserId)
        {
      
            $fbClient->setFacebookComment($message,$picture,$name,$link,$caption,$description);
        }
The topic has been locked.
Support Specialist
13 years 11 months ago #24032 by alzander
Ivan,
That shouldn't post to the wrong users wall normally. However, if you've put that code into an extension that utilizes caching to store the code output for future calls, it could keep the user's Facebook ID from the first call and use that for later calls. You can try updating the $fbClient->getFbUserId() call to $fbClient->getMappedFbUserId() which will verify that the FB User ID is the same as the current user's ID. Caching still may present a problem, but I think the new call is the better option either way.

Let us know if that helps, or not, and we'll see what else we can do.

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

None
13 years 11 months ago #24035 by Ivan
Okay, Alex. Ill test this out.
The topic has been locked.
Active Subscriptions:

None
13 years 10 months ago #25168 by Ivan
I am using this code $fbClient->getMappedFbUserId() but im still getting users post to my wall when im logged in. Would it be a good idea to check the joomla user that is logged in then get that facebook id or would caching still be an issue in getting the current joomla user if i was logged in also?
The topic has been locked.
Support Specialist
13 years 10 months ago #25186 by alzander
I'm honestly not sure what could be the issue. It never hurts to do more checks for the current user. However, if you look at the code for the getMappedFbUserId function, it's already doing JFactory::getUser() and checking who is currently logged in.

There's no reason that posts should be going to the wrong wall. It would mean that a few things are going wrong:
* The user's ID from Joomla is being improperly ready (possibly from caching)
* The current user also has the wrong access token stored (yours, instead of theirs) in the Joomla session (possibly caching, but less likely)

It really seems strange and this isn't an issue we've heard from anyone else. Are you positive there's no other code page, like some old test code, that could be posting to your wall instead?

Hope that helps get you started, but really not sure where to go from here.

Thanks,
Alex
The topic has been locked.