You are here

function _eloqua_webform_get_user_headers in Eloqua 7

Same name and namespace in other branches
  1. 6 eloqua.module \_eloqua_webform_get_user_headers()

Returns the user headers filtered for types that shouldn't be needed.

This function currently is Apache module specific.

Return value

array The user headers.

1 call to _eloqua_webform_get_user_headers()
eloqua_webform_form_alter in eloqua_webform/eloqua_webform.module
Implements hook_form_alter().

File

eloqua_webform/eloqua_webform.module, line 335

Code

function _eloqua_webform_get_user_headers() {

  // Getting the request headers only exists in Apache.
  if (!function_exists('apache_request_headers')) {
    return array();
  }
  $headers = apache_request_headers();

  // Check to see if the function succeeded or not.
  if (!$headers) {
    return array();
  }
  $filter = array(
    'host',
    'cookie',
  );
  $result = array();
  foreach ($headers as $key => $value) {
    if (!in_array(strtolower($key), $filter)) {
      $result[strtolower($key)] = $value;
    }
  }
  return $result;
}