8
0
Fork 0

add some info logs

Dieser Commit ist enthalten in:
Daniel Seifert 2022-10-13 08:41:09 +02:00
Ursprung 2117dfbf68
Commit 9a2f436bd3
Signiert von: DanielS
GPG-Schlüssel-ID: 8A7C4C6ED1915C6F
2 geänderte Dateien mit 19 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -252,11 +252,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;
} }
@ -269,16 +273,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);
} }
@ -364,6 +368,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;
} }
@ -372,6 +377,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
@ -383,6 +390,8 @@ class d3geoip extends BaseModel
|| strtolower($this->getConfig()->getActiveView()->getClassKey()) == 'mallstart' || strtolower($this->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();
@ -420,6 +429,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();
} }

Datei anzeigen

@ -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();