OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Core\UtilsServer Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Core\UtilsServer:
+ Collaboration diagram for OxidEsales\EshopCommunity\Core\UtilsServer:

Public Member Functions

 setOxCookie ($sName, $sValue="", $iExpire=0, $sPath='/', $sDomain=null, $blToSession=true, $blSecure=false, $blHttpOnly=true)
 
 loadSessionCookies ()
 
 getOxCookie ($sName=null)
 
 getRemoteAddress ()
 
 getServerVar ($sServVar=null)
 
 setUserCookie ($sUser, $sPassword, $sShopId=null, $iTimeout=31536000, $sSalt='ox')
 
 deleteUserCookie ($sShopId=null)
 
 getUserCookie ($sShopId=null)
 
 isTrustedClientIp ()
 
 processUserAgentInfo ($sAgent)
 
 isCurrentUrl ($sURL)
 
 _isCurrentUrl ($sURL, $sServerHost)
 
 getServerNodeId ()
 
 getServerIp ()
 

Protected Member Functions

 _mustSaveToSession ()
 
 _getSessionCookieKey ($blGet)
 
 _saveSessionCookie ($sName, $sValue, $iExpire, $sPath, $sDomain)
 
 _getCookiePath ($sPath)
 
 _getCookieDomain ($sDomain)
 

Protected Attributes

 $_aUserCookie = []
 
 $_sSessionCookiesName = 'aSessionCookies'
 
 $_sSessionCookies = []
 
 $_blSaveToSession = null
 

Private Member Functions

 getServerName ()
 

Detailed Description

Server data manipulation class

Member Function Documentation

◆ _getCookieDomain()

OxidEsales\EshopCommunity\Core\UtilsServer::_getCookieDomain (   $sDomain)
protected

Returns domain that cookie available. If user did not set domain, or set it to null, according to php documentation empty string will be returned, marking to skip argument. Additionally domain can be defined in config.inc.php file as "sCookieDomain" param. Please check cookie documentation for more details about current parameter

Parameters
string$sDomainthe domain that the cookie is available.
Returns
string

◆ _getCookiePath()

OxidEsales\EshopCommunity\Core\UtilsServer::_getCookiePath (   $sPath)
protected

Returns cookie path. If user did not set path, or set it to null, according to php documentation empty string will be returned, marking to skip argument. Additionally path can be defined in config.inc.php file as "sCookiePath" param. Please check cookie documentation for more details about current parameter

Parameters
string$sPathuser defined cookie path
Returns
string

◆ _getSessionCookieKey()

OxidEsales\EshopCommunity\Core\UtilsServer::_getSessionCookieKey (   $blGet)
protected

Returns session cookie key

Parameters
bool$blGetmode - true - get, false - set cookie
Returns
string

◆ _isCurrentUrl()

OxidEsales\EshopCommunity\Core\UtilsServer::_isCurrentUrl (   $sURL,
  $sServerHost 
)

Check if the given URL is same as used for request. The URL in this context is the base address for the shop e.g. https://www.domain.com/shop/ the protocol is optional (www.domain.com/shop/) but the protocol relative syntax (//www.domain.com/shop/) is not yet supported.

Parameters
string$sURLURL to check if is same as request.
string$sServerHostrequest host.
Returns
bool true if $sURL is equal to current page URL

◆ _mustSaveToSession()

OxidEsales\EshopCommunity\Core\UtilsServer::_mustSaveToSession ( )
protected

Checks if cookie must be saved to session in order to transfer it to different domain

Returns
bool

◆ _saveSessionCookie()

OxidEsales\EshopCommunity\Core\UtilsServer::_saveSessionCookie (   $sName,
  $sValue,
  $iExpire,
  $sPath,
  $sDomain 
)
protected

Copies cookie info to session

Parameters
string$sNamecookie name
string$sValuecookie value
int$iExpireexpiration time
string$sPathcookie path
string$sDomaincookie domain

◆ deleteUserCookie()

OxidEsales\EshopCommunity\Core\UtilsServer::deleteUserCookie (   $sShopId = null)

Deletes user cookie data

Parameters
string$sShopIdshop ID (default null)

◆ getOxCookie()

