|
static | getValidationDuration ($type) |
|
static | getGreatestValidityDuration () |
|
static | tableScheme ($db_table) |
|
static | expireTableScheme () |
|
static | exists ($id) |
|
static | countBySql ($sql='1', $params=[]) |
|
static | create ($data) |
|
static | build ($data, $is_new=true) |
|
static | buildExisting ($data) |
|
static | import ($data) |
|
static | findBySQL ($sql, $params=[]) |
|
static | findOneBySQL ($where, $params=[]) |
|
static | findThru ($foreign_key_value, $options) |
|
static | findEachBySQL ($callable, $sql, $params=[]) |
|
static | findMany ($pks=[], $order='', $order_params=[]) |
|
static | findEachMany ($callable, $pks=[], $order='', $order_params=[]) |
|
static | findAndMapBySQL ($callable, $where, $params=[]) |
|
static | findAndMapMany ($callable, $pks=[], $order='', $order_params=[]) |
|
static | deleteBySQL ($where, $params=[]) |
|
static | toObject ($id_or_object) |
|
static | __callStatic (string $name, array $arguments) |
|
|
static | $schemes = null |
|
| _getId ($field) |
|
| _setId ($field, $value) |
|
| _getAdditionalValueFromRelation ($field) |
|
| _setAdditionalValueFromRelation ($field, $value) |
|
| _getAdditionalValue ($field) |
|
| _setAdditionalValue ($field, $value) |
|
| parseRelationOptions ($type, $name, $options) |
|
| storeRelations ($only_these=null) |
|
| deleteRelations () |
|
| initializeContent () |
|
| applyCallbacks ($type) |
|
| cbNotificationMapper ($cb_type) |
|
| cbAfterInitialize ($cb_type) |
|
| setSerializedValue ($field, $value) |
|
| setI18nValue ($field, $value) |
|
| $content = [] |
|
| $content_db = [] |
|
| $is_new = true |
|
| $is_deleted = false |
|
| $relations = [] |
|
| $additional_data = [] |
|
static | $config = [] |
|
static | $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id'] |
|
static | $performs_batch_operation = false |
|
◆ configure()
const static configure |
( |
|
$config = [] | ) |
|
|
staticprotected |
Configures the model.
- Parameters
-
array | $config | Configuration |
◆ getGreatestValidityDuration()
static getGreatestValidityDuration |
( |
| ) |
|
|
static |
Returns the greatest validity duration for all defined types.
- Returns
- int
◆ getProvisioningUri()
Returns the provisioning uri for this secret. Used in the qr code for apps.
- Returns
- string
◆ getToken()
getToken |
( |
|
$timestamp = null | ) |
|
Returns a token for a given timeslice.
- Parameters
-
int | $timestamp | Timeslice (optional, defaults to now) |
- Returns
- string token
◆ getValidationDuration()
static getValidationDuration |
( |
|
$type | ) |
|
|
static |
Returns the duration in seconds for which a token is valid.
- Parameters
-
- Returns
- int duration in seconds
◆ restore()
Overwrite the restore method. This ensures access to token is only valid by root accounts and the owner of the secret.
- Returns
- mixed
◆ setNew()
Overwrites the SORM setNew() method. This will create the secret string.
- Parameters
-
boolean | $is_new | State of "new" |
◆ validateToken()
validateToken |
( |
|
$token, |
|
|
|
$timestamp = null , |
|
|
|
$allow_reuse = false |
|
) |
| |
Validates a 2fa token against the secret. This will create the token again on server side and checks if it matches.
Tokens may be reused if you allow it. This is used for validation tokens stored in a cookie or session. If tokens are not allowed to be reused, they are stored in the database to prevent replay attacks.
- Parameters
-
string | $token | Token to check |
int | $timestamp | Timeslice for the token (optional, defaults to now) |
boolean | $allow_reuse | Allow reuse of the token |
- Returns
- bool
◆ TYPES
Initial value:= [
'email' => [
'window' => 60
The documentation for this class was generated from the following file: