abstract class base implements plugin_interface

Properties

protected config $config
protected driver_interface $db
protected language $language
protected request_interface $request
protected user $user
protected int $attempts
protected string $code
protected bool $solved
protected string $confirm_code
protected string $confirm_id
protected confirm_type $type
protected string $last_error

Methods

__construct(config $config, driver_interface $db, language $language, request_interface $request, user $user)

Constructor for abstract captcha base class

void
init(confirm_type $type)

Display the captcha for the specified type

bool
validate()

Validate the captcha with the given request data

void
reset()

Reset captcha state, e.g. after checking if it's valid

int
get_attempt_count()

Get attempt count for this captcha and user

bool
load_confirm_data()

Look up attempts from confirm table

void
generate_confirm_data()

Generate confirm data for tracking attempts

void
increment_attempts()

Increment number of attempts for confirm ID and session

array
get_hidden_fields()

Get hidden form fields for this captcha plugin

bool
is_solved()

Return whether captcha was solved

string
get_error()

Get error string from captcha

void
garbage_collect(confirm_type $confirm_type = confirm_type::UNDEFINED)

No description

void
acp_page(mixed $id, mixed $module)

Display acp page

Details

at line 69
__construct(config $config, driver_interface $db, language $language, request_interface $request, user $user)

Constructor for abstract captcha base class

Parameters

config $config
driver_interface $db
language $language
request_interface $request
user $user

at line 81
void init(confirm_type $type)

Display the captcha for the specified type

Parameters

confirm_type $type

Type of captcha, should be one of the CONFIRMATION_* constants

Return Value

void

at line 97
bool validate()

Validate the captcha with the given request data

Return Value

bool

True if request data was valid captcha reply, false if not

at line 113
void reset()

Reset captcha state, e.g. after checking if it's valid

Return Value

void

at line 126
int get_attempt_count()

Get attempt count for this captcha and user

Return Value

int

Number of attempts

at line 134
protected bool load_confirm_data()

Look up attempts from confirm table

Return Value

bool

at line 161
protected void generate_confirm_data()

Generate confirm data for tracking attempts

Return Value

void

at line 181
protected void increment_attempts()

Increment number of attempts for confirm ID and session

Return Value

void

at line 195
array get_hidden_fields()

Get hidden form fields for this captcha plugin

Return Value

array

Hidden form fields

at line 206
bool is_solved()

Return whether captcha was solved

Return Value

bool

True if captcha was solved, false if not

at line 214
string get_error()

Get error string from captcha

Return Value

string

Error string, empty string if there is no error

at line 222
void garbage_collect(confirm_type $confirm_type = confirm_type::UNDEFINED)

No description

Parameters

confirm_type $confirm_type

Confirm type to garbage collect, defaults to all (0)

Return Value

void

at line 253
void acp_page(mixed $id, mixed $module)

Display acp page

Parameters

mixed $id

ACP module id

mixed $module

ACP module name

Return Value

void