Skip to content
Snippets Groups Projects
Commit 6d15422a authored by Ben Jeavons's avatar Ben Jeavons
Browse files

Make overview a form for altering, fix for methods notice

parent 2fc1aa3c
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,8 @@ function tfa_basic_menu() {
$items['user/%user/security/tfa'] = array(
'title' => 'Security',
'page callback' => 'tfa_basic_overview',
'page arguments' => array(1),
'page callback' => 'drupal_get_form',
'page arguments' => array('tfa_basic_overview', 1),
'access callback' => 'tfa_basic_setup_access',
'access arguments' => array(1, 'setup own tfa'),
'type' => MENU_LOCAL_TASK,
......
......@@ -4,13 +4,13 @@
* @param $account
* @return string
*/
function tfa_basic_overview($account) {
function tfa_basic_overview($form, &$form_state, $account) {
$output['info'] = array(
'#type' => 'markup',
'#markup' => '<p>' . t('Two-factor authentication (TFA) provides additional security for your account. With TFA enabled, you sign on to the site with a uniquely generated code in addition to your username and password.') . '</p>',
);
$form_state['storage']['account'] = $account;
$data = tfa_basic_get_tfa_data($account);
$enabled = isset($data['status']) && $data['status'] ? TRUE : FALSE;
......@@ -108,7 +108,7 @@ function tfa_basic_overview($account) {
);
}
return drupal_render($output);
return $output;
}
function tfa_basic_disable_form($form, &$form_state, $account) {
......@@ -294,7 +294,7 @@ function tfa_basic_setup_form($form, &$form_state, $account, $method = 'app_setu
break;
}
// Provide skip button for optional TFA plugins.
if (count($form_state['storage']['methods']) > 1) {
if (isset($form_state['storage']['methods']) && count($form_state['storage']['methods']) > 1) {
$form['actions']['skip'] = array(
'#type' => 'submit',
'#value' => t('Skip'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment