You are here

class MoAuthLoginSettings in Google Authenticator / 2 Factor Authentication - 2FA 7

Hierarchy

Expanded class hierarchy of MoAuthLoginSettings

File

classes/LoginSettings.php, line 2

View source
class MoAuthLoginSettings {
  private $enable2Factor;
  private $enforceInlineRegistration;
  private $enableOTP_instead_password;
  private $enablePasswordChecks;
  private $lastNUniquePassword;
  private $passwordMaxLength;
  private $passwordMinLength;
  private $passwordMustHaveLowChar;
  private $passwordMustHaveUpChar;
  private $passwordMustHaveNumChar;
  private $passwordMustHaveSpecialChar;
  private $passwordMustNotBeEmail;
  private $passwordMustNotBeFname;
  private $passwordMustNotBeLname;
  private $machineNameOfFname;
  private $machineNameOfLname;
  public function __construct() {
    $this->enable2Factor = variable_get('mo_auth_enable_two_factor', TRUE);
    $this->enforceInlineRegistration = variable_get('mo_auth_enforce_inline_registration', FALSE);
    $this->enableOTP_instead_password = variable_get('mo_auth_two_factor_instead_password', FALSE);
    $this->enablePasswordChecks = variable_get('mo_auth_enable_password_checks', FALSE);
    $this->lastNUniquePassword = variable_get('mo_2fa_unique_password', 0);
    $this->passwordMinLength = variable_get('mo_2fa_password_min_length', 5);
    $this->passwordMaxLength = variable_get('mo_2fa_password_max_length', 10);
    $this->passwordMustHaveLowChar = variable_get('mo_2fa_password_password_variation_low_char', TRUE);
    $this->passwordMustHaveUpChar = variable_get('mo_2fa_password_password_variation_up_char', TRUE);
    $this->passwordMustHaveNumChar = variable_get('mo_2fa_password_password_variation_num_char', TRUE);
    $this->passwordMustHaveSpecialChar = variable_get('mo_2fa_password_password_variation_special_char', TRUE);
    $this->passwordMustNotBeEmail = variable_get('mo_2fa_password_must_not_be_email', FALSE);
    $this->passwordMustNotBeFname = variable_get('mo_2fa_password_must_not_be_firstname', FALSE);
    $this->passwordMustNotBeLname = variable_get('mo_2fa_password_must_not_lastname', FALSE);
    $this->machineNameOfFname = variable_get('mo_2fa_password_must_not_be_fname_text', '');
    $this->machineNameOfLname = variable_get('mo_2fa_password_must_not_be_lname_text', '');
  }
  public static function withValues($enable2Factor, $enforceInlineRegistration, $enableOTP_instead_password) {
    $instance = new MoAuthLoginSettings();
    $instance
      ->setEnable2Factor($enable2Factor);
    $instance
      ->setEnforceInlineRegistration($enforceInlineRegistration);
    $instance
      ->setEnableOTPinsteadPassword($enableOTP_instead_password);
    return $instance;
  }
  public function updateLoginSettings() {
    variable_set('mo_auth_enable_two_factor', $this->enable2Factor);
    variable_set('mo_auth_enforce_inline_registration', $this->enforceInlineRegistration);
    variable_set('mo_auth_two_factor_instead_password', $this->enableOTP_instead_password);
  }
  public function getEnable2Factor() {
    return $this->enable2Factor;
  }
  private function setEnable2Factor($enable2Factor) {
    $this->enable2Factor = $enable2Factor;
  }
  public function getEnforceInlineRegistration() {
    return $this->enforceInlineRegistration;
  }
  private function setEnforceInlineRegistration($enforceInlineRegistration) {
    $this->enforceInlineRegistration = $enforceInlineRegistration;
  }
  public function getEnableOTPinsteadPassword() {
    return $this->enableOTP_instead_password;
  }
  private function setEnableOTPinsteadPassword($enableOTP_instead_password) {
    $this->enableOTP_instead_password = $enableOTP_instead_password;
  }

  /**
   * @return |null
   */
  public function getEnablePasswordChecks() {
    return $this->enablePasswordChecks;
  }

  /**
   * @return |null
   */
  public function getLastNUniquePassword() {
    return $this->lastNUniquePassword;
  }

  /**
   * @return |null
   */
  public function getPasswordMaxLength() {
    return $this->passwordMaxLength;
  }

