Located in file /wire/core/Tfa.php
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Tfa
class also inherits all the methods and properties of: WireData and Wire.
Common
Name | Return | Summary | |
---|---|---|---|
Tfa::active() Tfa::active() Tfa::active() | bool | Returns true if a TFA process is currently active | |
Tfa::autoEnableSupported() Tfa::autoEnableSupported() Tfa::autoEnableSupported(User $user = null) | bool | Does this TFA module support automatic enable? | |
Tfa::autoEnableUser() Tfa::autoEnableUser(User $user) Tfa::autoEnableUser(User $user, array $settings = []) | (nothing) | Auto-enable this TFA module for given $user | |
Tfa::autoRoleIDs | array | Role IDs to enforce $autoType or blank for all roles, applies only if $autoType set (default=[]) | |
Tfa::autoType | string | Automatic/force TFA type (module name) to use when user doesn’t already have TFA enabled (default='') | |
Tfa::buildAuthCodeForm() Tfa::buildAuthCodeForm() Tfa::buildAuthCodeForm() | InputfieldForm | Build the form used for two-factor authentication | |
Tfa::cancelLabel | string | Label to use for Cancel link (default='Cancel', translatable) | |
Tfa::cancelMarkup | string | Markup to use for the cancel link that appears under auth code form, must have {url} and {label} placeholders. | |
Tfa::codeExpire | int | Codes expire after this many seconds (default=180) | |
Tfa::codeLength | int | Required length for authentication code (default=6) | |
Tfa::codeType | int | Type of TFA code to use, see codeType constants (default=0, which is Tfa::codeTypeDigits) | |
Tfa::configureLabel | string | Indicates that TFA needs to be configured | |
Tfa::enabledDescLabel | string | Describes enabled TFA and how to change settings | |
Tfa::enabledLabel | string | Indicates TFA enabled | |
Tfa::expiredCodeLabel | string | Expired code error | |
Tfa::fieldTfaTypeDescLabel | string | Description of 2-factor auth type | |
Tfa::fieldTfaTypeLabel | string | Select 2-factor auth type | |
Tfa::formAttrs | array | Form <form> element attributes | |
Tfa::getModule() Tfa::getModule() Tfa::getModule(User $user = null) | Tfa null | Get the TFA module for given user or current session | |
Tfa::getModuleConfigInputfields() Tfa::getModuleConfigInputfields(InputfieldWrapper $inputfields) Tfa::getModuleConfigInputfields(InputfieldWrapper $inputfields) | (nothing) | Module configuration | |
Tfa::getTfaTypeName() Tfa::getTfaTypeName() Tfa::getTfaTypeName() | string | Get translated Tfa type name (short name) | |
Tfa::getTfaTypeSummary() Tfa::getTfaTypeSummary() Tfa::getTfaTypeSummary() | string | Get translated Tfa type summary | |
Tfa::getTfaTypeTitle() Tfa::getTfaTypeTitle() Tfa::getTfaTypeTitle() | string | Get translated Tfa type title (longer name) | |
Tfa::getUser() Tfa::getUser() Tfa::getUser() | User | Get current user for TFA | |
Tfa::getUserEnabledInputfields() Tfa::getUserEnabledInputfields(User $user, InputfieldWrapper $fieldset, array $settings) Tfa::getUserEnabledInputfields(User $user, InputfieldWrapper $fieldset, array $settings) | (nothing) | Get fields for when user already has TFA enabled | |
Tfa::getUserSettings() Tfa::getUserSettings(User $user) Tfa::getUserSettings(User $user) | array | Get TFA data for given user from user_tfa field | |
Tfa::getUserSettingsInputfields() Tfa::getUserSettingsInputfields(User $user, InputfieldWrapper $fieldset, array $settings) Tfa::getUserSettingsInputfields(User $user, InputfieldWrapper $fieldset, array $settings) | (nothing) | Get fields needed for a user to configure and confirm TFA from their user profile | |
Tfa::hookAfterInputfieldFormProcess() Tfa::hookAfterInputfieldFormProcess(HookEvent $event) Tfa::hookAfterInputfieldFormProcess(HookEvent $event) | (nothing) | Hook after InputfieldForm::processInput() | |
Tfa::hookBeforeInputfieldFormProcess() Tfa::hookBeforeInputfieldFormProcess(HookEvent $event) Tfa::hookBeforeInputfieldFormProcess(HookEvent $event) | (nothing) | Hook before InputfieldForm::processInput() | |
Tfa::hookInputfieldFormRender() Tfa::hookInputfieldFormRender(HookEvent $event) Tfa::hookInputfieldFormRender(HookEvent $event) | (nothing) | Hook before InputfieldForm::render() | |
Tfa::init() Tfa::init() Tfa::init() | (nothing) | Module init | |
Tfa::inputAttrs | array | Code <input> element attributes | |
Tfa::inputLabel | string | Label for code <input> element | |
Tfa::install() Tfa::install() Tfa::install() | (nothing) | Module module and other assets required to execute it | |
Tfa::invalidCodeLabel | string | Invalid code error | |
Tfa::isValidUserCode() Tfa::isValidUserCode(User $user, $code, array $settings) Tfa::isValidUserCode(User $user, $code, array $settings) | bool int | Return true if code is valid or false if not | |
Tfa::maxAttemptsLabel | string | Max attempts error | |
Tfa::process() Tfa::process() Tfa::process() | User bool | Process two-factor authentication code input | |
Tfa::processUserEnabledInputfields() Tfa::processUserEnabledInputfields(User $user, InputfieldWrapper $fieldset, array $settings, array $settingsPrev) Tfa::processUserEnabledInputfields(User $user, InputfieldWrapper $fieldset, array $settings, array $settingsPrev) | array | Called when the user config fieldset has been processed (for enabled user) but before $settings have been saved | |
Tfa::processUserSettingsInputfields() Tfa::processUserSettingsInputfields(User $user, InputfieldWrapper $fieldset, array $settings, array $settingsPrev) Tfa::processUserSettingsInputfields(User $user, InputfieldWrapper $fieldset, array $settings, array $settingsPrev) | array | Called when the user config fieldset has been processed but before $settings have been saved | |
Tfa::rememberClearLabel | string | Clear remembered browsers | |
Tfa::rememberClearedLabel | string | Message after remembered browsers cleared | |
Tfa::rememberDays | int | Number of days to "remember this browser", 0 to disable option, or -1 for no limit? (default=0) | |
Tfa::rememberFingerprints | array | Fingerprints to remember: agent,agentVL,accept,scheme,host,ip,fwip (default=agentVL,accept,scheme,host) | |
Tfa::rememberLabel | string | Label for "remember this browser" option | |
Tfa::rememberSkipLabel | string | Indicates that code entry was skipped because browser is remembered | |
Tfa::rememberSuccessLabel | string | Indicates that browser has been saved/remembered for n days. | |
Tfa::render() Tfa::render() Tfa::render() | string | Render the code input form | |
Tfa::saveUserSettings() Tfa::saveUserSettings(User $user, array $settings) Tfa::saveUserSettings(User $user, array $settings) | bool | Save TFA data for given user to user_tfa field | |
Tfa::sendCodeErrorLabel | string | Error creating or sending code | |
Tfa::showCancel | bool | Show a cancel link under authentication code form? (default=true) | |
Tfa::start() Tfa::start(string $name, string $pass) Tfa::start(string $name, string $pass) | bool | Start 2-factor authentication | |
Tfa::startUrl | string | URL we are operating from (default='./') | |
Tfa::startUser() Tfa::startUser(User $user, array $settings) Tfa::startUser(User $user, array $settings) | bool | Start two-factor authentication for User | |
Tfa::submitAttrs | array | Submit button attributes | |
Tfa::submitLabel | string | Label for submit button | |
Tfa::success() Tfa::success() Tfa::success() | bool | Returns true when TFA has successfully completed and user is now logged in | |
Tfa::timeLimitLabel | string | Time limit reached error | |
Tfa::uninstall() Tfa::uninstall() Tfa::uninstall() | (nothing) | Uninstall | |
Tfa::wired() Tfa::wired() Tfa::wired() | (nothing) | Called when assigned to ProcessWire instance |
Additional methods and properties
In addition to the methods and properties above, Tfa also inherits the methods and properties of these classes:
API reference based on ProcessWire core version 3.0.236