add encoding instructions, documentation refreshed, IPv6 support added

This commit is contained in:
Daniel Seifert 2013-04-22 09:48:59 +00:00
parent 5106a4ec0b
commit 3a656aa284
35 changed files with 393070 additions and 163654 deletions

28
.gitattributes vendored
View File

@ -1,5 +1,6 @@
* text=auto !eol
/Doxyfile -text
copy_this/.noencode -text
copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset.php -text
copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset_licence.php -text
copy_this/modules/d3/d3geoip/controllers/admin/d3_cfg_geoipset_list.php -text
@ -17,18 +18,23 @@ copy_this/modules/d3/d3geoip/views/admin/tpl/d3_cfg_geoipset_main.tpl -text
copy_this/modules/d3/d3geoip/views/admin/tpl/d3_country_geoip.tpl -text
setup+doku/Installation.pdf -text
setup+doku/d3precheck.php -text
setup+doku/geoip-Data_2011-10-13.sql -text
setup+doku/geoip-Data_IPv4_2013-04-18.sql -text
setup+doku/geoip-Data_IPv6_2013-04-18.sql -text
setup+doku/geoip-Struktur.sql -text
setup+doku/geoip_data_parts/1.sql -text
setup+doku/geoip_data_parts/2.sql -text
setup+doku/geoip_data_parts/3.sql -text
setup+doku/geoip_data_parts/4.sql -text
setup+doku/geoip_data_parts/5.sql -text
setup+doku/geoip_data_parts/6.sql -text
setup+doku/geoip_data_parts/7.sql -text
setup+doku/geoip_data_parts/8.sql -text
setup+doku/geoip_data_parts/IPv4_1.sql -text
setup+doku/geoip_data_parts/IPv4_2.sql -text
setup+doku/geoip_data_parts/IPv4_3.sql -text
setup+doku/geoip_data_parts/IPv4_4.sql -text
setup+doku/geoip_data_parts/IPv4_5.sql -text
setup+doku/geoip_data_parts/IPv4_6.sql -text
setup+doku/geoip_data_parts/IPv4_7.sql -text
setup+doku/geoip_data_parts/IPv4_8.sql -text
setup+doku/geoip_data_parts/IPv6_1.sql -text
setup+doku/geoip_data_parts/IPv6_2.sql -text
setup+doku/licence.txt -text
sources/CSVtoSQLconvert_perl.zip -text
sources/CSVtoSQLconvert_perl/geoip_V6.csv -text
sources/CSVtoSQLconvert_perl/geoip_v4.csv -text
sources/CSVtoSQLconvert_perl/test.pl -text
sources/DevReferences/html/annotated.html -text
sources/DevReferences/html/bc_s.png -text
sources/DevReferences/html/classd3__cfg__geoipset.html -text
@ -103,7 +109,5 @@ sources/Doku/Drucken[!!-~]-[!!-~]MaxMind[!!-~]Forum[!!-~]•[!!-~]View[!!-~]topi
sources/Doku/Drucken[!!-~]-[!!-~]On[!!-~]efficiently[!!-~]geo-referencing[!!-~]IPs[!!-~]with[!!-~]MaxMind[!!-~]GeoIP[!!-~]and[!!-~]MySQL[!!-~]GIS[!!-~]«[!!-~]Jeremy[!!-~]Cole.pdf -text svneol=unset#unset
sources/Doku/Drucken[!!-~]-[!!-~]Vincent[!!-~]de[!!-~]Lau_[!!-~]HOW-TO[!!-~]Import[!!-~]the[!!-~]MaxMind[!!-~]GeoIP[!!-~]Free[!!-~]Country[!!-~]CSV[!!-~]file[!!-~]into[!!-~]MySQL[!!-~]and[!!-~]save[!!-~]diskspace.pdf -text svneol=unset#unset
sources/GeoIP-Installation.docx -text
sources/GeoIPCountryCSV.zip -text
sources/GeoIPv6.csv/GeoIPv6-20120304.csv -text
sources/IPNum-Berechnung.xls -text
sources/ToDo.txt -text

1
copy_this/.noencode Normal file
View File

@ -0,0 +1 @@
copyAsIsFiles = modules/d3/d3geoip/controllers, modules/d3/d3geoip/models/d3geoip_update.php, modules/d3/d3geoip/modules/components, modules/d3/d3geoip/views, modules/d3/d3geoip/d3_geoip_stub.php, modules/d3/d3geoip/metadata.php

View File

@ -1,26 +1,28 @@
<?php
// @copyright © D³ Data Development
//
// This Software is the property of Data Development and is protected
// by copyright law - it is NOT Freeware.
//
// Any unauthorized use of this software without a valid license key
// is a violation of the license agreement and will be prosecuted by
// civil and criminal law.
//
// http://www.shopmodule.com
// AUTOR Daniel Seifert <ds@shopmodule.com>
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_cfg_geoipset extends d3_cfg_mod_
{
/**
* @return string
*/
public function render()
{
$this->_aViewData['sListClass'] = 'd3_cfg_geoipset_list';
$this->_aViewData['sMainClass'] = 'd3_cfg_geoipset_main';
$this->addTplParam('sListClass', 'd3_cfg_geoipset_list');
$this->addTplParam('sMainClass', 'd3_cfg_geoipset_main');
$this->_hasListItems = false;

View File

@ -1,27 +1,24 @@
<?php
// @copyright © D³ Data Development
//
// This Software is the property of Data Development and is protected
// by copyright law - it is NOT Freeware.
//
// Any unauthorized use of this software without a valid license key
// is a violation of the license agreement and will be prosecuted by
// civil and criminal law.
//
// http://www.shopmodule.com
// AUTOR Daniel Seifert <ds@shopmodule.com>
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_cfg_geoipset_licence extends d3_cfg_mod_licence
{
protected $_sModId = 'd3_geoip';
protected $_hasLicence = false;
protected $_hasNewsletterForm = false;
protected $_sMenuItemTitle = 'd3mxgeoip';
protected $_sMenuSubItemTitle = 'd3mxgeoip_settings';
}

View File

@ -1,17 +1,19 @@
<?php
// @copyright © D³ Data Development
//
// This Software is the property of Data Development and is protected
// by copyright law - it is NOT Freeware.
//
// Any unauthorized use of this software without a valid license key
// is a violation of the license agreement and will be prosecuted by
// civil and criminal law.
//
// http://www.shopmodule.com
// AUTOR Daniel Seifert <ds@shopmodule.com>
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_cfg_geoipset_list extends d3_cfg_mod_list
{
@ -22,14 +24,17 @@ class d3_cfg_geoipset_list extends d3_cfg_mod_list
protected $_sMenuSubItemTitle = 'd3mxgeoip_settings';
/**
* @return null
*/
public function render()
{
$sRet = parent::render();
// default page number 1
$this->_aViewData['oxid'] = 1;
$this->_aViewData["default_edit"] = "d3_cfg_geoipset_main";
$this->_aViewData["updatemain"] = $this->_blUpdateMain;
$this->addTplParam('oxid', 1);
$this->addTplParam("default_edit", "d3_cfg_geoipset_main");
$this->addTplParam("updatemain", $this->_blUpdateMain);
return $sRet;
}

View File

@ -191,12 +191,15 @@ class d3_country_geoip extends oxAdminView
$sCurs = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getOne($sQ);
foreach (unserialize($sCurs) as $sKey => $sValue)
if ($sCurs)
{
$aFields = explode('@', $sValue);
$aCurrencies[$sKey]->id = $sKey;
$aCurrencies[$sKey]->name = $aFields[0];
$aCurrencies[$sKey]->sign = $aFields[4];
foreach (unserialize($sCurs) as $sKey => $sValue)
{
$aFields = explode('@', $sValue);
$aCurrencies[$sKey]->id = $sKey;
$aCurrencies[$sKey]->name = $aFields[0];
$aCurrencies[$sKey]->sign = $aFields[4];
}
}
return $aCurrencies;

View File

@ -15,7 +15,7 @@
* @link http://www.oxidmodule.com
*/
class d3GeoIP extends oxI18n
class d3GeoIP extends oxbase
{
protected $_sClassName = 'd3geoip';
private $_sModId = 'd3_geoip';
@ -41,6 +41,8 @@ class d3GeoIP extends oxI18n
{
if (!$this->oCountry)
{
startProfile(__METHOD__);
if (!$sIP)
{
$sIP = $this->getIP();
@ -59,6 +61,8 @@ class d3GeoIP extends oxI18n
$this->_getLog()->log('info', __CLASS__, __FUNCTION__, __LINE__, 'get ISO by IP', $sIP." => ".$sISOAlpha);
$this->oCountry = $this->getCountryObject($sISOAlpha);
}
stopProfile(__METHOD__);
}
return $this->oCountry;
@ -71,31 +75,71 @@ class d3GeoIP extends oxI18n
*/
public function getIP()
{
startProfile(__METHOD__);
if ($this->_getModConfig()->getValue('blUseTestIp') && $this->_getModConfig()->getValue('sTestIp'))
{
return $this->_getModConfig()->getValue('sTestIp');
$sIP = $this->_getModConfig()->getValue('sTestIp');
}
elseif ($this->_getModConfig()->getValue('blUseTestCountry') && $this->_getModConfig()->getValue('sTestCountryIp'))
{
return $this->_getModConfig()->getValue('sTestCountryIp');
$sIP = $this->_getModConfig()->getValue('sTestCountryIp');
}
else
{
return $_SERVER['REMOTE_ADDR'];
// ToDo: use $_SERVER['X-Forwared-For'] && Client-IP in case of proxy
$sIP = $_SERVER['REMOTE_ADDR'];
}
stopProfile(__METHOD__);
return $sIP;
}
/**
* get IP number by IP address
*
* @param string $sIP IP address
* @return int IP number
* @param $sIP
* @return bool
* @throws Exception|int
*/
protected function _getNumIp($sIP)
{
$aIP = explode('.',$sIP);
$iIP = ($aIP[0] * 16777216) + ($aIP[1] * 65536) + ($aIP[2] * 256) + ($aIP[3] * 1);
return $iIP;
// make sure it is an ip
if (filter_var($sIP, FILTER_VALIDATE_IP) === FALSE)
return FALSE;
startProfile(__METHOD__);
$parts = unpack('N*', inet_pton($sIP));
if (strpos($sIP, '.') !== FALSE)
{
$parts = array(1=>0, 2=>0, 3=>0, 4=>$parts[1]);
}
foreach ($parts as &$part)
{
if ($part < 0)
$part += 4294967296;
}
if (function_exists('bcadd'))
{
$dIP = $parts[4];
$dIP = bcadd($dIP, bcmul($parts[3], '4294967296'));
$dIP = bcadd($dIP, bcmul($parts[2], '18446744073709551616'));
$dIP = bcadd($dIP, bcmul($parts[1], '79228162514264337593543950336'));
}
else
{
throw new Exception('extension BCMath is required');
}
$aIP = explode('.', $dIP);
stopProfile(__METHOD__);
return $aIP[0];
}
/**
@ -106,8 +150,14 @@ class d3GeoIP extends oxI18n
*/
public function LoadByIPNum($iIPNum)
{
startProfile(__METHOD__);
$sSelect = "SELECT d3iso FROM ".$this->_sClassName." WHERE d3startipnum <= '$iIPNum' AND d3endipnum >= '$iIPNum'";
return oxDb::getDb()->getOne($sSelect);
$sISO = oxDb::getDb()->getOne($sSelect);
stopProfile(__METHOD__);
return $sISO;
}
/**
@ -118,21 +168,27 @@ class d3GeoIP extends oxI18n
*/
public function getCountryObject($sISOAlpha)
{
startProfile(__METHOD__);
$oCountry = oxNew('oxcountry');
$sSelect = "SELECT oxid FROM ".$oCountry->getViewName()." WHERE OXISOALPHA2 = '".$sISOAlpha."' AND OXACTIVE = '1'";
$oCountry->load(oxDb::getDb()->getOne($sSelect));
stopProfile(__METHOD__);
return $oCountry;
}
/**
* get oxcountry object for fallback, if set
*
* @return object
* @return oxcountry
*/
public function getCountryFallBackObject()
{
startProfile(__METHOD__);
$oCountry = oxNew('oxcountry');
if ($this->_getModConfig()->getValue('blUseFallback') && $this->_getModConfig()->getValue('sFallbackCountryId'))
@ -140,6 +196,8 @@ class d3GeoIP extends oxI18n
$oCountry->Load($this->_getModConfig()->getValue('sFallbackCountryId'));
}
stopProfile(__METHOD__);
return $oCountry;
}
@ -149,11 +207,16 @@ class d3GeoIP extends oxI18n
*/
public function setCountryLanguage()
{
startProfile(__METHOD__);
$this->performURLSwitch();
$this->performShopSwitch();
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeLang'))
{
stopProfile(__METHOD__);
return;
}
$oCountry = $this->getUserLocationCountryObject();
@ -164,6 +227,8 @@ class d3GeoIP extends oxI18n
oxRegistry::getLang()->setBaseLanguage((int) $oCountry->getFieldData('d3geoiplang'));
oxRegistry::getSession()->setVariable('d3isSetLang', true);
}
stopProfile(__METHOD__);
}
/**
@ -175,6 +240,8 @@ class d3GeoIP extends oxI18n
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeCurr'))
return;
startProfile(__METHOD__);
$oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin() && oxRegistry::getUtils()->isSearchEngine() === false && !oxRegistry::getSession()->getVariable('d3isSetCurr') && $oCountry->getId() && $oCountry->getFieldData('d3geoipcur') > -1)
@ -183,6 +250,8 @@ class d3GeoIP extends oxI18n
oxRegistry::getConfig()->setActShopCurrency((int) $oCountry->getFieldData('d3geoipcur'));
oxRegistry::getSession()->setVariable('d3isSetCurr', true);
}
stopProfile(__METHOD__);
}
/**
@ -194,11 +263,22 @@ class d3GeoIP extends oxI18n
if (!$this->_getModConfig()->isActive() || !$this->_getModConfig()->getValue('blChangeShop'))
return;
$oCountry = $this->getUserLocationCountryObject();
startProfile(__METHOD__);
$oCountry = $this->getUserLocationCountryObject();
$iNewShop = $oCountry->getFieldData('d3geoipshop');
if (!$this->isAdmin() && oxRegistry::getUtils()->isSearchEngine() === false && $oCountry->getId() && $this->getConfig()->isMall() && $iNewShop > -1 && $iNewShop != $this->getConfig()->getShopId())
if (oxRegistry::getConfig()->getRequestParameter('d3redirect') != 1 &&
!$this->isAdmin() &&
oxRegistry::getUtils()->isSearchEngine() === false &&
$oCountry->getId() &&
$this->getConfig()->isMall() &&
$iNewShop > -1 &&
(
$iNewShop != $this->getConfig()->getShopId() ||
strtolower($this->getConfig()->getActiveView()->getClassName()) == 'mallstart'
)
)
{
$oNewConf = new oxConfig();
$oNewConf->setShopId($iNewShop);
@ -206,7 +286,9 @@ class d3GeoIP extends oxI18n
$this->getConfig()->onShopChange();
if (!oxRegistry::getSession()->getVariable('d3isSetLang') && $oCountry->getFieldData('d3geoiplang') > -1)
if (!oxRegistry::getSession()->getVariable('d3isSetLang') &&
$this->_getModConfig()->getValue('blChangeLang') &&
$oCountry->getFieldData('d3geoiplang') > -1)
{
$sLangId = $oCountry->getFieldData('d3geoiplang');
}
@ -215,11 +297,22 @@ class d3GeoIP extends oxI18n
$sLangId = '';
}
$this->_getLog()->log('info', __CLASS__, __FUNCTION__, __LINE__, 'change shop', $this->getIP().' => '.$oNewConf->getShopHomeUrl($sLangId));
/** @var $oStr d3str */
$oStr = oxRegistry::get('d3str');
$aParams = array(
'd3redirect' => '1',
'fnc' => oxRegistry::getConfig()->getRequestParameter('fnc'),
'shp' => $iNewShop
);
$sUrl = str_replace('&amp;', '&', $oStr->generateParameterUrl($oNewConf->getShopHomeUrl($sLangId), $aParams));
header("Location: ".$oNewConf->getShopHomeUrl($sLangId));
$this->_getLog()->log('info', __CLASS__, __FUNCTION__, __LINE__, 'change shop', $this->getIP().' => '.$sUrl);
header("Location: ".$sUrl);
exit();
}
stopProfile(__METHOD__);
}
/**
@ -233,9 +326,16 @@ class d3GeoIP extends oxI18n
return;
}
startProfile(__METHOD__);
$oCountry = $this->getUserLocationCountryObject();
if (!$this->isAdmin() && oxRegistry::getUtils()->isSearchEngine() === false && $oCountry->getId() && $oCountry->getFieldData('d3geoipurl') && strlen(trim($oCountry->getFieldData('d3geoipurl'))) > 0)
if (!$this->isAdmin() &&
oxRegistry::getUtils()->isSearchEngine() === false &&
$oCountry->getId() &&
$oCountry->getFieldData('d3geoipurl') &&
strlen(trim($oCountry->getFieldData('d3geoipurl'))) > 0
)
{
$sNewUrl = $oCountry->getFieldData('d3geoipurl');
@ -244,6 +344,8 @@ class d3GeoIP extends oxI18n
header("Location: ".$sNewUrl);
exit();
}
stopProfile(__METHOD__);
}
/**
@ -253,6 +355,8 @@ class d3GeoIP extends oxI18n
*/
public function getShopUrls()
{
startProfile(__METHOD__);
$oShoplist = oxNew( 'oxshoplist' );
$oShoplist->getList();
$aShopUrls = array();
@ -261,6 +365,8 @@ class d3GeoIP extends oxI18n
$aShopUrls[$sId] = $this->getConfig()->getShopConfVar( 'sMallShopURL', $sId );
}
stopProfile(__METHOD__);
return $aShopUrls;
}

