You are here

function services_auth_invoke_custom in Services 6.2

Same name and namespace in other branches
  1. 7 services.module \services_auth_invoke_custom()

Invokes a method for the given authentication module.

Parameters

string $module: The authentication module to call the method for.

string $method: The method to call.

mixed $arg1: Optional. First argument.

mixed $arg2: Optional. Second argument.

mixed $arg3: Optional. Third argument.

Return value

mixed

2 calls to services_auth_invoke_custom()
services_admin_settings_validate in ./services_admin_browse.inc
Validate callback for services_admin_settings().
_services_ahah_security_options in ./services_admin_browse.inc
Callback for the security configuration form ahah.

File

./services.module, line 345
Provides a generic but powerful API for exposing web services.

Code

function services_auth_invoke_custom($module, $method, &$arg1 = NULL, &$arg2 = NULL, &$arg3 = NULL) {

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

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