ProcessLogin class

Login to ProcessWire

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the ProcessLogin class also inherits all the methods and properties of: Process, WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
ProcessLogin::allowEmail bool int Whether or not email login is allowed (0|false=off, 1|true=Yes, 2=Yes or name also allowed) 
ProcessLogin::allowForgot bool Whether the ProcessForgotPassword module is installed. 
ProcessLogin::emailField string Field name used for email login (when enabled).  
ProcessLogin::execute()
stringCheck if login posted and attempt login, otherwise render the login form
ProcessLogin::executeLogout()
stringLog the user out
ProcessLogin::getBeforeLoginVars()
arrayGet validated/sanitized variables in the query string for not logged-in user to retain after login
ProcessLogin::getTfa()
null TfaGet Tfa instance or null if not applicable 
ProcessLogin::getTfaConfigInputfields()
InputfieldFieldsetGet Inputfields to configure Tfa settings 
ProcessLogin::labels(string $name)
stringGet or set named label text 
ProcessLogin::login(string $name, string $pass)
boolPerform login and redirect on success
ProcessLogin::markup(string $name)
stringGet or set custom markup 
ProcessLogin::setLoginURL($url)
$thisSet URL to redirect to after login success 
ProcessLogin::setLogoutURL($url)
$thisSet URL to redirect to after logout success 
ProcessLogin::tfaAutoRoleIDs array Auto-enable for these role IDs, or blank for all roles. Applies only if $tfaAutoType selected (default=[]) 
ProcessLogin::tfaAutoType string Auto-enable type, aka module name (default='') 
ProcessLogin::tfaRecRoleIDs array Role IDs where admin prompts/recommends them to enable TFA. 
ProcessLogin::tfaRememberDays int Allow user to remember their browser and bypass TFA for this many days (-1=no limit, 0=disabled) 
ProcessLogin::tfaRememberFingerprints array Means by which to fingerprint user’s browser 
ProcessLogin::useEmailLogin()
bool intUse login by email? 

For hooks

These methods are only useful for hooking and should not be called directly.

NameReturnSummary 
ProcessLogin::afterLogin()
(nothing)
ProcessLogin::afterLoginOutput()
string
ProcessLogin::afterLoginRedirect()
(nothing)
ProcessLogin::afterLoginURL()
string
ProcessLogin::beforeLogin()
(nothing)
ProcessLogin::buildLoginForm()
InputfieldForm
ProcessLogin::executeLoggedOut()
string
ProcessLogin::getLoginLinks()
arrayGet array of links to display under login form
ProcessLogin::loginAttemptReady(string $name)
(nothing)Hook called right before a login is attempted
ProcessLogin::loginAttempted($user, string $name)
(nothing)Hook called immediately after a login was attempted
ProcessLogin::loginFailed($name)
(nothing)
ProcessLogin::loginFormProcessReady(InputfieldForm $form)
(nothing)Hook called immediately before the login form in processed
ProcessLogin::loginFormProcessed(InputfieldForm $form, string $name)
(nothing)Hook called immediately after login form processed and user name/pass identified as present
ProcessLogin::loginSuccess(User $user)
(nothing)
ProcessLogin::renderLoginForm()
string
ProcessLogin::renderLoginLinks()
string

Additional methods and properties

In addition to the methods and properties above, ProcessLogin also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #546
    In the 546th issue of ProcessWire Weekly we'll cover the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 26 October 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK