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 )
* @ author D3 Data Development - Daniel Seifert < ds @ shopmodule . com >
* @ link http :// www . oxidmodule . com
*/
class d3_googleanalytics_update extends d3install_updatebase
{
public $sModKey = 'd3_googleanalytics' ;
public $sModName = 'Google Analytics Schnittstelle' ;
2013-05-08 12:22:18 +02:00
public $sModVersion = '3.0.0.2' ;
public $sModRevision = '99' ;
public $sBaseConf = ' WxUSlVXQ0ZjeG44Z3RyZWN3TlhqTFdlNVdJcWFVaDgwOTYwcUdOdHVycnFCRnJDQjBpTDhRMHhqRCt0U
jQrcldHdzArR0xMaGtNdTM2MFdRcTRNZ0tOQnFZWDJPckR1T3FTcmY5U0l6MjBrSmpMa0VkS2t0MXFGT
lVPdFVIMGpNSTNpcjV5ejBLR1hpVktaTHNtbnVZVzNqT3diUEFNRXpJUjNZTDg0SmZHYjlYYW5ZaXZPY
XJmQVVpcER0K1pXcUJRdjhOWFlFYi9jZUY1blN4cGhQdktNTTcrMTluRFF6MHZKWEVrUEw2czBuM1B0V
0 tmeFpBS2hpZVFjc29qdFRiSm9UZEVkTnFsUXB3M292anJyVG5wUkd6bG5MVzR4NThFRE9TYjJYaStuR
3 M9 ' ;
2013-02-21 15:02:29 +01:00
public $sRequirements = '' ;
public $sBaseValue = '' ;
protected $_aUpdateMethods = array (
array ( 'check' => 'checkModCfgItemExist' ,
'do' => 'updateModCfgItemExist' ),
array ( 'check' => 'checkContentGANoticeItemExist' ,
'do' => 'updateContentGANoticeItemExist' ),
array ( 'check' => 'checkModCfgSameRevision' ,
'do' => 'updateModCfgSameRevision' ),
);
protected $_aRefreshMetaModuleIds = array ( 'd3_googleanalytics' );
/**
* @ return bool
*/
public function checkModCfgItemExist ()
{
$blRet = FALSE ;
foreach ( $this -> _getShopList () as $oShop )
{
/** @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
if ( $blRet )
{
return $blRet ;
}
}
return $blRet ;
}
/**
* @ return bool
*/
public function updateModCfgItemExist ()
{
$blRet = FALSE ;
if ( $this -> checkModCfgItemExist ())
{
foreach ( $this -> _getShopList () as $oShop )
{
/** @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
);
2013-04-24 12:41:28 +02:00
if ( $this -> _checkTableItemNotExist ( 'd3_cfg_mod' , $aWhere ))
2013-02-21 15:03:03 +01:00
{
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 (
2013-05-08 12:21:17 +02:00
'content' => " md5(' " . $this -> sModKey . " " . $oShop -> getId () . " ') " ,
'force_update' => false ,
2013-04-24 12:41:28 +02:00
),
'OXSHOPID' => array (
'content' => " ' " . $oShop -> getId () . " ' " ,
2013-05-08 12:21:17 +02:00
'force_update' => false ,
2013-04-24 12:41:28 +02:00
),
'OXMODID' => array (
'content' => " ' " . $this -> sModKey . " ' " ,
'force_update' => TRUE ,
),
'OXNAME' => array (
'content' => " ' " . $this -> sModName . " ' " ,
'force_update' => TRUE ,
),
'OXACTIVE' => array (
'content' => " 0 " ,
'force_update' => FALSE ,
),
'OXBASECONFIG' => array (
'content' => " ' " . $this -> sBaseConf . " ' " ,
'force_update' => TRUE ,
),
'OXINSTALLDATE' => array (
'content' => " NOW() " ,
'force_update' => TRUE ,
),
'OXVERSION' => array (
'content' => " ' " . $this -> sModVersion . " ' " ,
'force_update' => TRUE ,
),
'OXSHOPVERSION' => array (
'content' => " ' " . oxRegistry :: getConfig () -> getEdition () . " ' " ,
'force_update' => TRUE ,
),
'OXREQUIREMENTS' => array (
'content' => " ' " . $this -> sRequirements . " ' " ,
'force_update' => TRUE ,
),
'OXVALUE' => array (
'content' => " ' " . $this -> sBaseValue . " ' " ,
'force_update' => FALSE ,
),
'OXNEWREVISION' => array (
'content' => " ' " . $this -> sModRevision . " ' " ,
'force_update' => TRUE ,
),
);
$aRet = $this -> _updateTableItem ( 'd3_cfg_mod' , $aInsertFields , $aWhere );
$blRet = $aRet [ 'blRet' ];
$this -> _setActionLog ( 'SQL' , $aRet [ 'sql' ], __METHOD__ );
$this -> _setUpdateBreak ( FALSE );
if ( $this -> getStepByStepMode ())
{
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 ()
{
$blRet = FALSE ;
foreach ( $this -> _getShopList () as $oShop )
{
/** @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
if ( $blRet )
{
return $blRet ;
}
}
return $blRet ;
}
/**
* @ return bool
*/
public function updateContentGANoticeItemExist ()
{
$blRet = FALSE ;
if ( $this -> checkContentGANoticeItemExist ())
{
foreach ( $this -> _getShopList () as $oShop )
{
/** @var $oShop oxshop */
$aWhere = array (
'oxloadid' => 'Analytics_Security_Informations' ,
'oxshopid' => $oShop -> getId (),
);
2013-05-08 12:21:17 +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 (
'content' => " md5(RAND()) " ,
2013-05-08 12:21:17 +02:00
'force_update' => FALSE ,
2013-02-21 15:03:03 +01:00
),
'OXLOADID' => array (
'content' => " 'Analytics_Security_Informations' " ,
'force_update' => TRUE ,
),
'OXSHOPID' => array (
'content' => " ' " . $oShop -> getId () . " ' " ,
'force_update' => TRUE ,
),
'OXSNIPPET' => array (
'content' => " '1' " ,
2013-05-08 12:21:17 +02:00
'force_update' => FALSE ,
2013-02-21 15:03:03 +01:00
),
'OXTYPE' => array (
'content' => " '0' " ,
2013-05-08 12:21:17 +02:00
'force_update' => FALSE ,
2013-02-21 15:03:03 +01:00
),
'OXACTIVE' => array (
'content' => " '1' " ,
'force_update' => FALSE ,
),
'OXACTIVE_1' => array (
'content' => " '1' " ,
'force_update' => FALSE ,
),
'OXPOSITION' => array (
'content' => " '' " ,
2013-05-08 12:21:17 +02:00
'force_update' => FALSE ,
2013-02-21 15:03:03 +01:00
),
'OXTITLE' => array (
'content' => " 'Analytics Datenschutz Information' " ,
'force_update' => FALSE ,
),
'OXCONTENT' => array (
'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 ,
),
'OXCATID' => array (
2013-05-08 12:21:17 +02:00
'content' => " '' " ,
'force_update' => FALSE ,
2013-02-21 15:03:03 +01:00
),
'OXFOLDER' => array (
'content' => " 'CMSFOLDER_USERINFO' " ,
2013-05-08 12:21:17 +02:00
'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__ );
$this -> _setUpdateBreak ( FALSE );
if ( $this -> getStepByStepMode ())
{
break ;
}
}
}
}
return $blRet ;
}
/**
* @ return bool
*/
public function checkModCfgSameRevision ()
{
return $this -> _checkModCfgSameRevision ( $this -> sModKey );
}
/**
* @ return bool
*/
public function updateModCfgSameRevision ()
{
$blRet = FALSE ;
if ( $this -> checkModCfgSameRevision ( $this -> sModKey ))
{
$aRet = $this -> _updateModCfgSameRevision ( $this -> sModKey );
$this -> _setActionLog ( 'SQL' , $aRet [ 'sql' ], __METHOD__ );
$this -> _setUpdateBreak ( FALSE );
$blRet = $aRet [ 'blRet' ];
}
2013-05-08 12:21:17 +02:00
2013-02-21 15:02:29 +01:00
return $blRet ;
}
}