clearcookies.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class ClearCookies extends oxUBase
00007 {
00012     protected $_sThisTemplate = 'page/info/clearcookies.tpl';
00013 
00021     public function render()
00022     {
00023         parent::render();
00024 
00025         $this->_removeCookies();
00026 
00027         return $this->_sThisTemplate;
00028     }
00029 
00035     protected function _removeCookies()
00036     {
00037         $oUtilsServer = oxRegistry::get("oxUtilsServer");
00038         if ( isset( $_SERVER['HTTP_COOKIE'] ) ) {
00039             $aCookies = explode( ';', $_SERVER['HTTP_COOKIE'] );
00040             foreach ( $aCookies as $sCookie ) {
00041                 $sRawCookie = explode('=', $sCookie);
00042                 $oUtilsServer->setOxCookie( trim( $sRawCookie[0] ), '', time() - 10000, '/' );
00043             }
00044         }
00045         $oUtilsServer->setOxCookie( 'language', '', time() - 10000, '/' );
00046         $oUtilsServer->setOxCookie( 'displayedCookiesNotification', '', time() - 10000, '/' );
00047     }
00048 
00054     public function getBreadCrumb()
00055     {
00056         $aPaths = array();
00057         $aPath = array();
00058 
00059         $aPath['title'] = oxRegistry::getLang()->translateString( 'INFO_ABOUT_COOKIES', oxRegistry::getLang()->getBaseLanguage(), false );
00060         $aPath['link']  = $this->getLink();
00061         $aPaths[] = $aPath;
00062 
00063         return $aPaths;
00064     }
00065 
00066 }