You are here

function captcha_point_disable_confirm_submit in CAPTCHA 7

Same name and namespace in other branches
  1. 5.3 captcha.module \captcha_point_disable_confirm_submit()
  2. 6.2 captcha.admin.inc \captcha_point_disable_confirm_submit()
  3. 6 captcha.admin.inc \captcha_point_disable_confirm_submit()

Submission handler of CAPTCHA point disabling/deleting confirm_form.

File

./captcha.admin.inc, line 539
Functionality and helper functions for CAPTCHA administration.

Code

function captcha_point_disable_confirm_submit($form, &$form_state) {
  $captcha_point_form_id = $form_state['values']['captcha_point_form_id'];
  $delete = $form_state['values']['captcha_point_delete'];
  if ($delete) {
    captcha_set_form_id_setting($captcha_point_form_id, NULL);
    drupal_set_message(t('Deleted CAPTCHA for form %form_id.', array(
      '%form_id' => $captcha_point_form_id,
    )));
  }
  else {
    captcha_set_form_id_setting($captcha_point_form_id, 'none');
    drupal_set_message(t('Disabled CAPTCHA for form %form_id.', array(
      '%form_id' => $captcha_point_form_id,
    )));
  }
  $form_state['redirect'] = 'admin/config/people/captcha/captcha';
}