You are here

function _authcache_form_allow_notoken in Authenticated User Page Caching (Authcache) 7.2

Test whether stripping of CSRF token is allowed for the given form.

Parameters

string $form_id: The form id to test.

object $account: The account to test.

Return value

bool TRUE if config allows removal of the form token, FALSE otherwise.

2 calls to _authcache_form_allow_notoken()
AuthcacheFormTestHelpers::testFormAllowNotoken in modules/authcache_form/tests/authcache_form.test
Cover _authcache_form_allow_notoken().
authcache_form_form_alter in modules/authcache_form/authcache_form.module
Implements hook_form_alter().

File

modules/authcache_form/authcache_form.module, line 222
Form token retrieval for Authcache.

Code

function _authcache_form_allow_notoken($form_id, $account = NULL) {
  return authcache_role_restrict_members_access(variable_get('authcache_form_notoken_roles'), $account) && _authcache_form_match_form_id($form_id, variable_get('authcache_form_notoken', ''));
}