2013-02-21 15:02:29 +01:00
< ? php
/**
* 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 )
2014-05-02 11:01:19 +02:00
* @ author D3 Data Development - Daniel Seifert < ds @ shopmodule . com >
* @ link http :// www . oxidmodule . com
2013-02-21 15:02:29 +01:00
*/
class d3_googleanalytics_update extends d3install_updatebase
{
public $sModKey = 'd3_googleanalytics' ;
2014-05-02 11:01:19 +02:00
2013-02-21 15:02:29 +01:00
public $sModName = 'Google Analytics Schnittstelle' ;
2014-05-02 11:01:19 +02:00
public $sModVersion = '3.0.0.3' ;
public $sModRevision = '100' ;
public $sBaseConf = <<< KEY
--------------------------------------------------------------------------------
84 MbWtQLzZnbGNvWkw4d3BEUy82OTdmQmhZNEw5OWNYSXpuNGRMbE02bnJ0VlF6MlcwM252R1UvdTVkd
09 zOWs0SnF3T0U2L3RBUEN6MDkwdmFQeStMcWRHRGY1blJGUk9waTZSSlZLRlB0UHNnU2ZiS2pqWVJ6e
VcxK3lPOW9TQWM3QkZmb3dTMjlwVkNBVitWck5sWUE2dlRLNWZjNGJRZG9uMEVlR2dTL3pxaGpPL2lvZ
nYrbFovbmhIb1o3Q0RFSkl4S2RhNTdaaHUvbXU4L0VFK0QxMUVVdmo3b0N5enVaS01yRE9DZGVud1dEd
DNLOWgybGkycTNnRnBMU256aVY5Um5RdTVPaFl6ckIyRWRJSWg1T1ZMVU1nbDBNSUFwdHh6OThRK01wV
0 k9
--------------------------------------------------------------------------------
KEY ;
2013-02-21 15:02:29 +01:00
public $sRequirements = '' ;
2014-05-02 11:01:19 +02:00
2013-02-21 15:02:29 +01:00
public $sBaseValue = '' ;
protected $_aUpdateMethods = array (
2014-05-02 11:01:19 +02:00
array (
'check' => 'checkModCfgItemExist' ,
'do' => 'updateModCfgItemExist'
),
array (
'check' => 'checkContentGANoticeItemExist' ,
'do' => 'updateContentGANoticeItemExist'
),
array (
'check' => 'checkModCfgSameRevision' ,
'do' => 'updateModCfgSameRevision'
),
2013-02-21 15:02:29 +01:00
);
protected $_aRefreshMetaModuleIds = array ( 'd3_googleanalytics' );
/**
* @ return bool
*/
public function checkModCfgItemExist ()
{
2014-05-02 11:01:19 +02:00
$blRet = false ;
foreach ( $this -> _getShopList () as $oShop ) {
2013-02-21 15:02:29 +01:00
/** @var $oShop oxshop */
$aWhere = array (
'oxmodid' => $this -> sModKey ,
'oxnewrevision' => $this -> sModRevision ,
'oxshopid' => $oShop -> getId (),
);
2013-05-08 12:21:17 +02:00
$blRet = $this -> _checkTableItemNotExist ( 'd3_cfg_mod' , $aWhere );
2013-02-21 15:02:29 +01:00
2014-05-02 11:01:19 +02:00
if ( $blRet ) {
2013-02-21 15:02:29 +01:00
return $blRet ;
}
}
return $blRet ;
}
/**
* @ return bool
*/
public function updateModCfgItemExist ()
{
2014-05-02 11:01:19 +02:00
$blRet = false ;
2013-02-21 15:02:29 +01:00
2014-05-02 11:01:19 +02:00
if ( $this -> checkModCfgItemExist ()) {
foreach ( $this -> _getShopList () as $oShop ) {
2013-02-21 15:02:29 +01:00
/** @var $oShop oxshop */
$aWhere = array (
'oxmodid' => $this -> sModKey ,
'oxshopid' => $oShop -> getId (),
2013-05-08 12:21:17 +02:00
'oxnewrevision' => $this -> sModRevision ,
2013-02-21 15:02:29 +01:00
);
2014-05-02 11:01:19 +02:00
if ( $this -> _checkTableItemNotExist ( 'd3_cfg_mod' , $aWhere )) {
2013-05-08 12:21:17 +02:00
// update don't use this property
unset ( $aWhere [ 'oxnewrevision' ]);
2013-04-24 12:41:28 +02:00
$aInsertFields = array (
'OXID' => array (
2014-05-02 11:01:19 +02:00
'content' => " md5(' " . $this -> sModKey . " " . $oShop -> getId () . " ') " ,
'force_update' => false ,
2013-04-24 12:41:28 +02:00
),
'OXSHOPID' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $oShop -> getId () . " ' " ,
'force_update' => false ,
2013-04-24 12:41:28 +02:00
),
'OXMODID' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $this -> sModKey . " ' " ,
'force_update' => true ,
2013-04-24 12:41:28 +02:00
),
'OXNAME' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $this -> sModName . " ' " ,
'force_update' => true ,
2013-04-24 12:41:28 +02:00
),
'OXACTIVE' => array (
2014-05-02 11:01:19 +02:00
'content' => " 0 " ,
'force_update' => false ,
2013-04-24 12:41:28 +02:00
),
'OXBASECONFIG' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $this -> sBaseConf . " ' " ,
'force_update' => true ,
2013-04-24 12:41:28 +02:00
),
'OXINSTALLDATE' => array (
2014-05-02 11:01:19 +02:00
'content' => " NOW() " ,
'force_update' => true ,
2013-04-24 12:41:28 +02:00
),
'OXVERSION' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $this -> sModVersion . " ' " ,
'force_update' => true ,
2013-04-24 12:41:28 +02:00
),
'OXSHOPVERSION' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . oxRegistry :: getConfig () -> getEdition () . " ' " ,
'force_update' => true ,
2013-04-24 12:41:28 +02:00
),
'OXREQUIREMENTS' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $this -> sRequirements . " ' " ,
'force_update' => true ,
2013-04-24 12:41:28 +02:00
),
'OXVALUE' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $this -> sBaseValue . " ' " ,
'force_update' => false ,
2013-04-24 12:41:28 +02:00
),
'OXNEWREVISION' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $this -> sModRevision . " ' " ,
'force_update' => true ,
2013-04-24 12:41:28 +02:00
),
);
$aRet = $this -> _updateTableItem ( 'd3_cfg_mod' , $aInsertFields , $aWhere );
$blRet = $aRet [ 'blRet' ];
$this -> _setActionLog ( 'SQL' , $aRet [ 'sql' ], __METHOD__ );
2014-05-02 11:01:19 +02:00
$this -> _setUpdateBreak ( false );
2013-04-24 12:41:28 +02:00
2014-05-02 11:01:19 +02:00
if ( $this -> getStepByStepMode ()) {
2013-04-24 12:41:28 +02:00
break ;
}
2013-02-21 15:02:29 +01:00
}
}
}
2013-05-08 12:21:17 +02:00
2013-02-21 15:02:29 +01:00
return $blRet ;
}
/**
* @ return bool
*/
public function checkContentGANoticeItemExist ()
{
2014-05-02 11:01:19 +02:00
$blRet = false ;
foreach ( $this -> _getShopList () as $oShop ) {
2013-02-21 15:02:29 +01:00
/** @var $oShop oxshop */
$aWhere = array (
'oxloadid' => 'Analytics_Security_Informations' ,
'oxshopid' => $oShop -> getId (),
);
2013-05-08 12:21:17 +02:00
$blRet = $this -> _checkTableItemNotExist ( 'oxcontents' , $aWhere );
2013-02-21 15:02:29 +01:00
2014-05-02 11:01:19 +02:00
if ( $blRet ) {
2013-02-21 15:02:29 +01:00
return $blRet ;
}
}
return $blRet ;
}
/**
* @ return bool
*/
public function updateContentGANoticeItemExist ()
{
2014-05-02 11:01:19 +02:00
$blRet = false ;
2013-02-21 15:02:29 +01:00
2014-05-02 11:01:19 +02:00
if ( $this -> checkContentGANoticeItemExist ()) {
foreach ( $this -> _getShopList () as $oShop ) {
2013-02-21 15:02:29 +01:00
/** @var $oShop oxshop */
$aWhere = array (
'oxloadid' => 'Analytics_Security_Informations' ,
'oxshopid' => $oShop -> getId (),
);
2014-05-02 11:01:19 +02:00
if ( $this -> _checkTableItemNotExist ( 'oxcontents' , $aWhere )) {
2013-02-21 15:02:29 +01:00
$aInsertFields = array (
2013-02-21 15:03:03 +01:00
'OXID' => array (
2014-05-02 11:01:19 +02:00
'content' => " md5(RAND()) " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXLOADID' => array (
2014-05-02 11:01:19 +02:00
'content' => " 'Analytics_Security_Informations' " ,
'force_update' => true ,
2013-02-21 15:03:03 +01:00
),
'OXSHOPID' => array (
2014-05-02 11:01:19 +02:00
'content' => " ' " . $oShop -> getId () . " ' " ,
'force_update' => true ,
2013-02-21 15:03:03 +01:00
),
'OXSNIPPET' => array (
2014-05-02 11:01:19 +02:00
'content' => " '1' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXTYPE' => array (
2014-05-02 11:01:19 +02:00
'content' => " '0' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXACTIVE' => array (
2014-05-02 11:01:19 +02:00
'content' => " '1' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXACTIVE_1' => array (
2014-05-02 11:01:19 +02:00
'content' => " '1' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXPOSITION' => array (
2014-05-02 11:01:19 +02:00
'content' => " '' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXTITLE' => array (
2014-05-02 11:01:19 +02:00
'content' => " 'Analytics Datenschutz Information' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXCONTENT' => array (
2014-05-02 11:01:19 +02:00
'content' => " '<p>Diese Website benutzt Google Analytics, einen Webanalysedienst der Google \r \n \r \n Inc. ("Google"). Google Analytics verwendet sog. "Cookies", Textdateien, die auf \r \n \r \n Ihrem Computer gespeichert werden und die eine Analyse der Benutzung der Website \r \n \r \n durch Sie erm<72> glichen. Die durch den Cookie erzeugten Informationen <20> ber Ihre \r \n \r \n Benutzung dieser Website (einschlie<69> lich Ihrer IP-Adresse<span style= \" color: #800000 \" >, die jedoch mit der Methode _anonymizeIp() anonymisiert wird, so dass Sie nicht mehr einem Anschluss \r \n \r \n zugeordnet werden kann</span>) wird an einen Server von Google in den USA \r \n \r \n <EFBFBD> bertragen und dort gespeichert. Google wird diese Informationen benutzen, um\r \n \r \n Ihre Nutzung der Website auszuwerten, um Reports <20> ber die Websiteaktivit<69> ten f<> r \r \n \r \n die Websitebetreiber zusammenzustellen und um weitere mit der Websitenutzung und \r \n \r \n der Internetnutzung verbundene Dienstleistungen zu erbringen. Auch wird Google \r \n \r \n diese Informationen gegebenenfalls an Dritte <20> bertragen, sofern dies gesetzlich \r \n \r \n vorgeschrieben oder soweit Dritte diese Daten im Auftrag von Google verarbeiten. \r \n \r \n Google wird in keinem Fall Ihre IP-Adresse mit anderen Daten von Google in \r \n \r \n Verbindung bringen. Sie k<> nnen die Installation der Cookies durch eine \r \n \r \n entsprechende Einstellung Ihrer Browser Software verhindern; wir weisen Sie \r \n \r \n jedoch darauf hin, dass Sie in diesem Fall gegebenenfalls nicht s<> mtliche \r \n \r \n Funktionen dieser Website vollumf<6D> nglich nutzen k<> nnen. Durch die Nutzung dieser \r \n \r \n Website erkl<6B> ren Sie sich mit der Bearbeitung der <20> ber Sie erhobenen Daten durch \r \n \r \n Google in der zuvor beschriebenen Art und Weise und zu dem zuvor benannten Zweck \r \n \r \n einverstanden.</p> \r \n <p><span style= \" color: #800000 \" >Sie k<> nnen der Erhebung der \r \n \r \n Daten durch Google-Analytics mit Wirkung f<> r die Zukunft widersprechen, indem \r \n \r \n sie ein Deaktivierungs-Add-on (<a href= \" http://tools.google.com/dlpage/gaoptout?hl=de \" title= \" \" >http://tools.google.com/dlpage/gaoptout?hl=de</a>) \r \n \r \n f<EFBFBD> r Ihren Browser installieren.</span></p>' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXCATID' => array (
2014-05-02 11:01:19 +02:00
'content' => " '' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
'OXFOLDER' => array (
2014-05-02 11:01:19 +02:00
'content' => " 'CMSFOLDER_USERINFO' " ,
'force_update' => false ,
2013-02-21 15:03:03 +01:00
),
2013-02-21 15:02:29 +01:00
);
2013-02-21 15:03:03 +01:00
$aRet = $this -> _updateTableItem ( 'oxcontents' , $aInsertFields , $aWhere );
2013-02-21 15:02:29 +01:00
$blRet = $aRet [ 'blRet' ];
$this -> _setActionLog ( 'SQL' , $aRet [ 'sql' ], __METHOD__ );
2014-05-02 11:01:19 +02:00
$this -> _setUpdateBreak ( false );
2013-02-21 15:02:29 +01:00
2014-05-02 11:01:19 +02:00
if ( $this -> getStepByStepMode ()) {
2013-02-21 15:02:29 +01:00
break ;
}
}
}
}
2014-05-02 11:01:19 +02:00
2013-02-21 15:02:29 +01:00
return $blRet ;
}
/**
* @ return bool
*/
public function checkModCfgSameRevision ()
{
return $this -> _checkModCfgSameRevision ( $this -> sModKey );
}
/**
* @ return bool
*/
public function updateModCfgSameRevision ()
{
2014-05-02 11:01:19 +02:00
$blRet = false ;
2013-02-21 15:02:29 +01:00
2014-05-02 11:01:19 +02:00
if ( $this -> checkModCfgSameRevision ( $this -> sModKey )) {
2013-02-21 15:02:29 +01:00
$aRet = $this -> _updateModCfgSameRevision ( $this -> sModKey );
$this -> _setActionLog ( 'SQL' , $aRet [ 'sql' ], __METHOD__ );
2014-05-02 11:01:19 +02:00
$this -> _setUpdateBreak ( false );
2013-02-21 15:02:29 +01:00
$blRet = $aRet [ 'blRet' ];
}
2013-05-08 12:21:17 +02:00
2013-02-21 15:02:29 +01:00
return $blRet ;
}
2014-05-02 11:01:19 +02:00
}