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