You are here

function tokenauth_reset_user_form in Token authentication 6

Same name and namespace in other branches
  1. 6.2 tokenauth.inc \tokenauth_reset_user_form()
  2. 7 tokenauth.inc \tokenauth_reset_user_form()

Helper function to build a token reset form.

1 call to tokenauth_reset_user_form()
tokenauth_user_profile_form in ./tokenauth.pages.inc
Menu callback. Prints the token and instructions.

File

./tokenauth.inc, line 144
Provides tokenauth API for Token Authentication module.

Code

function tokenauth_reset_user_form($uid, $label = NULL, $token = NULL) {
  $form = array();
  $form['uid'] = array(
    '#type' => 'value',
    '#value' => $uid,
  );
  $form['tokenauth'] = array(
    '#type' => 'value',
    '#value' => $token,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => isset($label) ? $label : t('Reset token'),
  );
  $form['#action'] = url('user/' . $uid . '/tokenauth/reset');
  $form['#method'] = 'get';
  return $form;
}