Example #1
0
 public static function autofillListing($aAutofillData)
 {
     if (self::getNetwork() && SJB_Settings::getSettingByName(self::getNetwork() . '_resumeAutoFillSync') && !$aAutofillData['formSubmitted'] && 'Resume' == $aAutofillData['listingTypeID'] && isset($_REQUEST['autofill'])) {
         self::$isSyncAllowed = true;
         if (self::$oSocialPlugin instanceof SJB_SocialPlugin) {
             self::$oSocialPlugin->fillRequestOutSocialData($_REQUEST);
         }
         unset($_REQUEST['autofill']);
     }
 }
 private function getProfileInformation()
 {
     if (!$this->takeDataFromServer && ($oCurUser = SJB_UserManager::getCurrentUser())) {
         $curUserSID = $oCurUser->getSID();
         $profileSocialID = self::getProfileSocialID($curUserSID);
         if ($profileSocialID) {
             $aProfExpl = explode($this->getNetwork() . '_', $profileSocialID);
             $linkedinID = $aProfExpl[1];
             $profileSocialInfo = $this->getProfileSocialSavedInfoBySocialID($linkedinID);
             if ($profileSocialInfo) {
                 self::$oProfile = $profileSocialInfo['profile_info'];
                 self::$oSocialPlugin = $this;
                 if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
                     SJB_HelperFunctions::debugInfoPush(self::$oProfile, 'SOCIAL_PLUGIN');
                 }
                 return true;
             }
         }
     }
     if (self::$object) {
         try {
             $response = self::$object->getProfileInfo($this->requestedProfileFields);
             if ($response) {
                 self::$oProfile = new SimpleXMLElement($response);
                 self::$oSocialPlugin = $this;
                 if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
                     SJB_HelperFunctions::debugInfoPush(self::$oProfile, 'SOCIAL_PLUGIN');
                 }
                 return true;
             }
         } catch (Exception $ex) {
             // revocation successful, clear session
             unset($_SESSION['oauth'][self::NETWORK_ID]);
             $this->cleanSessionData(self::NETWORK_ID);
             if (SJB_HelperFunctions::debugModeIsTurnedOn()) {
                 $debug = "Error retrieving profile information:\n\nRESPONSE:\n\n<pre>" . print_r($ex->getMessage()) . "</pre>";
                 SJB_HelperFunctions::debugInfoPush($debug, 'SOCIAL_PLUGINS');
             }
         }
     }
     return null;
 }
Example #3
0
<?php

if (!extension_loaded('openssl')) {
    $GLOBALS[SJB_SocialPlugin::SOCIAL_ACCESS_ERROR]['SOCIAL_ACCESS_ERROR'] = 'linkedin';
    SJB_Error::writeToLog('Linkedin Social Plugin needs the "openssl" PHP extension.');
    return null;
}
require_once 'linkedin_social_plugin.php';
SJB_SocialPlugin::loadPlugin('linkedin', new LinkedinSocialPlugin());
if (LinkedinSocialPlugin::getNetwork() === SJB_SocialPlugin::getNetwork()) {
    SJB_Event::handle('Login_Plugin', array('SJB_SocialPlugin', 'login'));
    SJB_Event::handle('Logout', array('SJB_SocialPlugin', 'logout'), 1000);
    /*
     * REGISTRATION
     */
    SJB_Event::handle('FillRegistrationData_Plugin', array('SJB_SocialPlugin', 'fillRegistrationDataWithUser'));
    SJB_Event::handle('PrepareRegistrationFields_SocialPlugin', array('SJB_SocialPlugin', 'prepareRegistrationFields'));
    SJB_Event::handle('MakeRegistrationFieldsNotRequired_SocialPlugin', array('LinkedinSocialPlugin', 'makeRegistrationFieldsNotRequired'));
    SJB_Event::handle('SocialPlugin_AddListingFieldsIntoRegistration', array('SJB_SocialPlugin', 'addListingFieldsIntoRegistration'));
    SJB_Event::handle('AddReferencePluginDetails', array('SJB_SocialPlugin', 'addReferenceDetails'));
    /*
     * LISTING AUTOFILL SYNCHRONIZATION
     */
    SJB_Event::handle('SocialSynchronization', array('SJB_SocialPlugin', 'autofillListing'));
    SJB_Event::handle('SocialSynchronizationForm', array('SJB_SocialPlugin', 'autofillListingForm'));
    SJB_Event::handle('SocialSynchronizationFields', array('SJB_SocialPlugin', 'autofillListingFields'));
    SJB_Event::handle('SocialSynchronizationFieldsOnPostingPages', array('SJB_SocialPlugin', 'autofillListingFieldsOnPostingPages'));
}