class JLinkedApiLibraryX extends JLinkedApiLibrary
{
// Override model's getInstance to really only get the instance
protected $configModel;
protected $memberId;
protected $mappedFbUserId;
protected $retryCount = 0;
protected $timestampOffset = null;
private static $libraryInstance;
public static function getInstance($returl)
{
if (!isset(self::$libraryInstance))
{
self::$libraryInstance = new JLinkedApiLibraryX($returl);
// After the instance is grabbed, get the Javascript code to insert
// Don't do this in the constructor as inititing the Javascript calls functions which need
// this very instance
$app = JFactory::getApplication();
if (!$app->isAdmin())
{
// Set whether, on this page load, the user should be checked for a new mapping (i.e. they were just on the login/register page)
$session = JFactory::getSession();
$checkNewMapping = $session->get('jLinkedCheckNewMapping', false);
self::$libraryInstance->checkNewMapping = $checkNewMapping;
}
}
return self::$libraryInstance;
}
function __construct($returl)
{
$this->getConfigModel();
$this->setTimestampOffset($this->configModel->getSetting('linkedin_oauth_timestamp_offset'));
$this->findLocalAccessToken(); // Search for an access token and set it
$return = ''; $menuItemId = 0;
SCSocialUtilities::getCurrentReturnParameter($return, $menuItemId, LOGIN_TASK_JLINKED);
$linkedInApiKey = $this->configModel->getSetting('linkedin_api_key');
$linkedInSecretKey = $this->configModel->getSetting('linkedin_secret_key');
$callbackUrl = $returl;
if (!$callbackUrl) $callbackUrl = JURI::root() . 'index.php?option=com_jlinked&task=linkedInCallback&return='.base64_encode($return);
$config = array('appKey' => $linkedInApiKey, 'appSecret' => $linkedInSecretKey, 'callbackUrl' => $callbackUrl);
parent::__construct($config);
}
}
Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.