function services_auth_invoke in Services 7.3
Same name and namespace in other branches
- 6.3 services.runtime.inc \services_auth_invoke()
- 6.2 services.module \services_auth_invoke()
- 7 services.module \services_auth_invoke()
Invokes a authentication module callback.
Parameters
string $module: The authentication module to invoke the callback for.
string $method: The callback to invoke.
string $arg1: Optional. First argument to pass to the callback.
string $arg2: Optional. Second argument to pass to the callback.
string $arg3: Optional. Third argument to pass to the callback.
Return value
mixed
Aren't these really the following? arg1 = Settings arg2 = Method arg3 = Controller
4 calls to services_auth_invoke()
- services_edit_form_endpoint_authentication in plugins/
export_ui/ services_ctools_export_ui.class.php - Endpoint authentication configuration form.
- services_edit_form_endpoint_resources in plugins/
export_ui/ services_ctools_export_ui.class.php - services_edit_form_endpoint_resources function.
- _services_authenticate_user in includes/
services.runtime.inc - Run enabled authentication plugins.
- _services_build_resources in includes/
services.resource_build.inc - Builds the resource definition array for a endpoint.
File
- includes/
services.runtime.inc, line 251 - Contains functions that only are necessary when a service call is made. This has broken out so that this code isn't loaded for every page load.
Code
function services_auth_invoke($module, $method, &$arg1 = NULL, &$arg2 = NULL, &$arg3 = NULL) {
$args = func_get_args();
// Get information about the auth module
$info = services_authentication_info($module);
drupal_alter('services_authentication_info', $info, $module);
$func = $info && !empty($info[$method]) ? $info[$method] : FALSE;
if (!$func) {
return TRUE;
}
if (!empty($info['file'])) {
require_once drupal_get_path('module', $module) . '/' . $info['file'];
}
if (is_callable($func)) {
// Replace module and method name and arg1 with reference to $arg1 and $arg2.
array_splice($args, 0, 5, array(
&$arg1,
&$arg2,
&$arg3,
));
return call_user_func_array($func, $args);
}
}