You are here

tfa_test.login.inc in Two-factor Authentication (TFA) 7.2

Tests for the TfaLoginPluginInterface.

File

tests/includes/tfa_test.login.inc
View source
<?php

/**
 * @file
 * Tests for the TfaLoginPluginInterface.
 */

/**
 * Class TfaTestLogin.
 */
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;
  }

}

Classes

Namesort descending Description
TfaTestLogin Class TfaTestLogin.