class TfaTestLogin in Two-factor Authentication (TFA) 7.2
Class TfaTestLogin.
Hierarchy
- class \TfaBasePlugin
- class \TfaTestLogin implements TfaLoginPluginInterface
Expanded class hierarchy of TfaTestLogin
1 string reference to 'TfaTestLogin'
- tfa_test_tfa_api in tests/
tfa_test.module - Implements hook_tfa_api().
File
- tests/
includes/ tfa_test.login.inc, line 11 - Tests for the TfaLoginPluginInterface.
View source
class TfaTestLogin extends TfaBasePlugin implements TfaLoginPluginInterface {
/**
* User ID.
*
* @var int
*/
protected $loginUid;
/**
* Constructor.
*/
public function __construct($uid, array $context = array()) {
parent::__construct($context);
$this->loginUid = $uid;
}
/**
* {@inheritdoc}
*/
public function loginAllowed() {
if ($this->context['uid'] === $this->loginUid) {
return TRUE;
}
return FALSE;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TfaBasePlugin:: |
protected | property | TFA code. | |
TfaBasePlugin:: |
protected | property | Code Length. | |
TfaBasePlugin:: |
protected | property | Context of current TFA process. | |
TfaBasePlugin:: |
protected | property | Encryption key. | |
TfaBasePlugin:: |
protected | property | Error messages. | |
TfaBasePlugin:: |
protected | property | Code is valid. | |
TfaBasePlugin:: |
constant | |||
TfaBasePlugin:: |
protected | function | Decrypt a encrypted string. | |
TfaBasePlugin:: |
protected | function | Decrypt using the deprecated Mcrypt extension. | |
TfaBasePlugin:: |
protected | function | Use OpenSSL to decrypt data that was originally encrypted with Mcrypt. | |
TfaBasePlugin:: |
protected | function | Encrypt a plaintext string. | |
TfaBasePlugin:: |
protected | function | Encrypt using the deprecated Mcrypt extension. | |
TfaBasePlugin:: |
protected | function | Generate a random string of characters of length $this->codeLength. | |
TfaBasePlugin:: |
public | function | Get error messages suitable for form_set_error(). | |
TfaBasePlugin:: |
public | function | Determine if the plugin can run for the current TFA context. | 2 |
TfaBasePlugin:: |
public | function | Submit form. | 1 |
TfaBasePlugin:: |
private | function | A timing safe equals comparison. | |
TfaBasePlugin:: |
protected | function | Validate code. | |
TfaTestLogin:: |
protected | property | User ID. | |
TfaTestLogin:: |
public | function |
Whether authentication should be interrupted. Overrides TfaLoginPluginInterface:: |
|
TfaTestLogin:: |
public | function |
Constructor. Overrides TfaBasePlugin:: |