You are here

public static function MoAuthUtilities::mo_auth_get_configured_methods in Google Authenticator / 2 Factor Authentication - 2FA 8.2

Same name and namespace in other branches
  1. 8 src/MoAuthUtilities.php \Drupal\miniorange_2fa\MoAuthUtilities::mo_auth_get_configured_methods()
3 calls to MoAuthUtilities::mo_auth_get_configured_methods()
configure_otp_over_sms_and_email::miniorange_saml_validate_otp_submit in src/Form/configure_otp_over_sms_and_email.php
configure_qrcode_authentication::submitForm in src/Form/configure_qrcode_authentication.php
Form submission handler.
miniorange_2fa_inline_registration::handle_page_five_submit in src/Form/miniorange_2fa_inline_registration.php

File

src/MoAuthUtilities.php, line 538
This file is part of miniOrange 2FA module.

Class

MoAuthUtilities

Namespace

Drupal\miniorange_2fa

Code

public static function mo_auth_get_configured_methods($user_id) {
  $utilities = new MoAuthUtilities();
  $custom_attribute = $utilities
    ->get_users_custom_attribute($user_id);
  if (is_null($custom_attribute) || empty($custom_attribute)) {
    return array();
  }
  $myArray = explode(',', $custom_attribute[0]->configured_auth_methods);
  $configured_methods = array_map('trim', $myArray);
  return $configured_methods;
}