You are here

function tokenauth_user_profile_form in Token authentication 7

Same name and namespace in other branches
  1. 5 tokenauth.module \tokenauth_user_profile_form()
  2. 6.2 tokenauth.pages.inc \tokenauth_user_profile_form()
  3. 6 tokenauth.pages.inc \tokenauth_user_profile_form()

Menu callback. Prints the token and instructions.

1 string reference to 'tokenauth_user_profile_form'
tokenauth_menu in ./tokenauth.module
Implements hook_menu().

File

./tokenauth.pages.inc, line 132
Provides administrative user interface for Tokenauth module.

Code

function tokenauth_user_profile_form($form, &$form_state, $account) {
  drupal_set_title($account->name);
  $token = tokenauth_get_token($account->uid);
  $form['preamble'] = array(
    '#markup' => tokenauth_text_load($account, TRUE),
  );
  if (!module_exists('token')) {
    $key = tokenauth_get_token_key();
    $form['preamble']['#markup'] .= "<p><strong>" . t('Your token:') . "</strong> ?{$key}=<code>{$token}</code></p>";
  }
  $form = array_merge($form, tokenauth_reset_user_form($account->uid, NULL, $token));
  return $form;
}