You are here

function _captcha_persistence_skip in CAPTCHA 5.3

Same name and namespace in other branches
  1. 6 captcha.module \_captcha_persistence_skip()

Helper function for checking if the CAPTCHA for the given form_id should be skipped because of CAPTCHA persistence.

2 calls to _captcha_persistence_skip()
captcha_form_alter in ./captcha.module
Implementation of hook_form_alter().
captcha_pre_render in ./captcha.module
Implementation of form #pre_render.

File

./captcha.module, line 464
This module enables basic CAPTCHA functionality: administrators can add a CAPTCHA to desired forms that users without the 'skip CAPTCHA' permission (typically anonymous visitors) have to solve.

Code

function _captcha_persistence_skip($form_id) {
  $persistence = variable_get('captcha_persistence', CAPTCHA_PERSISTENCE_SHOW_ALWAYS);
  return $persistence == CAPTCHA_PERSISTENCE_SKIP_ONCE_SUCCESSFUL && $_SESSION['captcha']['success'] === TRUE || $persistence == CAPTCHA_PERSISTENCE_SKIP_ONCE_SUCCESSFUL_PER_FORM && $_SESSION['captcha'][$form_id]['success'] === TRUE;
}