/** * 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); }