class IPService implements LoggerAwareInterface (View source)

deprecated check single methods to see the non-deprecated alternatives

Traits

Trait LoggerAwareTrait A trait used with LoggerAwareInterface

LoggerAwareTrait

Constants

deprecated IPRANGEFLAG_BLACKLIST

deprecated IPRANGEFLAG_WHITELIST

deprecated IPRANGEFLAG_MANUAL

deprecated IPRANGEFLAG_AUTOMATIC

deprecated IPRANGETYPE_BLACKLIST_MANUAL

deprecated IPRANGETYPE_BLACKLIST_AUTOMATIC

deprecated IPRANGETYPE_WHITELIST_MANUAL

Properties

protected Repository $config
protected Connection $connection
protected Request $request

Methods

getLoggerChannel()

No description

__construct(Repository $config, Connection $connection, Request $request)

No description

AddressInterface
getRequestIPAddress() deprecated

No description

bool
isBlacklisted(AddressInterface $ip = null) deprecated

No description

bool
isWhitelisted(AddressInterface $ip = null) deprecated

No description

string
getErrorMessage() deprecated

No description

logFailedLogin(AddressInterface $ip = null, bool $ignoreConfig = false) deprecated

No description

bool
failedLoginsThresholdReached(AddressInterface $ip = null, bool $ignoreConfig = false) deprecated

No description

addToBlacklistForThresholdReached(AddressInterface $ip = null, bool $ignoreConfig = false) deprecated

No description

createRange(RangeInterface $range, int $type, DateTime $expiration = null) deprecated

No description

getRanges(int $type, bool $includeExpired = false) deprecated

No description

IPRange|null
getRangeByID(int $id) deprecated

No description

deleteRange(IPRange|int $range) deprecated

No description

int
deleteFailedLoginAttempts(int|null $maxAge = null) deprecated

No description

int
deleteAutomaticBlacklist(bool $onlyExpired = true)

Clear the IP addresses automatically blacklisted.

getRequestIP() deprecated

No description

isBanned(mixed $ip = false) deprecated

No description

createIPBan(mixed $ip = false, mixed $ignoreConfig = false)

  • @deprecated use $app->make('failed_login')->addToBlacklistForThresholdReached()

logSignupRequest(bool $ignoreConfig = false) deprecated

No description

signupRequestThreshholdReached(bool $ignoreConfig = false) deprecated

No description

signupRequestThresholdReached(bool $ignoreConfig = false) deprecated

No description

int|null
getRangeType(AddressInterface $ip) deprecated

No description

Details

getLoggerChannel()

__construct(Repository $config, Connection $connection, Request $request)

No description

Parameters

Repository $config
Connection $connection
Request $request

AddressInterface getRequestIPAddress() deprecated

deprecated Use $app->make(\IPLib\Address\AddressInterface::class)

No description

Return Value

AddressInterface

bool isBlacklisted(AddressInterface $ip = null) deprecated

deprecated use $app->make('failed_login')->isBlacklisted()

No description

Parameters

AddressInterface $ip

Return Value

bool

bool isWhitelisted(AddressInterface $ip = null) deprecated

deprecated use $app->make('failed_login')->isWhitelisted()

No description

Parameters

AddressInterface $ip

Return Value

bool

string getErrorMessage() deprecated

deprecated use $app->make('failed_login')->getErrorMessage()

No description

Return Value

string

logFailedLogin(AddressInterface $ip = null, bool $ignoreConfig = false) deprecated

deprecated use $app->make('failed_login')->registerEvent()

No description

Parameters

AddressInterface $ip
bool $ignoreConfig

bool failedLoginsThresholdReached(AddressInterface $ip = null, bool $ignoreConfig = false) deprecated

deprecated use $app->make('failed_login')->isThresholdReached()

No description

Parameters

AddressInterface $ip
bool $ignoreConfig

Return Value

bool

addToBlacklistForThresholdReached(AddressInterface $ip = null, bool $ignoreConfig = false) deprecated

deprecated use $app->make('failed_login')->addToBlacklistForThresholdReached()

No description

Parameters

AddressInterface $ip
bool $ignoreConfig

IPRange createRange(RangeInterface $range, int $type, DateTime $expiration = null) deprecated

deprecated use $app->make('failed_login')->createRange()

No description

Parameters

RangeInterface $range
int $type
DateTime $expiration

Return Value

IPRange

IPRange[]|Generator getRanges(int $type, bool $includeExpired = false) deprecated

deprecated use $app->make('failed_login')->getRanges()

No description

Parameters

int $type

(one of the IPService::IPRANGETYPE_... constants)

bool $includeExpired

Include expired records?

Return Value

IPRange[]|Generator

IPRange|null getRangeByID(int $id) deprecated

deprecated use $app->make('failed_login')->getRangeByID()

No description

Parameters

int $id

Return Value

IPRange|null

deleteRange(IPRange|int $range) deprecated

deprecated use $app->make('failed_login')->deleteRange()

No description

Parameters

IPRange|int $range

int deleteFailedLoginAttempts(int|null $maxAge = null) deprecated

deprecated use $app->make('failed_login')->deleteEvents()

No description

Parameters

int|null $maxAge

Return Value

int

int deleteAutomaticBlacklist(bool $onlyExpired = true)

Clear the IP addresses automatically blacklisted.

Parameters

bool $onlyExpired

Clear only the expired bans?

Return Value

int

IPAddress getRequestIP() deprecated

deprecated Use $app->make(\IPLib\Address\AddressInterface::class)

No description

Return Value

IPAddress

isBanned(mixed $ip = false) deprecated

deprecated use $app->make('failed_login')->isBlacklisted()

No description

Parameters

mixed $ip

createIPBan(mixed $ip = false, mixed $ignoreConfig = false)

  • @deprecated use $app->make('failed_login')->addToBlacklistForThresholdReached()

Parameters

mixed $ip
mixed $ignoreConfig

logSignupRequest(bool $ignoreConfig = false) deprecated

deprecated use $app->make('failed_login')->registerEvent()

No description

Parameters

bool $ignoreConfig

signupRequestThreshholdReached(bool $ignoreConfig = false) deprecated

deprecated use $app->make('failed_login')->isThresholdReached()

No description

Parameters

bool $ignoreConfig

signupRequestThresholdReached(bool $ignoreConfig = false) deprecated

deprecated use $app->make('failed_login')->isThresholdReached()

No description

Parameters

bool $ignoreConfig

protected int|null getRangeType(AddressInterface $ip) deprecated

deprecated use $app->make('failed_login')->getRangeType()

No description

Parameters

AddressInterface $ip

Return Value

int|null

private IpAccessControlService getFailedLoginService()

No description

Return Value

IpAccessControlService