You are here

function cleantalk_uc_order in Anti Spam by CleanTalk 7.5

Same name and namespace in other branches
  1. 8.4 cleantalk.module \cleantalk_uc_order()
  2. 8 cleantalk.module \cleantalk_uc_order()
  3. 8.3 cleantalk.module \cleantalk_uc_order()
  4. 7 cleantalk.module \cleantalk_uc_order()
  5. 7.2 cleantalk.module \cleantalk_uc_order()
  6. 7.4 cleantalk.module \cleantalk_uc_order()
  7. 9.1.x cleantalk.module \cleantalk_uc_order()

File

./cleantalk.module, line 420
Main CleanTalk integration module functions.

Code

function cleantalk_uc_order($op, $order, $arg2) {
  $spam_check = array();
  $ct_temp_msg_data = CleantalkFuncs::_cleantalk_get_fields_any($_POST);
  $spam_check['type'] = 'custom_contact_form';
  $spam_check['sender_email'] = $ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '';
  $spam_check['sender_nickname'] = $ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '';
  $spam_check['message_title'] = $ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '';
  $spam_check['message_body'] = $ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : '';
  $spam_result = CleantalkFuncs::_cleantalk_check_spam($spam_check);
  if (isset($spam_result) && is_array($spam_result) && $spam_result['errno'] == 0 && $spam_result['allow'] != 1) {
    if (strpos($_SERVER['REQUEST_URI'], 'ajax') !== false) {
      print $spam_result['ct_result_comment'];
      drupal_exit();
    }
    else {
      CleantalkFuncs::_cleantalk_die($spam_result['ct_result_comment']);
    }
  }
}