clearcookies.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class ClearCookies extends oxUBase
00007 {
00008 
00014     protected $_sThisTemplate = 'page/info/clearcookies.tpl';
00015 
00023     public function render()
00024     {
00025         parent::render();
00026 
00027         $this->_removeCookies();
00028 
00029         return $this->_sThisTemplate;
00030     }
00031 
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         $iBaseLanguage = oxRegistry::getLang()->getBaseLanguage();
00060         $aPath['title'] = oxRegistry::getLang()->translateString('INFO_ABOUT_COOKIES', $iBaseLanguage, false);
00061         $aPath['link'] = $this->getLink();
00062         $aPaths[] = $aPath;
00063 
00064         return $aPaths;
00065     }
00066 }