Open Journal Systems  3.3.0
AccessKeyManager Class Reference

Public Member Functions

 __construct ()
 
 _performPeriodicCleanup ()
 
 createKey ($context, $userId, $assocId, $expiryDays)
 
 generateKeyHash ($key)
 
 validateKey ($context, $userId, $keyHash, $assocId=null)
 

Data Fields

 $accessKeyDao
 

Detailed Description

Class defining operations for AccessKey management.

See also
AccessKey

Definition at line 18 of file AccessKeyManager.inc.php.

Constructor & Destructor Documentation

◆ __construct()

AccessKeyManager::__construct ( )

Constructor. Create a manager for access keys.

Definition at line 25 of file AccessKeyManager.inc.php.

References _performPeriodicCleanup(), and DAORegistry\getDAO().

Member Function Documentation

◆ _performPeriodicCleanup()

AccessKeyManager::_performPeriodicCleanup ( )

Periodically clean up expired keys.

Definition at line 79 of file AccessKeyManager.inc.php.

References $accessKeyDao, and DAORegistry\getDAO().

Referenced by __construct().

◆ createKey()

AccessKeyManager::createKey (   $context,
  $userId,
  $assocId,
  $expiryDays 
)

Create an access key with the given information.

Parameters
$contextstring The context of the access key
$userIdint The ID of the effective user for this access key
$assocIdint The associated ID of the key
$expiryDaysint The number of days before this key expires
Returns
accessKey string The generated passkey

Definition at line 61 of file AccessKeyManager.inc.php.

References generateKeyHash(), Validation\generatePassword(), and Core\getCurrentDate().

◆ generateKeyHash()

AccessKeyManager::generateKeyHash (   $key)

Generate a key hash from a key.

Parameters
$keystring
Returns
string

Definition at line 35 of file AccessKeyManager.inc.php.

Referenced by ReviewerHandler\_validateAccessKey(), RegistrationHandler\activateUser(), createKey(), and MarkupConversionHelper\validateAccessToken().

◆ validateKey()

AccessKeyManager::validateKey (   $context,
  $userId,
  $keyHash,
  $assocId = null 
)

Validate an access key based on the supplied credentials. If $assocId is specified, it must match the associated ID of the key exactly.

Parameters
$contextstring The context of the access key
$userIdint
$keyHashstring The access key "passcode"
$assocIdstring optional assoc ID to check against the keys in the database
Returns
AccessKey

Definition at line 49 of file AccessKeyManager.inc.php.

Field Documentation

◆ $accessKeyDao

AccessKeyManager::$accessKeyDao

Definition at line 19 of file AccessKeyManager.inc.php.

Referenced by _performPeriodicCleanup().


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