/**
  * getConfiguration() method set all constant module in ps_configuration
  *
  * @param int $iShopId
  */
 public static function getConfiguration($iShopId = null)
 {
     // get configuration options
     if (null !== $iShopId && is_numeric($iShopId)) {
         FacebookPsConnect::$aConfiguration = Configuration::getMultiple(array_keys($GLOBALS[_FPC_MODULE_NAME . '_CONFIGURATION']), null, null, $iShopId);
     } else {
         FacebookPsConnect::$aConfiguration = Configuration::getMultiple(array_keys($GLOBALS[_FPC_MODULE_NAME . '_CONFIGURATION']));
     }
 }
<?php

/**
 * google-callback.php file execute module for Front Office
 * @author Business Tech (www.businesstech.fr) - Contact: http://www.businesstech.fr/en/contact-us
 * @category ws collection
 * @license Business Tech
 * @uses Please read included installation and configuration instructions (PDF format)
 */
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/facebookpsconnect.php';
// instantiate
$oModule = new FacebookPsConnect();
// execute google connector
echo $oModule->HookConnectorCallback(array('connector' => 'google', 'activecallback' => true, 'code' => Tools::getValue('code')));
<?php

/**
 * facebook-callback.php file execute module for Front Office
 * @author Business Tech (www.businesstech.fr) - Contact: http://www.businesstech.fr/en/contact-us
 * @category ws collection
 * @license Business Tech
 * @uses Please read included installation and configuration instructions (PDF format)
 */
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/facebookpsconnect.php';
// instantiate
$oModule = new FacebookPsConnect();
// execute facebook connector
echo $oModule->HookConnectorCallback(array('connector' => 'facebook', 'activecallback' => true, 'code' => Tools::getValue('code'), 'state' => Tools::getValue('state')));
<?php

