Settings_BruteForce_Module_Model
extends Settings_Vtiger_Module_Model
in package
Brute force model class.
Tags
Table of Contents
- BLOCKED = 1
- UNBLOCKED = 0
- UNBLOCKED_BY_USER = 2
- $blockedId : mixed
- $isBlocked : mixed
- getAdminUsers() : array<string|int, mixed>
- Function returns a list of users who are administrators.
- getBlockedIp() : array<string|int, mixed>
- Function gets unsuccessful login attempts data of blocked users.
- getBruteForceSettings() : array<string|int, mixed>
- Function returns module configuration.
- getCleanInstance() : Settings_BruteForce_Module_Model
- Function includes class instances.
- getLoginHistoryData() : array<string|int, mixed>
- Functions gets data from login history.
- getUsersForNotifications() : array<string|int, mixed>
- Function returns table of users selected for notifications.
- incAttempts() : mixed
- Function increases the number of unsuccessful login attempts.
- isActive() : bool
- Function verifies if module is active.
- isBlockedIp() : bool
- Function verifies if user is blocked.
- sendNotificationEmail() : mixed
- Function sends notifications.
- unBlock() : mixed
- Function unblocks user.
- updateBlockedIp() : mixed
- Function updates unsuccessful login attempts.
- updateConfig() : mixed
- Function updates module configuration.
- clearBlockedByIp() : mixed
- Function removes redundant entries from database.
- setBlockedIp() : int
- Function adds unsuccessful login attempt to database.
Constants
BLOCKED
public
mixed
BLOCKED
= 1
UNBLOCKED
public
mixed
UNBLOCKED
= 0
UNBLOCKED_BY_USER
public
mixed
UNBLOCKED_BY_USER
= 2
Properties
$blockedId
private
mixed
$blockedId
$isBlocked
private
mixed
$isBlocked
Methods
getAdminUsers()
Function returns a list of users who are administrators.
public
static getAdminUsers() : array<string|int, mixed>
Return values
array<string|int, mixed> —- List of users
getBlockedIp()
Function gets unsuccessful login attempts data of blocked users.
public
getBlockedIp() : array<string|int, mixed>
Return values
array<string|int, mixed> —getBruteForceSettings()
Function returns module configuration.
public
static getBruteForceSettings() : array<string|int, mixed>
Return values
array<string|int, mixed> —getCleanInstance()
Function includes class instances.
public
static getCleanInstance() : Settings_BruteForce_Module_Model
Return values
Settings_BruteForce_Module_Model —getLoginHistoryData()
Functions gets data from login history.
public
getLoginHistoryData(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Return values
array<string|int, mixed> —getUsersForNotifications()
Function returns table of users selected for notifications.
public
static getUsersForNotifications() : array<string|int, mixed>
Return values
array<string|int, mixed> —- ID list of users
incAttempts()
Function increases the number of unsuccessful login attempts.
public
incAttempts() : mixed
Return values
mixed —isActive()
Function verifies if module is active.
public
isActive() : bool
Return values
bool —isBlockedIp()
Function verifies if user is blocked.
public
isBlockedIp() : bool
Return values
bool —sendNotificationEmail()
Function sends notifications.
public
sendNotificationEmail() : mixed
Return values
mixed —unBlock()
Function unblocks user.
public
static unBlock(int $id) : mixed
Parameters
- $id : int
-
- Record ID
Return values
mixed —updateBlockedIp()
Function updates unsuccessful login attempts.
public
updateBlockedIp() : mixed
Return values
mixed —updateConfig()
Function updates module configuration.
public
static updateConfig(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
- Configuration data
Return values
mixed —clearBlockedByIp()
Function removes redundant entries from database.
private
clearBlockedByIp(string $ip, string $data) : mixed
Parameters
- $ip : string
-
- User IP
- $data : string
-
- Cut-off date of users block condition
Return values
mixed —setBlockedIp()
Function adds unsuccessful login attempt to database.
private
setBlockedIp(string $ip) : int
Parameters
- $ip : string
-
- User IP
Return values
int —- Created records ID