function MoAuthLoginSettings::getSelected2faMethods in Google Authenticator / 2 Factor Authentication - 2FA 8.2
Process allowed 2FA methods in inline registration flow
Parameters
$form_values:
Return value
string
1 call to MoAuthLoginSettings::getSelected2faMethods()
- MoAuthLoginSettings::submitForm in src/
Form/ MoAuthLoginSettings.php - Form submission handler.
File
- src/
Form/ MoAuthLoginSettings.php, line 750 - Contains support form for miniOrange 2FA Login Module.
Class
- MoAuthLoginSettings
- Showing LoginSetting form info.
Namespace
Drupal\miniorange_2fa\FormCode
function getSelected2faMethods($form_values) {
$mo_get_2fa_methods = MoAuthUtilities::get_2fa_methods_for_inline_registration(FALSE);
$mo_allowed_2fa_methods = array();
foreach ($mo_get_2fa_methods as $sysName => $displayName) {
if ($form_values['mo_auth_2fa_methods_for_inline' . str_replace(' ', '_', $sysName)] == 1) {
$mo_allowed_2fa_methods[$sysName] = $displayName;
}
}
$mo_allowed_2fa_methods_value = !empty($mo_allowed_2fa_methods) ? json_encode($mo_allowed_2fa_methods) : '';
return $mo_allowed_2fa_methods_value;
}