Merge remote-tracking branch 'origin/ticket/r15224-balises'

This commit is contained in:
Michael RICOIS 2018-01-15 09:24:39 +01:00
commit a018ea7833

View File

@ -22,41 +22,54 @@ if(($sponsor = Tools::getValue('sponsor')) && strlen($sponsor) > 12) {
$cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
}
$url = parse_url($_SERVER['REQUEST_URI']);
$gclid = Tools::getIsset('gclid')?'&gclid='.Tools::getValue('gclid'):'';
/**
* @Override Antadis - Module ant_trackingtag
*/
if(!class_exists('AntTrackingTag')){
if (!class_exists('AntTrackingTag')){
require_once(_PS_MODULE_DIR_.'/ant_trackingtag/models/AntTrackingTag.php');
}
$tags = AntTrackingTag::getTags();
$url_tag ='';
foreach ($tags as $tag) {
if(Tools::getIsset($tag['tag'])) {
$value = Tools::getValue($tag['tag']);
$url_tag .='&'.$tag['tag'].'='.$value;
if (count($tags) > 0) {
foreach ($tags as $tag) {
if(Tools::getIsset($tag['tag'])) {
$value = Tools::getValue($tag['tag']);
$url_tag .='&'.$tag['tag'].'='.$value;
}
}
}
/* @End Override */
if(Tools::getIsset('lpes')) {
if (Tools::getIsset('lpes')) {
$lp = Tools::getValue('lpes');
if( _THEME_NAME_ !== 'site_mobile') {
if(_THEME_NAME_ !== 'site_mobile') {
Tools::redirect('?sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).
(isset($lp)? '&lpes='.$lp: '').$url_tag.$gclid);
}
}
if(Tools::getIsset('lp')) {
if (Tools::getIsset('lp')) {
$lp = Tools::getValue('lp');
}
$query = '';
if (count($_REQUEST) > 0) {
foreach($_REQUEST as $k => $v) {
if ($k == 'sponsor') {
continue;
}
if ($k == 'lp') {
continue;
}
$query = '&'.$k.'='.$v;
}
}
Tools::redirectLink($link->getPageLink('authentication.php').
'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).
(isset($url['query'])? '&'.$url['query']: '').
(isset($lp)? '&lp='.$lp: '').$url_tag.$gclid);
$query.(isset($lp)? '&lp='.$lp: '').$url_tag.$gclid);
}
}