OxidEsales\EshopCommunity\Core\UtilsServer::getOxCookie (   $sName = null)

Returns cookie $sName value. If optional parameter $sName is not set then getCookie() returns whole cookie array

Parameters
string$sNamecookie param name
Returns
mixed

◆ getRemoteAddress()

OxidEsales\EshopCommunity\Core\UtilsServer::getRemoteAddress ( )

Returns remote IP address

Returns
string

◆ getServerIp()

OxidEsales\EshopCommunity\Core\UtilsServer::getServerIp ( )

Return local machine ip.

Returns
string

◆ getServerName()

OxidEsales\EshopCommunity\Core\UtilsServer::getServerName ( )
private

Return server system parameter similar as unix uname.

Returns
string

◆ getServerNodeId()

OxidEsales\EshopCommunity\Core\UtilsServer::getServerNodeId ( )

Return server id by server system information.

Returns
string

◆ getServerVar()

OxidEsales\EshopCommunity\Core\UtilsServer::getServerVar (   $sServVar = null)

returns a server constant

Parameters
string$sServVaroptional - which server var should be returned, if null returns whole $_SERVER
Returns
mixed

◆ getUserCookie()

OxidEsales\EshopCommunity\Core\UtilsServer::getUserCookie (   $sShopId = null)

Returns cookie stored used login data

Parameters
string$sShopIdshop ID (default null)
Returns
string

◆ isCurrentUrl()

OxidEsales\EshopCommunity\Core\UtilsServer::isCurrentUrl (   $sURL)

Compares current URL to supplied string

Parameters
string$sURLURL
Returns
bool true if $sURL is equal to current page URL

◆ isTrustedClientIp()

OxidEsales\EshopCommunity\Core\UtilsServer::isTrustedClientIp ( )

Checks if current client ip is in trusted IPs list. IP list is defined in config file as "aTrustedIPs" parameter

Returns
bool

◆ loadSessionCookies()

OxidEsales\EshopCommunity\Core\UtilsServer::loadSessionCookies ( )

Stored all session cookie info to cookies

◆ processUserAgentInfo()

OxidEsales\EshopCommunity\Core\UtilsServer::processUserAgentInfo (   $sAgent)

Removes MSIE(\s)?(\S)*(\s) from browser agent information

Parameters
string$sAgentbrowser user agent idenfitier
Returns
string

◆ setOxCookie()

OxidEsales\EshopCommunity\Core\UtilsServer::setOxCookie (   $sName,
  $sValue = "",
  $iExpire = 0,
  $sPath = '/',
  $sDomain = null,
  $blToSession = true,
  $blSecure = false,
  $blHttpOnly = true 
)

sets cookie

Parameters
string$sNamecookie name
string$sValuevalue
int$iExpireexpire time
string$sPathThe path on the server in which the cookie will be available on
string$sDomainThe domain that the cookie is available.
bool$blToSessionis true, records cookie information to session
bool$blSecureif true, transfer cookie only via SSL
bool$blHttpOnlyif true, only accessible via HTTP
Returns
bool

◆ setUserCookie()

OxidEsales\EshopCommunity\Core\UtilsServer::setUserCookie (   $sUser,
  $sPassword,
  $sShopId = null,
  $iTimeout = 31536000,
  $sSalt = 'ox' 
)

Sets user info into cookie

Parameters
string$sUseruser ID
string$sPasswordpassword
string$sShopIdshop ID (default null)
integer$iTimeouttimeout value (default 31536000)
string$sSaltSalt for password encryption

Member Data Documentation

◆ $_aUserCookie

OxidEsales\EshopCommunity\Core\UtilsServer::$_aUserCookie = []
protected

◆ $_blSaveToSession

OxidEsales\EshopCommunity\Core\UtilsServer::$_blSaveToSession = null
protected

◆ $_sSessionCookies

OxidEsales\EshopCommunity\Core\UtilsServer::$_sSessionCookies = []
protected

◆ $_sSessionCookiesName

OxidEsales\EshopCommunity\Core\UtilsServer::$_sSessionCookiesName = 'aSessionCookies'
protected

The documentation for this class was generated from the following file: