diff --git a/controllers/index.php b/controllers/index.php new file mode 100644 index 0000000..ee174a0 --- /dev/null +++ b/controllers/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2020 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/index.php b/index.php new file mode 100644 index 0000000..843da06 --- /dev/null +++ b/index.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2020 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..e91a4b5 Binary files /dev/null and b/logo.png differ diff --git a/seers.php b/seers.php new file mode 100644 index 0000000..0ab234c --- /dev/null +++ b/seers.php @@ -0,0 +1,151 @@ + + * @copyright 2007-2020 PrestaShop SA + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * International Registered Trademark & Property of PrestaShop SA + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +class Seers extends Module +{ + public $apisecrekkey = '$2y$10$9ygTfodVBVM0XVCdyzEUK.0FIuLnJT0D42sIE6dIu9r/KY3XaXXyS'; + public function __construct() + { + $this->module_key = 'bf95963c818431a4778551a826a12f86'; + $this->name = 'seers'; + $this->tab = 'analytics_stats'; + $this->author = 'Nick Spencer'; + $this->version='1.0.0'; + $this->bootstrap=true; + $this->ps_versions_compliancy = array('min' => '1.6.0.0', 'max' => '1.7.99.99'); + parent::__construct(); + $this->displayName = $this->l('Seers Cookie Consent Banner and Privacy Policy'); + $this->description= $this->l('Seers cookie consent management platform is trusted by thousands of businesses. Become GDPR, CCPA, ePrivacy and LGPD compliant in three clicks.'); + $this->confirmUninstall = $this->l('Are you sure you want to delete these details?'); + } + + public function install() + { + $this->plugin_active_inactive(1); + return parent::install() && $this->registerHook('displayHeader'); + } + + public function disable() + { + $this->plugin_active_inactive(0); + return true; + } + + public function uninstall() + { + if (! parent::uninstall()) { + return false; + } + + $this->plugin_active_inactive(0); + return true; + } + + public function hookDisplayHeader() + { + //adding css + /* + $this->context->controller->addCSS(array( + $this->_path.'views/css/seers.css' + )); + + // adding JS + $this->context->controller->addJS(array( + $this->_path.'views/js/seers.js' + )); + */ + $ID = Configuration::get('SEERSGROUPID'); + if ($ID !== '') { + return ''; + } + return $ID; + } + + public function getContent() + { + $output = ''; + + if (Tools::isSubmit('saveseers')) { + + $name = strval(Tools::getValue('print')); + if (!empty($name)) { + Configuration::updateValue('SEERSGROUPID', $name); + $output .= $this->displayConfirmation( $this->l('SEERS Group ID updated successfully')); + } else { + $output .= $this->displayError( $this->l('SEERS Group ID update unsuccessful')); + } + + + } + $this->context->smarty->assign(array('SEERSGROUPID' => Configuration::get('SEERSGROUPID'))); + return $output . $this->display(__FILE__, 'views/templates/admin/configure.tpl'); + } + + public function plugin_active_inactive($isative = 0){ + $postData = array( + 'domain' => ((Configuration::get('PS_SSL_ENABLED')) ? Configuration::get('PS_SHOP_DOMAIN_SSL') : Configuration::get('PS_SHOP_DOMAIN') ), + 'isactive' => $isative, + 'secret' => $this->apisecrekkey, + 'platform' => 'prestashop', + 'pluginname' => $this->displayName + ); + $request_headers = array( + 'Content-Type' => 'application/json', + 'Referer' => ((Configuration::get('PS_SSL_ENABLED')) ? Configuration::get('PS_SHOP_DOMAIN_SSL') : Configuration::get('PS_SHOP_DOMAIN') ), + ); + //$url = "https://seersco.backend/api/plugin-domain"; + $url = "https://cmp.seersco.com/api/plugin-domain"; + $curl = curl_init(); + + curl_setopt_array($curl, array( + CURLOPT_URL => $url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_CUSTOMREQUEST => "POST", + CURLOPT_HTTPHEADER => $request_headers, + CURLOPT_POSTFIELDS => $postData + )); + + $response = curl_exec($curl); + $error_number = curl_errno($curl); + $error_message = curl_error($curl); + curl_close($curl); + + $response =json_decode($response, TRUE); + + return $response; + } +} diff --git a/sql/index.php b/sql/index.php new file mode 100644 index 0000000..ee174a0 --- /dev/null +++ b/sql/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2020 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/index.php b/views/index.php new file mode 100644 index 0000000..ee174a0 --- /dev/null +++ b/views/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2020 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/templates/admin/configure.tpl b/views/templates/admin/configure.tpl new file mode 100644 index 0000000..e133652 --- /dev/null +++ b/views/templates/admin/configure.tpl @@ -0,0 +1,43 @@ +{* +* 2007-2020 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2022 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} +
+
+
+ {l s='configuration' mod='seers'} +
+
+ + +
+ + +
+
\ No newline at end of file diff --git a/views/templates/admin/index.php b/views/templates/admin/index.php new file mode 100644 index 0000000..843da06 --- /dev/null +++ b/views/templates/admin/index.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2020 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/views/templates/index.php b/views/templates/index.php new file mode 100644 index 0000000..843da06 --- /dev/null +++ b/views/templates/index.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2020 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit;