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.

Show class?             Show args?        


boolReturns true if a TFA process is currently active 
boolDoes this TFA module support automatic enable? 
Tfa::autoEnableUser(User $user)
(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='') 
InputfieldFormBuild 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 nullGet the TFA module for given user or current session 
Tfa::getModuleConfigInputfields(InputfieldWrapper $inputfields)
(nothing)Module configuration 
stringGet translated Tfa type name (short name) 
stringGet translated Tfa type summary 
stringGet translated Tfa type title (longer name) 
UserGet current user for TFA 
Tfa::getUserEnabledInputfields(User $user, InputfieldWrapper $fieldset, array $settings)
(nothing)Get fields for when user already has TFA enabled
Tfa::getUserSettings(User $user)
arrayGet TFA data for given user from user_tfa field 
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(HookEvent $event)
(nothing)Hook after InputfieldForm::processInput() 
Tfa::hookBeforeInputfieldFormProcess(HookEvent $event)
(nothing)Hook before InputfieldForm::processInput() 
Tfa::hookInputfieldFormRender(HookEvent $event)
(nothing)Hook before InputfieldForm::render() 
(nothing)Module init 
Tfa::inputAttrs array Code <input> element attributes 
Tfa::inputLabel string Label for code <input> element 
(nothing)Module module and other assets required to execute it
Tfa::invalidCodeLabel string Invalid code error 
Tfa::isValidUserCode(User $user, $code, array $settings)
bool intReturn true if code is valid or false if not 
Tfa::maxAttemptsLabel string Max attempts error  
User boolProcess two-factor authentication code input
Tfa::processUserEnabledInputfields(User $user, InputfieldWrapper $fieldset, array $settings, array $settingsPrev)
arrayCalled when the user config fieldset has been processed (for enabled user) but before $settings have been saved
Tfa::processUserSettingsInputfields(User $user, InputfieldWrapper $fieldset, array $settings, array $settingsPrev)
arrayCalled 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. 
stringRender the code input form
Tfa::saveUserSettings(User $user, array $settings)
boolSave 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(string $name, string $pass)
boolStart 2-factor authentication
Tfa::startUrl string URL we are operating from (default='./') 
Tfa::startUser(User $user, array $settings)
boolStart two-factor authentication for User 
Tfa::submitAttrs array Submit button attributes 
Tfa::submitLabel string Label for submit button 
boolReturns true when TFA has successfully completed and user is now logged in 
Tfa::timeLimitLabel string Time limit reached error 
(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.163

Twitter updates

  • Quick weekly update covering this week's commits for the upcoming 3.0.167 ProcessWire core version— More
    18 September 2020
  • This week ProcessWire version 3.0.166 is released on the dev branch. In this post we’ll cover all that’s new relative to the previous version, 3.0.165. Plus we’ll check out the latest new versions of ProCache and FormBuilder— More
    11 September 2020
  • Weekly update – 28 August 2020 – New secure files option defined per-template: More
    28 August 2020

Latest news

  • ProcessWire Weekly #332
    In the 332nd issue of ProcessWire Weekly we'll cover the latest core updates, introduce some new and updated ProcessWire resources, and more. Read on!
    Weekly.pw / 19 September 2020
  • ProcessWire 3.0.166 core updates and more
    This week ProcessWire version 3.0.166 is released on the dev branch. In this post we’ll cover all that’s new relative to the previous version, 3.0.165. Plus we’ll check out the latest new versions of ProCache and FormBuilder.
    Blog / 11 September 2020
  • Subscribe to weekly ProcessWire news

“Yesterday I sent the client a short documentation for their ProcessWire-powered website. Today all features already used with no questions. #cmsdoneright—Marc Hinse, Web designer/developer