You are here

function captcha_point_disable_confirm_submit in CAPTCHA 6

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. 7 captcha.admin.inc \captcha_point_disable_confirm_submit()

submission handler of CAPTCHA point disabling/deleting confirm_form

File

./captcha.admin.inc, line 284

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) {
    db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $captcha_point_form_id);
    drupal_set_message(t('Deleted CAPTCHA for form %form_id.', array(
      '%form_id' => $captcha_point_form_id,
    )));
  }
  else {
    db_query("UPDATE {captcha_points} SET module = NULL, type = NULL WHERE form_id = '%s'", $captcha_point_form_id);
    drupal_set_message(t('Disabled CAPTCHA for form %form_id.', array(
      '%form_id' => $captcha_point_form_id,
    )));
  }
  $form_state['redirect'] = 'admin/user/captcha/captcha';
}