You are here

function captcha_submit_invalidate_session in CAPTCHA 6.2

Invalidate CAPTCHA token to avoid reuse.

_state

Parameters

unknown_type $form:

1 string reference to 'captcha_submit_invalidate_session'
captcha_form_alter in ./captcha.module
Implementation of hook_form_alter().

File

./captcha.module, line 755
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_submit_invalidate_session($form, $form_state) {
  if (isset($form_state['captcha_info']['captcha_sid'])) {
    db_query("UPDATE {captcha_sessions} SET token=NULL WHERE csid=%d", $form_state['captcha_info']['captcha_sid']);
  }
}