bebeboutik/modules/invite/sponsor.php

38 lines
1.4 KiB
PHP
Raw Normal View History

2016-01-04 12:49:26 +01:00
<?php
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
if(($sponsor = Tools::getValue('sponsor')) && strlen($sponsor) > 12) {
2017-03-08 16:10:35 +01:00
2016-01-04 12:49:26 +01:00
setcookie('554b43403edef30d31412286d5098965', $sponsor, time() + 3600 * 24 * 365, '/', '.bebeboutik.com');
2017-03-08 16:10:35 +01:00
2016-01-04 12:49:26 +01:00
$email = base64_decode(strrev(substr($sponsor, 12)));
if(count(Db::getInstance()->ExecuteS('
SELECT `id_customer`
FROM `'._DB_PREFIX_.'customer`
WHERE `email` = "'.pSQL($email).'"
')) > 0) {
if(Configuration::get('PS_CIPHER_ALGORITHM')) {
$cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
} else {
$cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
}
$url = parse_url($_SERVER['REQUEST_URI']);
2017-05-04 16:35:10 +02:00
if(Tools::getIsset('lpes')) {
$lp = Tools::getValue('lpes');
2017-05-04 16:49:50 +02:00
if( _THEME_NAME_ !== 'site_mobile') {
Tools::redirect('?sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($lp)? '&lpes='.$lp: ''));
}
2017-05-04 16:35:10 +02:00
}
2016-01-04 12:49:26 +01:00
if(Tools::getIsset('lp')) {
$lp = Tools::getValue('lp');
}
2017-03-09 11:00:20 +01:00
Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: ''));
2016-01-04 12:49:26 +01:00
// Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: ''));
}
}
Tools::redirect();