Topic-icon JFBCSystem plugin not enabled, but it's enabled.

Active Subscriptions:

None
6 years 2 months ago #63382 by davren
Hi I renewed my subscription, and I have a problem with Jfbconnect on this site:

www.glansbeton.be/

When I do autotune:
Site Configuration
This section of AutoTune will check your Joomla site configuration for common issues and help ensure JFBConnect is ready for operation.
Configuration Check
No issues found!
Plugin Check
The following plugins were installed with JFBConnect, and should be enabled for proper operation of JFBConnect:
Plugin
Status
Description
JFBCSystem 
 Published
Required for all functions of JFBConnect. Should always be enabled.
JFBCAuthentication 
 Published
Required for authentication. Publish if you want users to be able to login using social networks.
JFBCUser 
 Published
Required for authentication. Publish if you want users to be able to login using social networks.
JFBCContent 
 Published
Publish to automatically add social buttons and comment boxes to content.

And when I do Error Check:
Checks performed on: https://www.glansbeton.be/ 
Warning: Issues were found with your site. Please check all tests below and correct any warnings or errors.
Test: JFBCSystem plugin is enabled
Fail: Not Detected! Please enable in the Site Config area of Autotune or in the Joomla plugin manager. 

If the JFBCSystem plugin is enabled, but you still get this error, please check:
Your site is not in Offline Mode. If so, turn your site Online and re-run the Error Checker.
If you have a 'mobile template', disable it and re-test
Some templates have their own Facebook integration, and actively try to remove other Facebook extensions files. Try a different template.

No further tests can be run until fixed.
The topic has been locked.
Support Specialist
6 years 2 months ago #63385 by alzander
Your site is using JCH Optimize which compresses and changes the Javascript quite a bit. That's not a bad thing, but it prevents our automated tool from properly scanning your page.

I just manually checked the things that the Error Check tool normally would and I can't see any issues on your site. If you're experiencing functional problems, please let us know what they are and we'll gladly help you fix those.

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

None
6 years 2 months ago - 6 years 2 months ago #63404 by davren
Hi Alexander,

Thanks for you're fast reply. I disabled JCH optimize and I tryed to login with Facebook, this is not possible.

Please check you're self:

www.glansbeton.be

there are also a lot of errors like this one:
AH01071: Got error 'PHP message: PHP Parse error:  syntax error, unexpected '[', expecting ')' in /***/www/components/com_jfbconnect/libraries/profile/yahoo.php on line 60\n'
Last edit: 6 years 2 months ago by davren.
The topic has been locked.
Support Specialist
6 years 2 months ago #63410 by alzander
We're looking at an authentication issue that is occurring with Joomla 3.8.4 and some social networks. That may be the cause of Facebook failing on your site.

However, the Yahoo error is strange and not one we've heard of. The block of code at line 60 in the file noted should look like:
$openid_data = array_intersect_key(
                            $payload_array,
                            array_flip([       <------------ This is line 60
                                'given_name',
                                'family_name',
                                'birthdate',
                                'email',
                                'email_verified',
                                'locale'
                            ])
                        );
Can you open that file and verify you have a similar block of code in your file? If so, please make sure there aren't any strange characters or anything else out of the ordinary in that file. If that checks out, please let us know what version of Joomla and PHP you are using so we can investigate that issue further.

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

None
6 years 2 months ago #63411 by davren
Hello,
Thanks for you're fast reply on a sunday evening.

If you try to login in FB on www.glansbeton.be you can see this error
Beschadigde-inhoudsfout

De website op https://www.glansbeton.be/index.php?option=com_jfbconnect&task=authenticate.callback&provider=facebook&code=AQDYfViRcpfaVTiGa8zRaWOL93aXFQ27h_7pzVxKcTVdrUxaKGXyjvnKknCydZ--FR-7D0NVQcOQawMG7ztqGJE22HEl9BSKCJFXrSEjxRAqluFLxryfgLJs-s2dtYlaO7EoN8Axa7cLNMR-ctTThroA1wmHfTNezW7iBIh-o_eD5IYZZIu3D9EvQX6aiP_V65aoTuXANYVR7wNM3zDyc4ZIvypX9fKeBCUYGQI1gKqRn6ONqTxrJJX6P-Fu0PxVnmzNFpoRKsoSi8FDd0173mua4xw-6h2WiCa_HuoDlsPS4ixzNF8uaESvUGPMGST6272OgHlKBDq0Z9liziAFHwafrI-ywtdbRtui1jZmdtAp8A&state=c2dbf58432563ac66dcca726128a31df#_=_ ondervond een schending van het netwerkprotocol die niet kan worden verholpen.

De pagina die u wilt bekijken kan niet worden weergegeven, omdat er een fout in de gegevensoverdracht is gedetecteerd.

    Neem contact op met de website-eigenaars om ze over dit probleem te informeren.

IMHO there is no problem with the yahoo file I have, but the errors are real in my error log.
I will leave you my code of the yahoo.php file, so you can check it you're own.

<?php
/**
 * @package		 JFBConnect
 * @copyright (c)   2009-2018 by SourceCoast - All Rights Reserved
 * @license		 http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version         Release v7.2.3
 * @build-date      2017/12/29
 */

// Check to ensure this file is included in Joomla!
if (!(defined('_JEXEC') || defined('ABSPATH'))) {	 die('Restricted access'); };

// Probably should work toward extending the JFBConnectFacebookLibrary for this class.
// Too much intertwined in the root library right now.
class JFBConnectProfileYahoo extends JFBConnectProfile
{
	protected function setProviderFields()
	{
		$this->providerFields = array(
			'0'				=> 'None',
			'familyName'	=> 'Family Name',
			'givenName'		=> 'Given Name',
			'nickname'		=> 'Nickname',
			'message'		=> 'Message',
			'aboutMe'		=> 'About Me',
            'gender'        => 'Gender',
            'location' => 'Location',
            'profileUrl'    => 'Profile URL',
            'email'         => 'Email',
            'lang'          => 'Locale'
		);
	}


	public function fetchProfile($userId, $fields = NULL)
	{
		$profile = new JFBConnectProfileDataYahoo();
		
		try
		{
			$url = 'https://social.yahooapis.com/v1/user/'.$userId.'/profile';
			$query = $this->provider->client->query($url);
			$xml = JFactory::getXML($query->body, false);
			$data = json_decode(json_encode($xml),TRUE);
			
			if (is_array($data))
			{
				if ($userId != "me")
				{
					$access_token = $this->provider->client->getToken();
                    //Retrieve data from OpenID Connect
                    //To retrieve email, email_verified => app uses extended profile scope sdpp-w, so will not be returned if app does not have it set
					if(isset($access_token['id_token']))
					{
                        $id_token_array = explode(".", $access_token['id_token']);
                        $payload_json = base64_decode($id_token_array[1]);
                        $payload_array = json_decode($payload_json, TRUE);
                        $openid_data = array_intersect_key(
                            $payload_array,
                            array_flip([
                                'given_name',
                                'family_name',
                                'birthdate',
                                'email',
                                'email_verified',
                                'locale'
                            ])
                        );

                        if(!empty($openid_data)) //Depending on YDN App OAuth version / scope, this data may not be returned
                        {
                            $openid_data['givenName'] = $openid_data['given_name'];
                            unset($openid_data['given_name']);

                            $openid_data['familyName'] = $openid_data['family_name'];
                            unset($openid_data['family_name']);

                            $openid_data['lang'] = $openid_data['locale'];
                            unset($openid_data['locale']);
                        }

                        $temp_data = $data;
                        $data = array_merge($temp_data, $openid_data);
					}
				}
				$profile->loadObject($data);
			}
		}
		catch (Exception $e)
		{
			if (JFBCFactory::config()->get('facebook_display_errors'))
			{
				JFBCFactory::log($e->getMessage());
			}
		}
		return $profile;
	}
	
	public function fetchStatus($userId)
	{
		// Return status from provider if available or NULL if not.
		return NULL;
	}


	// nullForDefault - If the avatar is the default image for the social network, return null instead
	// Prevents the default avatars from being imported
	function getAvatarUrl($userId, $nullForDefault = true, $params = null)
	{
		$nullString = $nullForDefault ? 'null' : 'notnull';
		$avatarUrl = JFBCFactory::cache()->get('yahoo.avatar.' . $nullString . '.' . $userId);
		if ($avatarUrl === false)
		{
			$profile = $this->fetchProfile($userId);
			$image = $profile->get('image', null);
			$avatarUrl = $image->imageUrl;
			if ($nullForDefault && (!$avatarUrl || strpos($avatarUrl, 'https://s.yimg.com/dg/users')))
			{
				$avatarUrl = null;
			}
			JFBCFactory::cache()->store($avatarUrl, 'yahoo.avatar.' . $nullString . '.' . $userId);
		}
		return $avatarUrl;
	}

	function getProfileUrl($userId)
	{
		$profile =  $this->fetchProfile($userId);
		return $profile->get('profileUrl', 'https://profile.yahoo.com/'.$userId);
	}

}

class JFBConnectProfileDataYahoo extends JFBConnectProfileData
{
	public function get($path, $default = NULL)
	{
		switch (strtolower($path)) {
            case 'email':
                $data = parent::get('emails.handle', $default);
                break;
            case 'name':
			case 'full_name':
				$data = parent::get('givenName', $default) . ' ' . parent::get('familyName', $default);
				break;
			case 'first_name':
			case 'given_name':
				$data = parent::get('givenName', $default);
				break;
			case 'surname':
			case 'last_name':
			case 'family_name':
				$data = parent::get('familyName', $default);
				break;
			case 'profile_url':
				$data = parent::get('profileUrl', $default);
				break;
			default:
				if ($this->exists($path))
				{
					$data = parent::get($path, $default);
				}
				else
				{
					$data = NULL;
				}
		}

		if (!is_null($data))
		{
			// format or manipulate the data as necessary here
			return $data;
		}
		else
		{		
			return $default;
		}
	}

}
The topic has been locked.