You are here

function _authcache_form_token_id in Authenticated User Page Caching (Authcache) 6

Same name and namespace in other branches
  1. 7 ajax/authcache.php \_authcache_form_token_id()

Form tokens (prevents CSRF)

form_token_id is a hidden field added by authcache.module's hook_form_alter()

See also

form.inc

File

ajax/authcache.php, line 109
Authcache Ajax Callback (authcache.php)

Code

function _authcache_form_token_id($vars) {
  include_once './includes/common.inc';
  foreach ($vars as $form_token_id) {
    switch ($form_token_id) {
      case 'contact_mail_page':
        global $user;
        $tokens[$form_token_id] = drupal_get_token($user->name . $user->mail);
        break;
      default:
        $tokens[$form_token_id] = drupal_get_token($form_token_id);
        break;
    }
  }
  return $tokens;
}