diff --git a/copy_this/modules/d3/d3geoip/metadata.php b/copy_this/modules/d3/d3geoip/metadata.php index 6b8f39c..7cabca1 100644 --- a/copy_this/modules/d3/d3geoip/metadata.php +++ b/copy_this/modules/d3/d3geoip/metadata.php @@ -15,7 +15,7 @@ $aModule = array( 'en' => '', ), 'thumbnail' => 'picture.png', - 'version' => '3.0.0.2', + 'version' => '3.0.1.0', 'author' => 'D³ Data Development (Inh.: Thomas Dartsch)', 'email' => 'support@shopmodule.com', 'url' => 'http://www.oxidmodule.com/', diff --git a/copy_this/modules/d3/d3geoip/setup/d3geoip_update.php b/copy_this/modules/d3/d3geoip/setup/d3geoip_update.php index 3e498a5..1a183e0 100644 --- a/copy_this/modules/d3/d3geoip/setup/d3geoip_update.php +++ b/copy_this/modules/d3/d3geoip/setup/d3geoip_update.php @@ -18,14 +18,14 @@ class d3geoip_update extends d3install_updatebase { public $sModKey = 'd3_geoip'; public $sModName = 'GeoIP'; - public $sModVersion = '3.0.0.2'; - public $sModRevision = '52'; - public $sBaseConf = 'DSdWUJnZzd3RTd4aStQNjFBVnBkK3NFUmwzY2tiNHllWmFjSUZZOS9USTAzbHpHb241YWZTNThRWnpCV -XBnQ2J0STVReGNTQmVJQ0h3aXVYWVBKcWFuVzM2WVNwdld0cXZ3bEYzTWJRMnJTN2ZYMGFNMkFxT2VQe -CsxNzVVaytabkRBbCtJWnE1Y3lKZWdmaC9XNDhkZzhhQXhHc2FaZHlyejlSMFE1ZUJjNzA1M1dzSEJPQ -0NBNGZJbEpZNFVuMG1STEtQRkx1WDZZZzRndXF2OW1oUGdGb2tJZW1lQ09waE5FK29PYmpML2pRVkNaS -EdaS3RXUW5NZzJhUUF5ZlNIZ1h3MUo3QVpIeFUwL0lmajRTbWw2cmNsckpJVnFYQjFKWTd3RXUrMlhHK -zQ9'; + public $sModVersion = '3.0.1.0'; + public $sModRevision = '63'; + public $sBaseConf = '5FibjlIQlRvbWMzY29mVi85RXFxbkc5bFI3R24rNkd5Y0lEcXJFOGhtaGExRVcyaEF6a281cVhRUXFMU +0d6dnNDbCtLRVdObFh3bnVEdUNRTFJrVlE5VGtsRkF3Tyt4TU1Pd290WDliOTQ2SUE5Skk0eTcxTGdlT +XZna0dhS2ZOekJUSC94ZUd5YmxXZzRXcG5QSWcvZnFJa1l0N1MrdWRZaFU1VG5nUGFwNEF1WTh6azNja +Gs3SmtzQ05SVjROSGdSZ2N0S3Q1TTV1RGlCSU5RZnh1dGVNNVd6bTBzMU1FdHFiNytJQldBRjRTNmx3U +VVlRkhrRzYxYUtpaWNBOUUrLzZ2YjN5SDM1cllVMTIrYUFPRnRYcFpibHVBQytEQVFnNFV0RWpFZXAwd +FE9'; public $sRequirements = ''; public $sBaseValue = ''; diff --git a/setup+doku/Installation.pdf b/setup+doku/Installation.pdf index 47f3157..969f3d6 100644 Binary files a/setup+doku/Installation.pdf and b/setup+doku/Installation.pdf differ diff --git a/setup+doku/Precheck/d3precheck.php b/setup+doku/Precheck/d3precheck.php index 3802750..dc46128 100644 --- a/setup+doku/Precheck/d3precheck.php +++ b/setup+doku/Precheck/d3precheck.php @@ -39,11 +39,11 @@ class requConfig { - protected $_sModName = 'D³ GeoIP'; + public $sModName = 'D³ GeoIP'; public $sModId = 'd3_geoip'; - protected $_sModVersion = '3.0.0.X'; + public $sModVersion = '3.0.1.0'; /********************** check configuration section ************************/ @@ -60,7 +60,7 @@ class requConfig 'hasMaxPhpVersion' => array( 'blExec' => 0, 'aParams' => array( - 'version' => '5.4.200' + 'version' => '5.6.200' ) ), @@ -69,7 +69,7 @@ class requConfig 'blExec' => 1, 'aParams' => array( 'from' => '5.2.0', - 'to' => '5.4.200', + 'to' => '5.6.200', ) ), @@ -113,9 +113,9 @@ class requConfig 'hasMaxShopVersion' => array( 'blExec' => 1, 'aParams' => array( - 'PE' => '4.8.3', - 'CE' => '4.8.3', - 'EE' => '5.1.3' + 'PE' => '4.9.6', + 'CE' => '4.9.6', + 'EE' => '5.2.6' ), ), @@ -132,7 +132,9 @@ class requConfig ), // benötigt Modul-Connector - 'hasModCfg' => array('blExec' => 1), + 'hasModCfg' => array( + 'blExec' => 1 + ), // benötigt mindestens diese Erweiterungen / Version lt. d3_cfg_mod (kaskadierbar (siehe "Desc1")) 'hasMinModCfgVersion' => array( @@ -141,7 +143,7 @@ class requConfig 'aParams' => array( 'id' => 'd3modcfg_lib', 'name' => 'Modul-Connector', - 'version' => '3.9.0.0', + 'version' => '4.3.0.0', ), ), array( @@ -161,7 +163,18 @@ class requConfig 'aParams' => array( 'id' => 'd3modcfg_lib', 'name' => 'Modul-Connector', - 'version' => '3.9.0.5', + 'version' => '5.0.0.0', + ), + ), + ), + + // benötigt neuen Lizenzschlüssel + 'requireNewLicence' => array( + array( + 'blExec' => 1, + 'aParams' => array( + 'checkVersion' => true, // soll Versionsnummer des installierten Moduls gegengeprüft werden? + 'remainingDigits' => 2, // zu prüfende Stellen für neue Lizenz ), ), ), @@ -177,7 +190,7 @@ date_default_timezone_set('Europe/Berlin'); */ class requCheck { - public $sVersion = '4.1'; + public $sVersion = '4.6.2'; protected $_db = false; @@ -197,6 +210,8 @@ class requCheck protected $_sInFolderFileName = 'd3precheckinfolder.php'; + public $sVersionTag = '@@version@@'; + /********************** functional section ************************/ public $blGlobalResult = true; @@ -281,8 +296,11 @@ class requCheck $aCheckScripts = array(); /** @var SplFileInfo $oFileInfo */ - foreach (new RecursiveDirectoryIterator($sFolder) AS $oFileInfo) { - if (!in_array($oFileInfo->getFileName(), $aIgnoreDirItems) && $oFileInfo->isDir()) { + foreach (new RecursiveDirectoryIterator($sFolder) as $oFileInfo) { + if (in_array($oFileInfo->getFileName(), $aIgnoreDirItems)) { + continue; + } + if ($oFileInfo->isDir()) { $aCheckScripts = array_merge($aCheckScripts, $this->_walkThroughDirs($oFileInfo->getRealPath())); } elseif ($oFileInfo->isFile()) { if (strtolower($oFileInfo->getFilename()) == $this->_sInFolderFileName) { @@ -312,12 +330,85 @@ class requCheck $aArguments ); - $aReturn[$this->getBasePath($sScriptPath)] = unserialize(file_get_contents($sUrl)); + $sVersionUrl = $this->_getFolderCheckUrl( + $sScriptPath, + 'getVersion', + array() + ); + + $sContent = serialize(null); + $sVersion = serialize(null); + + if ($this->_hasCurl()) { + $sContent = $this->_getContentByCurl($sUrl); + $sVersion = $this->_getContentByCurl($sVersionUrl); + } elseif ($this->_hasAllowUrlFopen()) { + $sContent = file_get_contents($sUrl); + $sVersion = file_get_contents($sVersionUrl); + } + + $sBasePath = $this->getBasePath($sScriptPath); + $aReturn[$sBasePath] = unserialize($sContent); + $aReturn[$this->sVersionTag][$sBasePath] = unserialize($sVersion); } return $aReturn; } + /** + * @return bool + */ + protected function _hasCurl() + { + if (extension_loaded('curl') && function_exists('curl_init')) { + return true; + } + + return false; + } + + /** + * @return bool + */ + protected function _hasAllowUrlFopen() + { + if (ini_get('allow_url_fopen')) { + return true; + } + + return false; + } + + /** + * @param $sUrl + * + * @return bool|mixed + */ + protected function _getContentByCurl($sUrl) + { + $ch = curl_init(); + $sCurl_URL = preg_replace('@^((http|https)://)@', '', $sUrl); + curl_setopt($ch, CURLOPT_URL, $sCurl_URL); + curl_setopt($ch, CURLOPT_HEADER, 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5); + curl_setopt($ch, CURLOPT_TIMEOUT, 5); + curl_setopt($ch, CURLOPT_POST, 0); + $sContent = curl_exec($ch); + curl_close($ch); + + if (false == $sContent || + strstr(strtolower($sContent), strtolower('Request Entity Too Large')) || + strstr(strtolower($sContent), strtolower('not allow request data with POST requests')) + ) { + return false; + } + + return $sContent; + } + /** * @param $sScriptPath * @param $sMethodName @@ -364,15 +455,23 @@ class requCheck } /** - * @param $aResult + * @return string + */ + public function getVersion() + { + return $this->sVersion; + } + + /** + * @param $mResult * * @return bool */ - protected function _hasFalseInResult($aResult) + protected function _hasFalseInResult($mResult) { - if (is_array($aResult)) { - foreach ($aResult as $blResult) { - if (!$blResult) { + if (is_array($mResult)) { + foreach ($mResult as $blResult) { + if (false === $blResult) { $this->blGlobalResult = false; return true; @@ -380,13 +479,66 @@ class requCheck } return false; - } else { - if (!$aResult) { - $this->blGlobalResult = false; + } + + if (false === $mResult) { + $this->blGlobalResult = false; + + return true; + } + + return false; + } + + /** + * @param $mResult + * + * @return bool + */ + protected function _hasNullInResult($mResult) + { + if (is_array($mResult)) { + foreach ($mResult as $blResult) { + if ($blResult === null) { + $this->blGlobalResult = false; + + return true; + } } - return !$aResult; + return false; } + + if ($mResult === null) { + $this->blGlobalResult = false; + return true; + } + + return false; + } + + /** + * @param $mResult + * + * @return bool + */ + protected function _hasNoticeInResult($mResult) + { + if (is_array($mResult)) { + foreach ($mResult as $blResult) { + if ($blResult === 'notice') { + return true; + } + } + + return false; + } + + if ($mResult === 'notice') { + return true; + } + + return false; } /********************** conversion function section ************************/ @@ -421,8 +573,8 @@ class requCheck if (!$this->_db) { if (file_exists('config.inc.php')) { require_once('config.inc.php'); - $this->_db = mysql_connect($this->dbHost, $this->dbUser, $this->dbPwd); - mysql_select_db($this->dbName, $this->_db); + ini_set('error_reporting', E_ALL^E_NOTICE); + $this->_db = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPwd, $this->dbName); } } @@ -441,17 +593,24 @@ class requCheck return sprintf( '%d%03d%03d%03d', - intval($match[0] !== null ? $match[0] : $iUnsetPart), - intval( - $match[1] !== null ? $match[1] : $iUnsetPart - ), - intval($match[2] !== null ? $match[2] : $iUnsetPart), - intval( - $match[3] !== null ? $match[3] : $iUnsetPart - ) + $this->_getVersionDigit($match[0], $iUnsetPart), + $this->_getVersionDigit($match[1], $iUnsetPart), + $this->_getVersionDigit($match[2], $iUnsetPart), + $this->_getVersionDigit($match[3], $iUnsetPart) ); } + /** + * @param $sMatch + * @param $iUnsetPart + * + * @return int + */ + protected function _getVersionDigit($sMatch, $iUnsetPart) + { + return intval($sMatch !== null ? $sMatch : $iUnsetPart); + } + /********************** layout function section ************************/ public function deleteme() @@ -503,22 +662,36 @@ class requCheck { $sGenCheckType = preg_replace("@(\_[0-9]$)@", "", $sCheckType); $oTests = new requTests($this, $this->oConfig, $this->getDb(), $this->oRemote); - if (method_exists($oTests, $sGenCheckType)) { - $aResult = $oTests->{$sGenCheckType}($aConfiguration); - $sElementId = (md5($sGenCheckType . serialize($aConfiguration))); - - if ($this->_hasFalseInResult($aResult)) { - $this->oLayout->getNoSuccessItem($aResult, $sElementId, $sCheckType, $aConfiguration); - } else { - $this->oLayout->getSuccessItem($aResult, $sElementId, $sCheckType, $aConfiguration); - } + $this->_checkResult($oTests, $sGenCheckType, $sCheckType, $aConfiguration); } else { $this->oLayout->getUncheckableItem($sCheckType, $aConfiguration); $this->blGlobalResult = false; } } + /** + * @param $oTests + * @param $sGenCheckType + * @param $sCheckType + * @param $aConfiguration + */ + protected function _checkResult($oTests, $sGenCheckType, $sCheckType, $aConfiguration) + { + $mResult = $oTests->{$sGenCheckType}($aConfiguration); + $sElementId = (md5($sGenCheckType . serialize($aConfiguration))); + + if ($this->_hasNoticeInResult($mResult)) { + $this->oLayout->getUnknownItem($mResult, $sElementId, $sCheckType, $aConfiguration); + } elseif ($this->_hasNullInResult($mResult)) { + $this->oLayout->getUnknownItem($mResult, $sElementId, $sCheckType, $aConfiguration); + } elseif ($this->_hasFalseInResult($mResult)) { + $this->oLayout->getNoSuccessItem($mResult, $sElementId, $sCheckType, $aConfiguration); + } else { + $this->oLayout->getSuccessItem($mResult, $sElementId, $sCheckType, $aConfiguration); + } + } + public function showinfo() { phpinfo(); @@ -559,21 +732,137 @@ class requLayout
- - + + + + EOT; echo "' . $this->translate('ExecNotice') . '
' . PHP_EOL; @@ -599,10 +888,15 @@ EOT; $sTranslDependent