add some info logs
This commit is contained in:
parent
8d9a348757
commit
ece975eb72
@ -242,11 +242,15 @@ class d3geoip extends BaseModel
|
|||||||
{
|
{
|
||||||
startProfile(__METHOD__);
|
startProfile(__METHOD__);
|
||||||
|
|
||||||
|
$this->_getModConfig()->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'start shop or url switch');
|
||||||
$this->performURLSwitch();
|
$this->performURLSwitch();
|
||||||
$this->performShopSwitch();
|
$this->performShopSwitch();
|
||||||
|
$this->_getModConfig()->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'end shop or url switch');
|
||||||
|
|
||||||
if (!$this->_getModConfig()->isActive()
|
if (!$this->_getModConfig()->isActive()
|
||||||
|| false == $this->_getModConfig()->getValue('blChangeLang')) {
|
|| false == $this->_getModConfig()->getValue('blChangeLang')
|
||||||
|
) {
|
||||||
|
$this->_getModConfig()->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'language change option or module is disabled');
|
||||||
stopProfile(__METHOD__);
|
stopProfile(__METHOD__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -259,16 +263,16 @@ class d3geoip extends BaseModel
|
|||||||
&& Registry::getSession()->getVariable('d3isSetLang') === null
|
&& Registry::getSession()->getVariable('d3isSetLang') === null
|
||||||
&& $oCountry->getId() && $oCountry->getFieldData('d3geoiplang') > -1
|
&& $oCountry->getId() && $oCountry->getFieldData('d3geoiplang') > -1
|
||||||
) {
|
) {
|
||||||
$this->_getLog()->log(
|
$language = (int) $oCountry->getFieldData('d3geoiplang');
|
||||||
d3log::INFO,
|
$this->_getModConfig()->info(
|
||||||
__CLASS__,
|
__CLASS__,
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
__LINE__,
|
__LINE__,
|
||||||
'set language',
|
'set language',
|
||||||
$this->getIP().' => '.$oCountry->getFieldData('d3geoiplang')
|
$this->getIP().' => '.$language
|
||||||
);
|
);
|
||||||
Registry::getLang()->setTplLanguage((int) $oCountry->getFieldData('d3geoiplang'));
|
Registry::getLang()->setTplLanguage($language);
|
||||||
Registry::getLang()->setBaseLanguage((int) $oCountry->getFieldData('d3geoiplang'));
|
Registry::getLang()->setBaseLanguage($language);
|
||||||
Registry::getSession()->setVariable('d3isSetLang', true);
|
Registry::getSession()->setVariable('d3isSetLang', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,6 +358,7 @@ class d3geoip extends BaseModel
|
|||||||
public function performShopSwitch()
|
public function performShopSwitch()
|
||||||
{
|
{
|
||||||
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeShop')) {
|
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeShop')) {
|
||||||
|
$this->_getModConfig()->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'shop change option or module is disabled');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,6 +367,8 @@ class d3geoip extends BaseModel
|
|||||||
$oCountry = $this->getUserLocationCountryObject();
|
$oCountry = $this->getUserLocationCountryObject();
|
||||||
$iNewShop = $oCountry->getFieldData('d3geoipshop');
|
$iNewShop = $oCountry->getFieldData('d3geoipshop');
|
||||||
|
|
||||||
|
$this->_getModConfig()->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'check allowed shop change');
|
||||||
|
|
||||||
if (Registry::getRequest()->getRequestEscapedParameter('d3redirect') != 1
|
if (Registry::getRequest()->getRequestEscapedParameter('d3redirect') != 1
|
||||||
&& false == $this->isAdmin()
|
&& false == $this->isAdmin()
|
||||||
&& Registry::getUtils()->isSearchEngine() === false
|
&& Registry::getUtils()->isSearchEngine() === false
|
||||||
@ -373,6 +380,8 @@ class d3geoip extends BaseModel
|
|||||||
|| strtolower(Registry::getConfig()->getActiveView()->getClassKey()) == 'mallstart'
|
|| strtolower(Registry::getConfig()->getActiveView()->getClassKey()) == 'mallstart'
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
$this->_getModConfig()->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'prepare shop change to '.$iNewShop);
|
||||||
|
|
||||||
$oNewConf = new Config();
|
$oNewConf = new Config();
|
||||||
$oNewConf->setShopId($iNewShop);
|
$oNewConf->setShopId($iNewShop);
|
||||||
$oNewConf->init();
|
$oNewConf->init();
|
||||||
@ -410,6 +419,8 @@ class d3geoip extends BaseModel
|
|||||||
$this->getIP().' => '.$sUrl
|
$this->getIP().' => '.$sUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->_getModConfig()->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'change to shop url', $sUrl);
|
||||||
|
|
||||||
header("Location: ".$sUrl);
|
header("Location: ".$sUrl);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,9 @@ class d3_oxcmp_lang_geoip extends d3_oxcmp_lang_geoip_parent
|
|||||||
if (d3_cfg_mod::get($this->_sModId)->isActive()) {
|
if (d3_cfg_mod::get($this->_sModId)->isActive()) {
|
||||||
/** @var $oLocation d3geoip */
|
/** @var $oLocation d3geoip */
|
||||||
$oLocation = oxNew(d3geoip::class);
|
$oLocation = oxNew(d3geoip::class);
|
||||||
|
d3_cfg_mod::get($this->_sModId)->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'start perform language switch');
|
||||||
$oLocation->setCountryLanguage();
|
$oLocation->setCountryLanguage();
|
||||||
|
d3_cfg_mod::get($this->_sModId)->d3getLog()->info(__CLASS__, __FUNCTION__, __LINE__, 'end perform language switch');
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::init();
|
parent::init();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user