IDS PHP Libraries

BlockManager
in package
uses Loggable

Table of Contents

Properties

$blockExpiresDate  : string
$database  : Database|null
$failMessages  : array<string|int, mixed>
$isBlockingEnabled  : bool
$isWhitelistEnabled  : bool
$logger  : object|null
$shopEnv  : ShopEnv
$user  : User

Methods

__construct()  : mixed
blockUser()  : void
createTables()  : void
Check if needed tables exist and create them if not
formatBlockDurationMsg()  : string
getBlockDurationLeft()  : int
initialize()  : void
isUserBlocked()  : bool
log()  : void
queryRestrictions()  : array<string|int, mixed>
setBlockingSettings()  : void
setFailMessages()  : void

Properties

$failMessages

private array<string|int, mixed> $failMessages = []

$isBlockingEnabled

private bool $isBlockingEnabled = true

$isWhitelistEnabled

private bool $isWhitelistEnabled = true

$logger

private object|null $logger = null

Methods

blockUser()

public blockUser([float $duration = 600 ][, string $reason = 'risk_score_too_high' ][, string $origin = '' ][, string $info = '' ]) : void
Parameters
$duration : float = 600
$reason : string = 'risk_score_too_high'
$origin : string = ''
$info : string = ''

createTables()

Check if needed tables exist and create them if not

public createTables() : void

formatBlockDurationMsg()

public formatBlockDurationMsg(int $blockDurationLeftSeconds[, array<string|int, mixed> $failMessages = [] ]) : string
Parameters
$blockDurationLeftSeconds : int
$failMessages : array<string|int, mixed> = []
Return values
string

getBlockDurationLeft()

public getBlockDurationLeft() : int
Return values
int

isUserBlocked()

public isUserBlocked() : bool
Return values
bool

log()

public log([mixed $message = '' ][, string $level = 'info' ][, mixed $backtrace = null ][, int $spacing = 0 ]) : void
Parameters
$message : mixed = ''
$level : string = 'info'
$backtrace : mixed = null
$spacing : int = 0

queryRestrictions()

public queryRestrictions([string $ip = '' ][, string $user = '' ]) : array<string|int, mixed>
Parameters
$ip : string = ''
$user : string = ''
Return values
array<string|int, mixed>

setBlockingSettings()

public setBlockingSettings(array{SECURITY_BLOCKING_ENABLED?: bool, SECURITY_WHITELIST_ENABLED?: bool} $settings) : void
Parameters
$settings : array{SECURITY_BLOCKING_ENABLED?: bool, SECURITY_WHITELIST_ENABLED?: bool}

setFailMessages()

public setFailMessages(array<string|int, mixed> $failMessages) : void
Parameters
$failMessages : array<string|int, mixed>

        
On this page

Search results