/**
 * twitter-callback.php file execute module for Front Office
 * @author Business Tech (www.businesstech.fr) - Contact: http://www.businesstech.fr/en/contact-us
 * @category ws collection
 * @license Business Tech
 * @uses Please read included installation and configuration instructions (PDF format)
 */
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/facebookpsconnect.php';
// instantiate
$oModule = new FacebookPsConnect();
// execute twitter connector
echo $oModule->HookConnectorCallback(array('connector' => 'twitter', 'activecallback' => true, 'oauth_token' => Tools::getValue('oauth_token'), 'oauth_verifier' => Tools::getValue('oauth_verifier')));
/**
 * ws-facebookpsconnect.php file execute module for Front Office
 * @author Business Tech (www.businesstech.fr) - Contact: http://www.businesstech.fr/en/contact-us
 * @category ws collection
 * @license Business Tech
 * @uses Please read included installation and configuration instructions (PDF format)
 */
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/facebookpsconnect.php';
// get type of content to display
$sAction = Tools::getIsset('sAction') ? Tools::getValue('sAction') : '';
$sType = Tools::getIsset('sType') ? Tools::getValue('sType') : '';
$sUseCase = $sAction . $sType;
// instantiate
$oModule = new FacebookPsConnect();
switch ($sUseCase) {
    case 'connectplugin':
        // exec matched connector
        echo $oModule->HookConnectorConnect(array_merge($_GET, $_POST));
        break;
        //    case 'cltscl' : // collect social data from widget
        //        if (!empty($_POST['cn'])
        //                &&
        //            array_key_exists(base64_decode($_POST['cn']), $GLOBALS[_FPC_MODULE_NAME . '_CONNECTORS'])
        //        ) {
        //            // collect FB data
        //            echo $oModule->HookSocialCollector(base64_decode($_POST['cn']), $_POST);
        //        }
        //        break;
    //    case 'cltscl' : // collect social data from widget
示例#6
0
<?php

/**
* cron.php file execute
* @author Business Tech (www.businesstech.fr) - Contact: http://www.businesstech.fr/en/contact-us
* @category cron collection
* @license Business Tech
* @uses Please read included installation and configuration instructions (PDF format)
*/
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/facebookpsconnect.php';
$oModule = new FacebookPsConnect();
// use case - send action
$_POST['sAction'] = 'send';
// email type
$_POST['sType'] = 'callback';
echo $oModule->getContent();
 /**
  * Magic Method __construct assigns few information about module and instantiate parent class
  * @author Business Tech (www.businesstech.fr) - Contact: http://www.businesstech.fr/en/contact-us
  */
 public function __construct()
 {
     // hack for older version than 1 4 5 1
     if (is_file(dirname(__FILE__) . '/conf/common.conf.php')) {
         require_once dirname(__FILE__) . '/conf/common.conf.php';
     } else {
         require_once _PS_MODULE_DIR_ . 'facebookpsconnect/conf/common.conf.php';
     }
     require_once _FPC_PATH_LIB . 'warning_class.php';
     require_once _FPC_PATH_LIB . 'module-tools_class.php';
     // use case - get context
     if (version_compare(_PS_VERSION_, '1.5', '>')) {
         self::$iShopId = Context::getContext()->shop->id;
     }
     // get current lang
     self::$iCurrentLang = BT_FPCModuleTools::getCookieObj()->id_lang;
     // get current iso lang
     self::$sCurrentLang = BT_FPCModuleTools::getLangIso();
     // get cookie obj
     self::$oCookie = BT_FPCModuleTools::getCookieObj();
     $this->name = 'facebookpsconnect';
     $this->module_key = 'ffcbc0b08d66e0afb7ed1ed27e0f1492';
     $this->tab = 'social_networks';
     $this->version = '1.5.5';
     $this->author = 'Business Tech';
     $this->need_instance = 0;
     parent::__construct();
     $this->displayName = $this->l('Facebook PS Connect');
     $this->description = $this->l('Let your customer easily log in via Facebook, Paypal, Google or Twitter');
     $this->confirmUninstall = $this->l('Are you sure you want to remove it ? Your Facebook PS Connect will no longer work. Be careful, all your configuration and your data will be lost');
     // stock itself obj
     self::$oModule = $this;
     // update module version
     $GLOBALS[_FPC_MODULE_NAME . '_CONFIGURATION'][_FPC_MODULE_NAME . '_MODULE_VERSION'] = $this->version;
     // set base of URI
     self::$sBASE_URI = $this->_path;
     // set title of hooks & connectors
     $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['header']['title'] = $this->l('Header');
     $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['top']['title'] = $this->l('Top');
     $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['account']['title'] = $this->l('Customer account');
     $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['left']['title'] = $this->l('Left Column');
     $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['right']['title'] = $this->l('Right Column');
     $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['footer']['title'] = $this->l('Footer');
     $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['authentication']['title'] = $this->l('Authentication page');
     $GLOBALS[_FPC_MODULE_NAME . '_CONNECTORS']['facebook']['title'] = $this->l('Facebook sign in');
     $GLOBALS[_FPC_MODULE_NAME . '_CONNECTORS']['twitter']['title'] = $this->l('Twitter sign in');
     $GLOBALS[_FPC_MODULE_NAME . '_CONNECTORS']['google']['title'] = $this->l('Google sign in');
     $GLOBALS[_FPC_MODULE_NAME . '_CONNECTORS']['paypal']['title'] = $this->l('Paypal sign in');
     if (version_compare(_PS_VERSION_, '1.6.0', '<')) {
         $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['right']['title'] = $this->l('Right Column');
         $GLOBALS[_FPC_MODULE_NAME . '_ZONE']['blockUser']['title'] = $this->l('Block Info User');
     }
     // get configuration options
     BT_FPCModuleTools::getConfiguration();
     // get call mode - Ajax or dynamic - used for clean headers and footer in ajax request
     self::$sQueryMode = Tools::getValue('sMode');
 }
 /**
  * _displayCurlSsl() method displays result test Curl with Ssl
  *  Set Global for Test the result Curl SSL
  *
  * @category admin collection
  * @see
  *
  * @param array $aPost
  * @return array
  */
 private function _displayCurlSsl(array $aPost)
 {
     //set
     $aAssign = array();
     //clean header
     @ob_end_clean();
     //init curl connexion
     $ch = curl_init('https://google.fr');
     //transfer test
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     // exec curl
     curl_exec($ch);
     // error test and set error message
     if (curl_errno($ch) == 1) {
         $aAssign['iCurlSslCheck'] = false;
         Configuration::updateValue(_FPC_MODULE_NAME . '_TEST_CURl_SSL', 1);
     } else {
         $aAssign['iCurlSslCheck'] = true;
         Configuration::updateValue(_FPC_MODULE_NAME . '_TEST_CURl_SSL', 2);
         Configuration::updateValue(_FPC_MODULE_NAME . '_SSL_TEST_TODO', 0);
     }
     //close curl connexion
     curl_close($ch);
     //clean footer
     FacebookPsConnect::$sQueryMode = 'xhr';
     return array('tpl' => _FPC_TPL_ADMIN_PATH . _FPC_TPL_CURL_SSL, 'assign' => $aAssign);
 }
<?php

/**
 * paypal-callback.php file execute module for Front Office
 */
require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/facebookpsconnect.php';
// instantiate
$oModule = new FacebookPsConnect();
// execute paypal connector
echo $oModule->HookConnectorCallback(array('connector' => 'paypal', 'activecallback' => true, 'code' => Tools::getValue('code'), 'access_token' => Tools::getValue('access_token')));