MediaWiki
1.34.0
|
Class representing a user from OATH's perspective. More...
Public Member Functions | |
__construct (User $user, $keys=[]) | |
Constructor. More... | |
addKey (IAuthKey $key) | |
Adds single key to the key array. More... | |
clearAllKeys () | |
Removes all keys associated with the user Warning: This only removes the keys in memory, changes need to be persisted. More... | |
disable () | |
Disables current (if any) auth method. More... | |
getAccount () | |
getFirstKey () | |
Useful for modules that operate on single-key premise, as well as testing the key type, since first key is necessarily the same type as others. More... | |
getIssuer () | |
getKeys () | |
Get the key associated with this user. More... | |
getModule () | |
Gets the module instance associated with this user. More... | |
getUser () | |
setKeys ( $keys=[]) | |
Set the key associated with this user. More... | |
setModule (IModule $module=null) | |
Sets the module instance associated with this user. More... | |
Private Member Functions | |
keyTypeCorrect (IAuthKey $key) | |
All keys set for the user must be of the same type. More... | |
Private Attributes | |
IAuthKey[] | $keys |
IModule | $module |
User | $user |
Class representing a user from OATH's perspective.
Definition at line 28 of file OATHUser.php.
MediaWiki\Extension\OATHAuth\OATHUser::__construct | ( | User | $user, |
$keys = [] |
|||
) |
Constructor.
Can't be called directly. Use OATHUserRepository::findByUser instead.
Definition at line 45 of file OATHUser.php.
References MediaWiki\Extension\OATHAuth\OATHUser\$user, and MediaWiki\Extension\OATHAuth\OATHUser\setKeys().
MediaWiki\Extension\OATHAuth\OATHUser::addKey | ( | IAuthKey | $key | ) |
Adds single key to the key array.
IAuthKey | $key |
Definition at line 127 of file OATHUser.php.
References MediaWiki\Extension\OATHAuth\OATHUser\keyTypeCorrect().
Referenced by MediaWiki\Extension\OATHAuth\OATHUser\setKeys(), and MediaWiki\Extension\OATHAuth\Key\TOTPKey\verify().
MediaWiki\Extension\OATHAuth\OATHUser::clearAllKeys | ( | ) |
Removes all keys associated with the user Warning: This only removes the keys in memory, changes need to be persisted.
Definition at line 118 of file OATHUser.php.
MediaWiki\Extension\OATHAuth\OATHUser::disable | ( | ) |
Disables current (if any) auth method.
Definition at line 156 of file OATHUser.php.
MediaWiki\Extension\OATHAuth\OATHUser::getAccount | ( | ) |
Definition at line 72 of file OATHUser.php.
Referenced by MediaWiki\Extension\OATHAuth\Key\TOTPKey\verify().
MediaWiki\Extension\OATHAuth\OATHUser::getFirstKey | ( | ) |
Useful for modules that operate on single-key premise, as well as testing the key type, since first key is necessarily the same type as others.
Definition at line 92 of file OATHUser.php.
Referenced by MediaWiki\Extension\OATHAuth\Module\TOTP\getDataFromUser(), MediaWiki\Extension\OATHAuth\Module\TOTP\isEnabled(), and MediaWiki\Extension\OATHAuth\Module\TOTP\verify().
MediaWiki\Extension\OATHAuth\OATHUser::getIssuer | ( | ) |
MediaWiki\Extension\OATHAuth\OATHUser::getKeys | ( | ) |
Get the key associated with this user.
Definition at line 81 of file OATHUser.php.
References MediaWiki\Extension\OATHAuth\OATHUser\$keys.
MediaWiki\Extension\OATHAuth\OATHUser::getModule | ( | ) |
Gets the module instance associated with this user.
Definition at line 140 of file OATHUser.php.
References MediaWiki\Extension\OATHAuth\OATHUser\$module.
Referenced by MediaWiki\Extension\OATHAuth\Module\TOTP\getManageForm(), and MediaWiki\Extension\OATHAuth\OATHUserRepository\persist().
MediaWiki\Extension\OATHAuth\OATHUser::getUser | ( | ) |
Definition at line 53 of file OATHUser.php.
References MediaWiki\Extension\OATHAuth\OATHUser\$user.
Referenced by MediaWiki\Extension\OATHAuth\OATHUserRepository\persist(), MediaWiki\Extension\OATHAuth\OATHUserRepository\remove(), and MediaWiki\Extension\OATHAuth\Key\TOTPKey\verify().
|
private |
All keys set for the user must be of the same type.
IAuthKey | $key |
Definition at line 167 of file OATHUser.php.
Referenced by MediaWiki\Extension\OATHAuth\OATHUser\addKey().
MediaWiki\Extension\OATHAuth\OATHUser::setKeys | ( | $keys = [] | ) |
Set the key associated with this user.
IAuthKey[] | $keys |
Definition at line 104 of file OATHUser.php.
References MediaWiki\Extension\OATHAuth\OATHUser\$keys, and MediaWiki\Extension\OATHAuth\OATHUser\addKey().
Referenced by MediaWiki\Extension\OATHAuth\OATHUser\__construct().
MediaWiki\Extension\OATHAuth\OATHUser::setModule | ( | IModule | $module = null | ) |
Sets the module instance associated with this user.
IModule | null | $module |
Definition at line 149 of file OATHUser.php.
References MediaWiki\Extension\OATHAuth\OATHUser\$module.
Referenced by MediaWiki\Extension\OATHAuth\Key\TOTPKey\verify().
|
private |
Definition at line 33 of file OATHUser.php.
Referenced by MediaWiki\Extension\OATHAuth\OATHUser\getKeys(), and MediaWiki\Extension\OATHAuth\OATHUser\setKeys().
|
private |
Definition at line 38 of file OATHUser.php.
Referenced by MediaWiki\Extension\OATHAuth\OATHUser\getModule(), and MediaWiki\Extension\OATHAuth\OATHUser\setModule().
|
private |
Definition at line 30 of file OATHUser.php.
Referenced by MediaWiki\Extension\OATHAuth\OATHUser\__construct(), and MediaWiki\Extension\OATHAuth\OATHUser\getUser().