FacturaScripts

IPFilter extends IPFilter

Class created by Core/Base/PluginManager

Table of Contents

$filePath Path of the file with the list. string
$ipList Contains IP addresses. array
__construct() IPFilter constructor. mixed
clear() Clean the list of IP addresses and save the data. mixed
getClientIp() Returns true client IP address. string
isBanned() Returns true if attempts to access from the IP address exceed the MAX_ATTEMPTS limit. bool
setAttempt() Add or increase the attempt counter of the provided IP address. mixed
readFile() Reads file and load IP addresses. mixed
readIp() Load the IP addresses in the ipList array mixed
save() Stores the list of IP addresses in the file. mixed

Properties

$filePath

Path of the file with the list.

private string $filePath

$ipList

Contains IP addresses.

private array $ipList

Methods

__construct()

IPFilter constructor.

public __construct( ) : mixed
Return values
mixed

clear()

Clean the list of IP addresses and save the data.

public clear( ) : mixed
Return values
mixed

getClientIp()

Returns true client IP address.

public static getClientIp( ) : string
Return values
string

isBanned()

Returns true if attempts to access from the IP address exceed the MAX_ATTEMPTS limit.

public isBanned( $ip : string ) : bool
Parameters
$ip : string
Return values
bool

setAttempt()

Add or increase the attempt counter of the provided IP address.

public setAttempt( $ip : string ) : mixed
Parameters
$ip : string
Return values
mixed

readFile()

Reads file and load IP addresses.

private readFile( ) : mixed
Return values
mixed

readIp()

Load the IP addresses in the ipList array

private readIp( $line : array ) : mixed
Parameters
$line : array
Return values
mixed

save()

Stores the list of IP addresses in the file.

private save( ) : mixed
Return values
mixed

Search results