[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_users/src/Model/ -> BackupcodesModel.php (summary)

(no description)

Copyright: (C) 2022 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 288 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BackupcodesModel:: (5 methods):
  getBackupCodesRecord()
  regenerateBackupCodes()
  saveBackupCodes()
  getBackupCodes()
  isBackupCode()


Class: BackupcodesModel  - X-Ref

Model for managing backup codes

getBackupCodesRecord(User $user = null)   X-Ref
Get the backup codes record for the specified user

param: User|null   $user   The user in question. Use null for the currently logged in user.
return: MfaTable|null  Record object or null if none is found

regenerateBackupCodes(User $user = null)   X-Ref
Generate a new set of backup codes for the specified user. The generated codes are immediately saved to the
database and the internal cache is updated.

param: User|null   $user   Which user to generate codes for?
return: void

saveBackupCodes(array $codes, ?User $user = null)   X-Ref
Saves the backup codes to the database

param: array       $codes   An array of exactly 10 elements
param: User|null   $user    The user for which to save the backup codes
return: boolean

getBackupCodes(User $user = null)   X-Ref
Returns the backup codes for the specified user. Cached values will be preferentially returned, therefore you
MUST go through this model's Methods ONLY when dealing with backup codes.

param: User|null   $user   The user for which you want the backup codes
return: array|null  The backup codes, or null if they do not exist

isBackupCode($code, ?User $user = null)   X-Ref
Check if the provided string is a backup code. If it is, it will be removed from the list (replaced with an empty
string) and the codes will be saved to the database. All comparisons are performed in a timing safe manner.

param: string      $code   The code to check
param: User|null   $user   The user to check against
return: boolean



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer