Class RemoteAddr

Summary

Fully Qualified Name: Zend\Session\Validator\RemoteAddr
Implements: ValidatorInterface

Description

Methods

Name Description Defined By
__construct() Constructor get the current user IP and store it in the session as 'valid data' RemoteAddr
getData() Retrieve token for validating call RemoteAddr
getName() Return validator name RemoteAddr
getUseProxy() Checks proxy handling setting. RemoteAddr
isValid() isValid() - this method will determine if the current user IP matches the IP we stored when we initialized this variable. RemoteAddr
setProxyHeader() Set the header to introspect for proxy IPs RemoteAddr
setTrustedProxies() Set list of trusted proxy addresses RemoteAddr
setUseProxy() Changes proxy handling setting. RemoteAddr

Method Details

__construct()

Constructor get the current user IP and store it in the session as 'valid data'

Parameter Name Type Description
$data null|string

Returns:

getData()

Retrieve token for validating call

Returns: string

getName()

Return validator name

Returns: string

getUseProxy()

Checks proxy handling setting.

Returns: bool Current setting value.

isValid()

isValid() - this method will determine if the current user IP matches the IP we stored when we initialized this variable.

Returns: bool

setProxyHeader()

Set the header to introspect for proxy IPs

Parameter Name Type Description
$header string

Returns: void

setTrustedProxies()

Set list of trusted proxy addresses

Parameter Name Type Description
$trustedProxies array

Returns: void

setUseProxy()

Changes proxy handling setting.

This must be static method, since validators are recovered automatically at session read, so this is the only way to switch setting.

Parameter Name Type Description
$useProxy bool Whether

Returns: void

Top