OXID eShop CE  4.9.6
 All Classes Files Functions Variables Pages
clearcookies.php
Go to the documentation of this file.
1 <?php
2 
6 class ClearCookies extends oxUBase
7 {
8 
14  protected $_sThisTemplate = 'page/info/clearcookies.tpl';
15 
23  public function render()
24  {
26 
27  $this->_removeCookies();
28 
29  return $this->_sThisTemplate;
30  }
31 
35  protected function _removeCookies()
36  {
37  $oUtilsServer = oxRegistry::get("oxUtilsServer");
38  if (isset($_SERVER['HTTP_COOKIE'])) {
39  $aCookies = explode(';', $_SERVER['HTTP_COOKIE']);
40  foreach ($aCookies as $sCookie) {
41  $sRawCookie = explode('=', $sCookie);
42  $oUtilsServer->setOxCookie(trim($sRawCookie[0]), '', time() - 10000, '/');
43  }
44  }
45  $oUtilsServer->setOxCookie('language', '', time() - 10000, '/');
46  $oUtilsServer->setOxCookie('displayedCookiesNotification', '', time() - 10000, '/');
47  }
48 
54  public function getBreadCrumb()
55  {
56  $aPaths = array();
57  $aPath = array();
58 
59  $iBaseLanguage = oxRegistry::getLang()->getBaseLanguage();
60  $aPath['title'] = oxRegistry::getLang()->translateString('INFO_ABOUT_COOKIES', $iBaseLanguage, false);
61  $aPath['link'] = $this->getLink();
62  $aPaths[] = $aPath;
63 
64  return $aPaths;
65  }
66 }