You are here

public static function MoAuthUtilities::get_2fa_methods_for_inline_registration in Google Authenticator / 2 Factor Authentication - 2FA 7

4 calls to MoAuthUtilities::get_2fa_methods_for_inline_registration()
isThirdPageRequired in ./mo_auth_inline_registration.inc
mo_auth_inline_registration_page_three in ./mo_auth_inline_registration.inc
mo_auth_login_settings in ./mo_auth_login_settings.inc
Showing Support form info.
mo_auth_login_settings_submit in ./mo_auth_login_settings.inc
Send support query.

File

classes/Utilities.php, line 23
This file is part of miniOrange 2FA module.

Class

MoAuthUtilities
@file This file is part of miniOrange 2FA module.

Code

public static function get_2fa_methods_for_inline_registration($methods_selected) {
  if ($methods_selected === TRUE && variable_get('mo_auth_enable_allowed_2fa_methods', FALSE)) {
    $selected_2fa_methods = json_decode(variable_get('mo_auth_selected_2fa_methods'), TRUE);
    if (is_array($selected_2fa_methods) && !empty($selected_2fa_methods)) {
      return $selected_2fa_methods;
    }
  }
  $options = array(
    AuthenticationType::$EMAIL_VERIFICATION['code'] => AuthenticationType::$EMAIL_VERIFICATION['name'],
    AuthenticationType::$GOOGLE_AUTHENTICATOR['code'] => AuthenticationType::$GOOGLE_AUTHENTICATOR['name'],
    AuthenticationType::$MICROSOFT_AUTHENTICATOR['code'] => AuthenticationType::$MICROSOFT_AUTHENTICATOR['name'],
    AuthenticationType::$AUTHY_AUTHENTICATOR['code'] => AuthenticationType::$AUTHY_AUTHENTICATOR['name'],
    AuthenticationType::$LASTPASS_AUTHENTICATOR['code'] => AuthenticationType::$LASTPASS_AUTHENTICATOR['name'],
    AuthenticationType::$SMS['code'] => AuthenticationType::$SMS['name'],
    AuthenticationType::$OTP_OVER_EMAIL['code'] => AuthenticationType::$OTP_OVER_EMAIL['name'],
    AuthenticationType::$SMS_AND_EMAIL['code'] => AuthenticationType::$SMS_AND_EMAIL['name'],
    AuthenticationType::$OTP_OVER_PHONE['code'] => AuthenticationType::$OTP_OVER_PHONE['name'],
    AuthenticationType::$KBA['code'] => AuthenticationType::$KBA['name'],
    AuthenticationType::$QR_CODE['code'] => AuthenticationType::$QR_CODE['name'],
    AuthenticationType::$PUSH_NOTIFICATIONS['code'] => AuthenticationType::$PUSH_NOTIFICATIONS['name'],
    AuthenticationType::$SOFT_TOKEN['code'] => AuthenticationType::$SOFT_TOKEN['name'],
  );
  return $options;
}