MediaWiki  1.33.0
OATHAuthHooks Class Reference

Hooks for Extension:OATHAuth. More...

Static Public Member Functions

static getOATHUserRepository ()
 Get the singleton OATH user repository. More...
 
static onAuthChangeFormFields (array $requests, array $fieldInfo, array &$formDescriptor, $action)
 
static onGetPreferences (User $user, array &$preferences)
 Add the necessary user preferences for OATHAuth. More...
 
static onLoadExtensionSchemaUpdates ( $updater)
 
static onTwoFactorIsEnabled (&$isEnabled)
 Determine if two-factor authentication is enabled for $wgUser. More...
 
static schemaUpdateOldUsers (IDatabase $db)
 Helper function for converting old users to the new schema. More...
 
static schemaUpdateOldUsersFromInstaller (DatabaseUpdater $updater)
 Helper function for converting old users to the new schema. More...
 

Detailed Description

Hooks for Extension:OATHAuth.

Definition at line 28 of file OATHAuthHooks.php.

Member Function Documentation

◆ getOATHUserRepository()

◆ onAuthChangeFormFields()

static OATHAuthHooks::onAuthChangeFormFields ( array  $requests,
array  $fieldInfo,
array $formDescriptor,
  $action 
)
static
Parameters
AuthenticationRequest[]$requests
array$fieldInfoField information array (union of the AuthenticationRequest::getFieldInfo() responses).
array&$formDescriptorHTMLForm descriptor. The special key 'weight' can be set to change the order of the fields.
string$actionOne of the AuthManager::ACTION_* constants.
Returns
bool

Definition at line 63 of file OATHAuthHooks.php.

References $formDescriptor.

◆ onGetPreferences()

static OATHAuthHooks::onGetPreferences ( User  $user,
array $preferences 
)
static

Add the necessary user preferences for OATHAuth.

Parameters
User$user
array&$preferences
Returns
bool

Definition at line 114 of file OATHAuthHooks.php.

References $user, getOATHUserRepository(), SpecialPage\getTitleFor(), string, text, and wfMessage().

◆ onLoadExtensionSchemaUpdates()

static OATHAuthHooks::onLoadExtensionSchemaUpdates (   $updater)
static
Parameters
DatabaseUpdater$updater
Returns
bool

Definition at line 146 of file OATHAuthHooks.php.

References $base.

◆ onTwoFactorIsEnabled()

static OATHAuthHooks::onTwoFactorIsEnabled ( $isEnabled)
static

Determine if two-factor authentication is enabled for $wgUser.

This isn't the preferred mechanism for controlling access to sensitive features (see AuthManager::securitySensitiveOperationStatus() for that) but there is no harm in keeping it.

Parameters
bool&$isEnabledWill be set to true if enabled, false otherwise
Returns
bool False if enabled, true otherwise

Definition at line 90 of file OATHAuthHooks.php.

References $user, getOATHUserRepository(), and null.

◆ schemaUpdateOldUsers()

static OATHAuthHooks::schemaUpdateOldUsers ( IDatabase  $db)
static

Helper function for converting old users to the new schema.

See also
OATHAuthHooks::OATHAuthSchemaUpdates
Parameters
IDatabase$db
Returns
bool

Definition at line 191 of file OATHAuthHooks.php.

References $res, as, Wikimedia\Rdbms\IDatabase\delete(), Wikimedia\Rdbms\IDatabase\fieldExists(), Wikimedia\Rdbms\IDatabase\select(), unserialize(), and Wikimedia\Rdbms\IDatabase\update().

Referenced by UpdateScratchTokenFormat\execute(), and schemaUpdateOldUsersFromInstaller().

◆ schemaUpdateOldUsersFromInstaller()

static OATHAuthHooks::schemaUpdateOldUsersFromInstaller ( DatabaseUpdater  $updater)
static

Helper function for converting old users to the new schema.

See also
OATHAuthHooks::OATHAuthSchemaUpdates
Parameters
DatabaseUpdater$updater
Returns
bool

Definition at line 180 of file OATHAuthHooks.php.

References schemaUpdateOldUsers().


The documentation for this class was generated from the following file: