You are here

function geocoder_services_check_request in Geocoder 7.2

Geocoder Services Check Request

Check to make sure the request to the service is valid. This checks to make sure the plugin and the format exists, and also checks permission

2 calls to geocoder_services_check_request()
geocoder_services_geocoder_geocode_callback in modules/geocoder_services/geocoder_services.services.inc
Callback for Geocoding service
geocoder_services_geocoder_reverse_callback in modules/geocoder_services/geocoder_services.services.inc
Callback for Revere Geocoding service

File

modules/geocoder_services/geocoder_services.services.inc, line 114

Code

function geocoder_services_check_request($plugin_id, $output) {
  $plugin_id = drupal_strtolower($plugin_id);
  if (!geocoder_services_check_perms($plugin_id)) {
    drupal_access_denied();
    drupal_exit();
  }
  if (!\Drupal\geocoder\Geocoder::getPluginManager()
    ->hasDefinition($plugin_id)) {
    drupal_set_message(t('Could not find provider plugin @plugin_id', array(
      '@plugin_id' => $plugin_id,
    )), 'error');
    drupal_not_found();
    drupal_exit();
  }
  if (!\Drupal\geocoder\Geocoder::getPluginManager()
    ->hasDefinition($output)) {
    drupal_set_message(t('Could not find dumper plugin @plugin_id', array(
      '@plugin_id' => $output,
    )), 'error');
    drupal_not_found();
    drupal_exit();
  }
}