function tfa_get_process in Two-factor Authentication (TFA) 7.2
Get Tfa object in the account's current context.
Parameters
object $account: User account.
Return value
6 calls to tfa_get_process()
- tfa_form in ./
tfa.form.inc - Main TFA process form builder.
- tfa_form_submit in ./
tfa.form.inc - TFA form submission handler.
- tfa_form_validate in ./
tfa.form.inc - TFA form validation handler.
- tfa_login_allowed in ./
tfa.module - Check TFA plugins if login should be interrupted for authenticating account.
- tfa_login_submit in ./
tfa.module - Login submit handler to determine if TFA process is applicable.
1 string reference to 'tfa_get_process'
- tfa_set_context in ./
tfa.module - Set context for account's TFA process.
File
- ./
tfa.module, line 160 - Two-factor authentication for Drupal.
Code
function tfa_get_process($account) {
$tfa =& drupal_static(__FUNCTION__);
if (!isset($tfa)) {
$context = tfa_get_context($account);
if (empty($context)) {
$context = tfa_start_context($account);
}
// Get plugins.
$fallback_plugins = $login_plugins = array();
$validate_plugin = $context['plugins']['validate'];
$validate = tfa_get_plugin($validate_plugin, $context);
if (!empty($context['plugins']['fallback'])) {
foreach ($context['plugins']['fallback'] as $plugin_name) {
// Avoid duplicates and using the validate plugin.
if (!array_key_exists($plugin_name, $fallback_plugins) && $plugin_name !== $validate_plugin) {
$plugin_object = tfa_get_plugin($plugin_name, $context);
if ($plugin_object) {
$fallback_plugins[$plugin_name] = $plugin_object;
}
}
}
}
if (!empty($context['plugins']['login'])) {
foreach ($context['plugins']['login'] as $plugin_name) {
if (!array_key_exists($plugin_name, $login_plugins) && $plugin_name !== $validate_plugin) {
$plugin_object = tfa_get_plugin($plugin_name, $context);
if ($plugin_object) {
$login_plugins[$plugin_name] = $plugin_object;
}
}
}
}
$tfa = new Tfa($validate, $context, $fallback_plugins, $login_plugins);
}
return $tfa;
}