OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxUtilsServer Class Reference
+ Inheritance diagram for oxUtilsServer:
+ Collaboration diagram for oxUtilsServer:

Public Member Functions

 setOxCookie ($sName, $sValue="", $iExpire=0, $sPath= '/', $sDomain=null, $blToSession=true, $blSecure=false)
 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)
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 __construct ()
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Static Public Member Functions

static getInstance ()

Protected Member Functions

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

Protected Attributes

 $_aUserCookie = array()
 $_sSessionCookiesName = 'aSessionCookies'
 $_sSessionCookies = array()
 $_blSaveToSession = null

Static Private Attributes

static $_instance = null

Additional Inherited Members

- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

Server data manipulation class

Definition at line 6 of file oxutilsserver.php.

Member Function Documentation

oxUtilsServer::_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

Definition at line 215 of file oxutilsserver.php.

oxUtilsServer::_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

Definition at line 193 of file oxutilsserver.php.

oxUtilsServer::_getSessionCookieKey (   $blGet)
protected

Returns session cookie key

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

Definition at line 125 of file oxutilsserver.php.

oxUtilsServer::_mustSaveToSession ( )
protected

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

Returns
bool

Definition at line 95 of file oxutilsserver.php.

oxUtilsServer::_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
Returns
null

Definition at line 148 of file oxutilsserver.php.

oxUtilsServer::deleteUserCookie (   $sShopId = null)

Deletes user cookie data

Parameters
string$sShopIdshop ID (default null)
Returns
null

Definition at line 324 of file oxutilsserver.php.

static oxUtilsServer::getInstance ( )
static

Returns server utils instance

Deprecated:
since v5.0 (2012-08-10); Use oxRegistry::get("oxUtilsServer") instead.
Returns
oxUtilsServer

Definition at line 43 of file oxutilsserver.php.

oxUtilsServer::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

Definition at line 239 of file oxutilsserver.php.

oxUtilsServer::getRemoteAddress ( )

Returns remote IP address

Returns
string

Definition at line 257 of file oxutilsserver.php.

oxUtilsServer::getServerVar (   $sServVar = null)

returns a server constant

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

Definition at line 277 of file oxutilsserver.php.

oxUtilsServer::getUserCookie (   $sShopId = null)

Returns cookie stored used login data

Parameters
string$sShopIdshop ID (default null)
Returns
string

Definition at line 347 of file oxutilsserver.php.

oxUtilsServer::isCurrentUrl (   $sURL)

Compares current URL to supplied string

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

Definition at line 405 of file oxutilsserver.php.

oxUtilsServer::isTrustedClientIp ( )

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

Returns
bool

Definition at line 372 of file oxutilsserver.php.

oxUtilsServer::loadSessionCookies ( )

Stored all session cookie info to cookies

Returns
mixed

Definition at line 165 of file oxutilsserver.php.

oxUtilsServer::processUserAgentInfo (   $sAgent)

Removes MSIE()?()*() from browser agent information

Parameters
string$sAgentbrowser user agent idenfitier
Returns
string

Definition at line 390 of file oxutilsserver.php.

oxUtilsServer::setOxCookie (   $sName,
  $sValue = "",
  $iExpire = 0,
  $sPath = '/',
  $sDomain = null,
  $blToSession = true,
  $blSecure = false 
)

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
Returns
bool

Definition at line 61 of file oxutilsserver.php.

oxUtilsServer::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
Returns
null

Definition at line 301 of file oxutilsserver.php.

Member Data Documentation

oxUtilsServer::$_aUserCookie = array()
protected

Definition at line 20 of file oxutilsserver.php.

oxUtilsServer::$_blSaveToSession = null
protected

Definition at line 88 of file oxutilsserver.php.

oxUtilsServer::$_instance = null
staticprivate

Definition at line 13 of file oxutilsserver.php.

oxUtilsServer::$_sSessionCookies = array()
protected

Definition at line 34 of file oxutilsserver.php.

oxUtilsServer::$_sSessionCookiesName = 'aSessionCookies'
protected

Definition at line 27 of file oxutilsserver.php.


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