You are here

function captcha_point_admin_form_submit in CAPTCHA 6

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

submit function for captcha_point_admin_form

File

./captcha.admin.inc, line 243

Code

function captcha_point_admin_form_submit($form, $form_state) {
  $captcha_point_form_id = $form_state['values']['captcha_point_form_id'];
  $captcha_type = $form_state['values']['captcha_type'];
  db_query("DELETE FROM {captcha_points} WHERE form_id = '%s'", $captcha_point_form_id);
  if ($captcha_type == 'none') {
    db_query("INSERT INTO {captcha_points} (form_id, module, type) VALUES ('%s', NULL, NULL)", $captcha_point_form_id);
  }
  else {
    list($module, $type) = explode('/', $captcha_type);
    db_query("INSERT INTO {captcha_points} (form_id, module, type) VALUES ('%s', '%s', '%s')", $captcha_point_form_id, $module, $type);
  }
  drupal_set_message(t('Saved CAPTCHA point settings.'), 'status');
}