You are here

function getConfiguredAuthenticator in Google Authenticator / 2 Factor Authentication - 2FA 7

File

./authenticate_user.inc, line 533
This is used to authenticate user during login.

Code

function getConfiguredAuthenticator($user) {
  $configured_methods = mo_auth_get_configured_methods($user->uid);
  if (in_array('GOOGLE AUTHENTICATOR', $configured_methods)) {
    $users_active_method = AuthenticationType::getAuthType('GOOGLE AUTHENTICATOR');
  }
  elseif (in_array('MICROSOFT AUTHENTICATOR', $configured_methods)) {
    $users_active_method = AuthenticationType::getAuthType('MICROSOFT AUTHENTICATOR');
  }
  elseif (in_array('AUTHY AUTHENTICATOR', $configured_methods)) {
    $users_active_method = AuthenticationType::getAuthType('AUTHY AUTHENTICATOR');
  }
  elseif (in_array('LASTPASS AUTHENTICATOR', $configured_methods)) {
    $users_active_method = AuthenticationType::getAuthType('LASTPASS AUTHENTICATOR');
  }
  return $users_active_method;
}