Example #1
0
 /**
  * Returns cookie stored used login data
  *
  * @param string $sShopId shop ID (default null)
  *
  * @return string
  */
 public function getUserCookie($sShopId = null)
 {
     $myConfig = parent::getConfig();
     $sShopId = !$sShopId ? $myConfig->getShopId() : $sShopId;
     // check for SSL connection
     if (!$myConfig->isSsl() && $this->getOxCookie('oxid_' . $sShopId . '_autologin') == '1') {
         $sSslUrl = rtrim($myConfig->getSslShopUrl(), '/') . $_SERVER['REQUEST_URI'];
         if (stripos($sSslUrl, 'https') === 0) {
             oxRegistry::getUtils()->redirect($sSslUrl, true, 302);
         }
     }
     if (array_key_exists($sShopId, $this->_aUserCookie) && $this->_aUserCookie[$sShopId] !== null) {
         return $this->_aUserCookie[$sShopId] ? $this->_aUserCookie[$sShopId] : null;
     }
     return $this->_aUserCookie[$sShopId] = $this->getOxCookie('oxid_' . $sShopId);
 }