  /**
   * @return |null
   */
  public function getPasswordMinLength() {
    return $this->passwordMinLength;
  }

  /**
   * @return |null
   */
  public function getPasswordMustHaveLowChar() {
    return $this->passwordMustHaveLowChar;
  }

  /**
   * @return |null
   */
  public function getPasswordMustHaveUpChar() {
    return $this->passwordMustHaveUpChar;
  }

  /**
   * @return |null
   */
  public function getPasswordMustHaveNumChar() {
    return $this->passwordMustHaveNumChar;
  }

  /**
   * @return |null
   */
  public function getPasswordMustHaveSpecialChar() {
    return $this->passwordMustHaveSpecialChar;
  }

  /**
   * @return |null
   */
  public function getPasswordMustNotBeEnabled() {
    return $this->passwordMustNotBeEnabled;
  }

  /**
   * @return |null
   */
  public function getPasswordMustNotBeRules() {
    return $this->passwordMustNotBeRules;
  }

  /**
   * @return |null
   */
  public function getPasswordMustNotBeEmail() {
    return $this->passwordMustNotBeEmail;
  }

  /**
   * @return |null
   */
  public function getPasswordMustNotBeFname() {
    return $this->passwordMustNotBeFname;
  }

  /**
   * @return |null
   */
  public function getPasswordMustNotBeLname() {
    return $this->passwordMustNotBeLname;
  }

  /**
   * @return |null
   */
  public function getMachineNameOfFname() {
    return $this->machineNameOfFname;
  }

  /**
   * @return |null
   */
  public function getMachineNameOfLname() {
    return $this->machineNameOfLname;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MoAuthLoginSettings::$enable2Factor private property
MoAuthLoginSettings::$enableOTP_instead_password private property
MoAuthLoginSettings::$enablePasswordChecks private property
MoAuthLoginSettings::$enforceInlineRegistration private property
MoAuthLoginSettings::$lastNUniquePassword private property
MoAuthLoginSettings::$machineNameOfFname private property
MoAuthLoginSettings::$machineNameOfLname private property
MoAuthLoginSettings::$passwordMaxLength private property
MoAuthLoginSettings::$passwordMinLength private property
MoAuthLoginSettings::$passwordMustHaveLowChar private property
MoAuthLoginSettings::$passwordMustHaveNumChar private property
MoAuthLoginSettings::$passwordMustHaveSpecialChar private property
MoAuthLoginSettings::$passwordMustHaveUpChar private property
MoAuthLoginSettings::$passwordMustNotBeEmail private property
MoAuthLoginSettings::$passwordMustNotBeFname private property
MoAuthLoginSettings::$passwordMustNotBeLname private property
MoAuthLoginSettings::getEnable2Factor public function
MoAuthLoginSettings::getEnableOTPinsteadPassword public function
MoAuthLoginSettings::getEnablePasswordChecks public function
MoAuthLoginSettings::getEnforceInlineRegistration public function
MoAuthLoginSettings::getLastNUniquePassword public function
MoAuthLoginSettings::getMachineNameOfFname public function
MoAuthLoginSettings::getMachineNameOfLname public function
MoAuthLoginSettings::getPasswordMaxLength public function
MoAuthLoginSettings::getPasswordMinLength public function
MoAuthLoginSettings::getPasswordMustHaveLowChar public function
MoAuthLoginSettings::getPasswordMustHaveNumChar public function
MoAuthLoginSettings::getPasswordMustHaveSpecialChar public function
MoAuthLoginSettings::getPasswordMustHaveUpChar public function
MoAuthLoginSettings::getPasswordMustNotBeEmail public function
MoAuthLoginSettings::getPasswordMustNotBeEnabled public function
MoAuthLoginSettings::getPasswordMustNotBeFname public function
MoAuthLoginSettings::getPasswordMustNotBeLname public function
MoAuthLoginSettings::getPasswordMustNotBeRules public function
MoAuthLoginSettings::setEnable2Factor private function
MoAuthLoginSettings::setEnableOTPinsteadPassword private function
MoAuthLoginSettings::setEnforceInlineRegistration private function
MoAuthLoginSettings::updateLoginSettings public function
MoAuthLoginSettings::withValues public static function
MoAuthLoginSettings::__construct public function