You are here

function spam_admin_feedback_form_submit in Spam 5.3

Same name and namespace in other branches
  1. 6 spam.module \spam_admin_feedback_form_submit()

Process spam feedback.

File

./spam.module, line 1088

Code

function spam_admin_feedback_form_submit($form_id, $form_values) {
  if ($form_values['op'] == t('Publish content')) {
    $content = unserialize($form_values['content']);

    // mark the content as not spam
    $extra['content'] = $content;
    spam_mark_as_not_spam($form_values['type'], $form_values['id'], $extra);

    // publish the content
    // TODO: don't execute form if content is already published
    // return will contain a url to the new content
    $form = unserialize($form_values['spam_form']);
    $_SESSION['bypass_spam_filter'] = _spam_sign($form['#post']['form_token']);
    $return = drupal_process_form($content['form_id'], unserialize($form_values['spam_form']));
    db_query('DELETE FROM {spam_filters_errors} WHERE bid = %d', $form_values['bid']);
    drupal_set_message(t('Content published.'));
    drupal_goto('admin/content/spam/feedback');
  }
  if ($form_values['op'] == t('Delete feedback')) {

    // TODO: Confirm the delete.
    db_query('DELETE FROM {spam_filters_errors} WHERE bid = %d', $form_values['bid']);
    drupal_set_message(t('Feedback deleted.'));
    drupal_goto('admin/content/spam/feedback');
  }
}