View File

@ -36,8 +36,8 @@ nc9';
'do' => 'updateGeoIpItems'),
array('check' => 'checkModCfgItemExist',
'do' => 'updateModCfgItemExist'),
array('check' => 'checkFields',
'do' => 'fixFields'),
array('check' => 'checkGeoIpFields',
'do' => 'fixGeoIpFields'),
array('check' => 'checkIndizes',
'do' => 'fixIndizes'),
array('check' => 'checkModCfgSameRevision',
@ -91,7 +91,7 @@ nc9';
'D3STARTIP' => array(
'sTableName' => 'd3geoip',
'sFieldName' => 'D3STARTIP',
'sType' => 'CHAR(15)',
'sType' => 'VARCHAR(39)',
'blNull' => FALSE,
'sDefault' => FALSE,
'sComment' => '',
@ -101,7 +101,7 @@ nc9';
'D3ENDIP' => array(
'sTableName' => 'd3geoip',
'sFieldName' => 'D3ENDIP',
'sType' => 'CHAR(15)',
'sType' => 'VARCHAR(39)',
'blNull' => FALSE,
'sDefault' => FALSE,
'sComment' => '',
@ -111,7 +111,7 @@ nc9';
'D3STARTIPNUM' => array(
'sTableName' => 'd3geoip',
'sFieldName' => 'D3STARTIPNUM',
'sType' => 'INT(10) unsigned',
'sType' => 'DECIMAL(38,0)',
'blNull' => FALSE,
'sDefault' => FALSE,
'sComment' => '',
@ -121,7 +121,7 @@ nc9';
'D3ENDIPNUM' => array(
'sTableName' => 'd3geoip',
'sFieldName' => 'D3ENDIPNUM',
'sType' => 'INT(10) unsigned',
'sType' => 'DECIMAL(38,0)',
'blNull' => FALSE,
'sDefault' => FALSE,
'sComment' => '',
@ -260,111 +260,141 @@ nc9';
'oxmodid' => $this->sModKey,
'oxshopid' => $oShop->getId(),
);
$aInsertFields = array(
array (
'fieldname' => 'OXID',
'content' => "md5('" . $this->sModKey . " " . $oShop->getId() . " de')",
'force_update' => TRUE,
'use_quote' => FALSE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXSHOPID',
'content' => $oShop->getId(),
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXMODID',
'content' => $this->sModKey,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXNAME',
'content' => $this->sModName,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXACTIVE',
'content' => "0",
'force_update' => FALSE,
'use_quote' => FALSE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXBASECONFIG',
'content' => $this->sBaseConf,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXSERIAL',
'content' => "",
'force_update' => FALSE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXINSTALLDATE',
'content' => "NOW()",
'force_update' => TRUE,
'use_quote' => FALSE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXVERSION',
'content' => $this->sModVersion,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXSHOPVERSION',
'content' => oxRegistry::getConfig()->getEdition(),
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXREQUIREMENTS',
'content' => $this->sRequirements,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array(
'fieldname' => 'OXVALUE',
'content' => $this->sBaseValue,
'force_update' => FALSE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array(
'fieldname' => 'OXNEWREVISION',
'content' => $this->sModRevision,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
)
);
$aRet = $this->_updateTableItem('d3_cfg_mod', $aInsertFields, $aWhere);
$blRet = $aRet['blRet'];
$this->_setActionLog('SQL', $aRet['sql'], __METHOD__);
$this->_setUpdateBreak(FALSE);
if ($this->getStepByStepMode())
if ($this->_checkTableItemNotExist('d3_cfg_mod', $aWhere))
{
break;
$aInsertFields = array(
array (
'fieldname' => 'OXID',
'content' => "md5('" . $this->sModKey . " " . $oShop->getId() . " de')",
'force_update' => TRUE,
'use_quote' => FALSE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXSHOPID',
'content' => $oShop->getId(),
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXMODID',
'content' => $this->sModKey,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXNAME',
'content' => $this->sModName,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXACTIVE',
'content' => "0",
'force_update' => FALSE,
'use_quote' => FALSE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXBASECONFIG',
'content' => $this->sBaseConf,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXSERIAL',
'content' => "",
'force_update' => FALSE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXINSTALLDATE',
'content' => "NOW()",
'force_update' => TRUE,
'use_quote' => FALSE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXVERSION',
'content' => $this->sModVersion,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXSHOPVERSION',
'content' => oxRegistry::getConfig()->getEdition(),
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array (
'fieldname' => 'OXREQUIREMENTS',
'content' => $this->sRequirements,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array(
'fieldname' => 'OXVALUE',
'content' => $this->sBaseValue,
'force_update' => FALSE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
),
array(
'fieldname' => 'OXNEWREVISION',
'content' => $this->sModRevision,
'force_update' => TRUE,
'use_quote' => TRUE,
'use_multilang' => FALSE,
)
);
$aRet = $this->_updateTableItem('d3_cfg_mod', $aInsertFields, $aWhere);
$blRet = $aRet['blRet'];
$this->_setActionLog('SQL', $aRet['sql'], __METHOD__);
$this->_setUpdateBreak(FALSE);
if ($this->getStepByStepMode())
{
break;
}
}
}
}
return $blRet;
}
/**
* change default value for shop id in EE
* @return bool
*/
public function checkGeoIpFields()
{
/** @var $oShop oxshop */
$oShop = $this->_getShopList()->current();
$this->aFields['D3GEOIPSHOP']['sDefault'] = $oShop->getId();
return $this->checkFields();
}
/**
* change default value for shop id in EE
* @return bool
*/
public function fixGeoIpFields()
{
/** @var $oShop oxshop */
$oShop = $this->_getShopList()->current();
$this->aFields['D3GEOIPSHOP']['sDefault'] = $oShop->getId();
return $this->fixFields();
}
}

View File

@ -1,17 +1,17 @@
<?php
/**
* This Software is the property of OXID eSales and is protected
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license key
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* @link http://www.oxid-esales.com
* @package lang
* @copyright (C) OXID eSales AG 2003-2009
* @version OXID eShop EE
* $Id: lang.php 23594 2009-10-26 13:19:30Z alfonsas $
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
$sLangName = 'Deutsch';
@ -58,7 +58,7 @@ $aLang = array(
'D3_GEOIP_METADATA_TITLE' => 'D³ GeoIP Vorauswahl',
'D3_GEOIP_METADATA_DESC' => 'Begrüßen Sie Ihre Kunden in seiner Landessprache.',
'D3_GEOIP_UPDATE_ITEMINSTALL' => 'Die umfangreiche IP-Liste kann leider nicht über die automatische Installation eingebunden werden. Bitte installieren Sie diese manuell. '.PHP_EOL.PHP_EOL.'Die erforderlichen Daten finden Sie im Installationspaket des Moduls unter "setup+doku/geoip-Data_*.sql" oder als handlichere SQL-Dateien unter "setup+doku/geoip_data_parts/". '.PHP_EOL.PHP_EOL.'Sie benötigen entweder die Komplettdatei oder die Sammlung kleinerer Daten. Führen Sie die SQL-Datei(en) bitte in Ihrer Datenbank aus.',
'D3_GEOIP_UPDATE_ITEMINSTALL' => 'Die umfangreiche IP-Liste kann leider nicht über die automatische Installation eingebunden werden. Bitte installieren Sie diese manuell. '.PHP_EOL.PHP_EOL.'Die erforderlichen Daten finden Sie im Installationspaket des Moduls unter "setup+doku/geoip-Data_IPv4_*.sql" ("setup+doku/geoip-Data_IPv6_*.sql" für IPv6-Adressen) oder als handlichere SQL-Dateien unter "setup+doku/geoip_data_parts/". '.PHP_EOL.PHP_EOL.'Sie benötigen entweder die Komplettdateien oder die Sammlung kleinerer Daten. Führen Sie die SQL-Datei(en) bitte in Ihrer Datenbank aus.',
);

View File

@ -221,7 +221,7 @@ td.edittext {
<input class="edittext ext_edittext" type="checkbox" name="value[blUseTestIp]" value='1' [{if $edit->getValue('blUseTestIp') == 1}]checked[{/if}]>
</dt>
<dd>
<input type="text" maxlength="15" size="17" name="value[sTestIp]" value="[{$edit->getValue('sTestIp')}]">
<input type="text" maxlength="39" size="17" name="value[sTestIp]" value="[{$edit->getValue('sTestIp')}]">
[{ oxinputhelp ident="D3_GEOIP_SET_IP_TESTIP_DESC" }]
</dd>
<div class="spacer"></div>
@ -247,7 +247,7 @@ td.edittext {
[{oxmultilang ident="D3_GEOIP_SET_IP_CHECKIP"}]
</dt>
<dd>
<input type="text" maxlength="15" size="17" name="value[sCheckIp]" value="[{$edit->getValue('sCheckIp')}]">
<input type="text" maxlength="39" size="17" name="value[sCheckIp]" value="[{$edit->getValue('sCheckIp')}]">
[{ oxinputhelp ident="D3_GEOIP_SET_IP_CHECKIP_DESC" }]
[{if $edit->getValue('sCheckIp')}]

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,8 @@
GeoIP Country light
This product includes GeoLite data created by MaxMind, available from
<a href="http://www.maxmind.com">http://www.maxmind.com</a>.
GeoIp-Data based on GeoIp Country Light by Maxmind (July 2009).
These database will be published under GPL3 by Maxmind. Please see www.maxmind.com for updates.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,61 @@
#!/usr/bin/perl
print "*** GEO-IP Datenrotator Alexander Fehler ***\n\n\n";
@Zeilen = ("");
open(GEODATA, "<geoip.csv") || die " ******************************************** \n Datei konnte nicht gefuden werden:\n Bitte Ueberpruefen Sie den Pfad. \n\n Die .csv Datei muss im selben Ordner liegen und geoip.csv heissen\n ********************************************\n\n\n";
while(<GEODATA>)
{
$index=0;
@string=split(/,/,$_);
for(@string)
{
if($index==0)
{
$str = "@string[$index]";
$index++;
}
else
{
$str = "$str,@string[$index]";
$index++;
}
}
chomp($str);
push(@Zeilen_neu,$str);
}
close(GEODATA);
print "*** Datei wurde eingelesen und geschlossen *** \n ";
print "\n\n";
print "*** Datei wird zum Schreiben geoeffnet ***\n";
open(GEODATASQL, ">geoip.sql"); # SQL-Datei zum Schreiben öffnen
$schreib_zaehler=0;
for(@Zeilen_neu) # solange Daten in der GEOIP-Liste sind
{
# print @Zeilen_neu[$schreib_zaehler];
#print "\n\n\n\ntest ".$_."\n\n\n\n";
print GEODATASQL "INSERT INTO d3geoip VALUES(@Zeilen_neu[$schreib_zaehler]);\n"; # Aktuellen Datensatz schreiben
$schreib_zaehler++;
}
# print GEODATASQL "INSERT INTO d3geoip VALUES(@Zeilen_neu[$schreib_zaehler]);\n"; # Aktuellen Datensatz schreiben
close(GEODATASQL);
print "\n Es wurden d",$schreib_zaehler," Datensaetze geschrieben\n"; # Nur zur Kontrolle: auf Standardausgabe*/
#@string=split(/,/,$string);
#$index=0;
#for(@string)
#{
#$str = "$str,@string[$index]";
#}
#print $str."\n";
#push(@zeile,$str);
#print @zeile."\n";

Binary file not shown.

Binary file not shown.

View File

@ -1,7 +1,4 @@
blForceSessionStart nur bei Anwendung von GeoIP
statt session auch Fallback auf cookie
auch nicht aktive Länder konfigurierbar (um auch nicht erlaubte Zugriffe abzufangen)
IP-Syntaxcheck bei Eingabe im Admin
MaxMind-CSV-Import
IPV6-Pflege