abstract class vB_HumanVerify_Abstract

Abstracted human verification class

Properties

protected string $error Error string
protected string $hash Last generated hash

Methods

boolean
delete_token(string $hash, string $answer = NULL, integer $viewed = NULL)

Deleted a Human Verification Token

array
generate_token(boolean $deletehash = true)

Generates a Random Token and stores it in the database

boolean
verify_token(array $input)

Verifies whether the HV entry was correct

mixed
fetch_error()

Returns any errors that occurred within the class

mixed
fetch_answer()

Generates an expected answer

Details

at line 99
protected boolean delete_token(string $hash, string $answer = NULL, integer $viewed = NULL)

Deleted a Human Verification Token

Parameters

string $hash The hash to delete
string $answer The Corresponding Option
integer $viewed Whether the token has been viewd

Return Value

boolean Was anything deleted?

at line 135
array generate_token(boolean $deletehash = true)

Generates a Random Token and stores it in the database

Parameters

boolean $deletehash Delete the previous hash generated

Return Value

array an array consisting of the hash, and the answer

at line 166
boolean verify_token(array $input)

Verifies whether the HV entry was correct

Parameters

array $input An array consisting of the hash, and the inputted answer

Return Value

boolean

at line 177
mixed fetch_error()

Returns any errors that occurred within the class

Return Value

mixed

at line 188
protected mixed fetch_answer()

Generates an expected answer

Return Value

mixed