You are here

public static function MoAuthUtilities::mo_auth_is_kba_configured in Google Authenticator / 2 Factor Authentication - 2FA 8

Same name and namespace in other branches
  1. 8.2 src/MoAuthUtilities.php \Drupal\miniorange_2fa\MoAuthUtilities::mo_auth_is_kba_configured()
1 call to MoAuthUtilities::mo_auth_is_kba_configured()
authenticate_user::mo_auth_build_form in src/Form/authenticate_user.php

File

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

Class

MoAuthUtilities

Namespace

Drupal\miniorange_2fa

Code

public static function mo_auth_is_kba_configured($user_id) {
  $utilities = new MoAuthUtilities();
  $custom_attribute = $utilities
    ->get_users_custom_attribute($user_id);
  $myArray = explode(',', $custom_attribute[0]->configured_auth_methods);
  $configured_methods = array_map('trim', $myArray);
  return array_search('KBA', $configured_methods);
}