You are here

function farm_access_options_access_callback in farmOS 7

Access callback for paths that need to respond to OPTIONS requests. This will receive the original access callback as the first argument, and any other arguments after that.

Parameters

$callback: The access callback to delegate to for non-OPTIONS requests.

Return value

bool

1 string reference to 'farm_access_options_access_callback'
farm_access_menu_alter in modules/farm/farm_access/farm_access.module
Implements hook_menu_alter().

File

modules/farm/farm_access/farm_access.module, line 183
Farm Access module.

Code

function farm_access_options_access_callback($callback) {

  // If this is an OPTIONS request, allow access.
  if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    return TRUE;
  }

  // Otherwise, delegate to the original access callback.
  $args = func_get_args();
  array_shift($args);
  return call_user_func_array($callback, $args);
}