IpLocker
Handles the locking of sessions to IP addresses.
Table of Contents
Constants
- DISABLED_LOCK_VALUE = '[DISABLED]'
Properties
- $lockIPv4PartCount : int
- If set to 4, the session will be locked to the user's IP address (all four numbers).
- $lockIPv6PartCount : int
- Same setting as lockIP but for IPv6 addresses.
Methods
- __construct() : mixed
- getSessionIpLock() : string
- validateRemoteAddressAgainstSessionIpLock() : bool
- getIpLockPart() : string
- getIpLockPartForIpv4Address() : string
- getIpLockPartForIpv6Address() : string
- isIpv6Address() : bool
Constants
DISABLED_LOCK_VALUE
public
mixed
DISABLED_LOCK_VALUE
= '[DISABLED]'
Properties
$lockIPv4PartCount
If set to 4, the session will be locked to the user's IP address (all four numbers).
protected
int
$lockIPv4PartCount
= 4
Reducing this to 1-3 means that only the given number of parts of the IP address is used.
$lockIPv6PartCount
Same setting as lockIP but for IPv6 addresses.
protected
int
$lockIPv6PartCount
= 8
Methods
__construct()
public
__construct(int $lockIPv4PartCount, int $lockIPv6PartCount) : mixed
Parameters
- $lockIPv4PartCount : int
- $lockIPv6PartCount : int
getSessionIpLock()
public
getSessionIpLock(string $ipAddress) : string
Parameters
- $ipAddress : string
Return values
stringvalidateRemoteAddressAgainstSessionIpLock()
public
validateRemoteAddressAgainstSessionIpLock(string $ipAddress, string $sessionIpLock) : bool
Parameters
- $ipAddress : string
- $sessionIpLock : string
Return values
boolgetIpLockPart()
protected
getIpLockPart(string $ipAddress, int $numberOfParts, int $maxParts, string $delimiter) : string
Parameters
- $ipAddress : string
- $numberOfParts : int
- $maxParts : int
- $delimiter : string
Return values
stringgetIpLockPartForIpv4Address()
protected
getIpLockPartForIpv4Address(string $ipAddress) : string
Parameters
- $ipAddress : string
Return values
stringgetIpLockPartForIpv6Address()
protected
getIpLockPartForIpv6Address(string $ipAddress) : string
Parameters
- $ipAddress : string
Return values
stringisIpv6Address()
protected
isIpv6Address(string $ipAddress) : bool
Parameters
- $ipAddress : string