You are here

function services_auth_invoke in Services 7

Same name and namespace in other branches
  1. 6.3 services.runtime.inc \services_auth_invoke()
  2. 6.2 services.module \services_auth_invoke()
  3. 7.3 includes/services.runtime.inc \services_auth_invoke()
8 calls to services_auth_invoke()
services_admin_browse_test in ./services_admin_browse.inc
services_admin_browse_test_submit in ./services_admin_browse.inc
services_admin_settings in ./services_admin_browse.inc
services_admin_settings_submit in ./services_admin_browse.inc
services_delegate_access in ./services.module

... See full list

File

./services.module, line 236
@author Services Dev Team

Code

function services_auth_invoke($method, &$arg1 = NULL, &$arg2 = NULL, &$arg3 = NULL) {
  $module = variable_get('services_auth_module', '');

  // Get information about the current auth module
  $func = services_auth_info($method, $module);
  if ($func) {
    if ($file = services_auth_info('#file')) {
      require_once drupal_get_path('module', $module) . '/' . $file;
    }
    if (is_callable($func)) {
      $args = func_get_args();

      // Replace method name and arg1 with reference to $arg1 and $arg2.
      array_splice($args, 0, 3, array(
        &$arg1,
        &$arg2,
        &$arg3,
      ));
      return call_user_func_array($func, $args);
    }
  }
  else {
    return TRUE;
  }
}