function services_auth_info in Services 6.2
Same name and namespace in other branches
- 7 services.module \services_auth_info()
Gets information about an authentication module.
If a property name is passed the value of the property will be returned, otherwise the whole information array will be returned.
Parameters
string $property: Optional. The name of a single property to get. Defaults to NULL.
string $module: Optional. The module to get info for, Defaults to the current authentication module.
Return value
mixed The information array or property value, or FALSE if the information or property wasn't found
3 calls to services_auth_info()
- services_admin_settings in ./
services_admin_browse.inc - Build the admin settings form.
- services_auth_invoke in ./
services.module - Invokes a method for the configured authentication module.
- services_auth_invoke_custom in ./
services.module - Invokes a method for the given authentication module.
File
- ./
services.module, line 271 - Provides a generic but powerful API for exposing web services.
Code
function services_auth_info($property = NULL, $module = NULL) {
static $info = array();
// Default the module param to the current auth module
$module = $module ? $module : variable_get('services_auth_module', '');
if (!isset($info[$module])) {
if (!empty($module) && module_exists($module) && is_callable($module . '_authentication_info')) {
$info[$module] = call_user_func($module . '_authentication_info');
}
else {
$info[$module] = FALSE;
}
}
// If a property was requested it should be returned
if ($property) {
return isset($info[$module][$property]) ? $info[$module][$property] : FALSE;
}
// Return the info array
return $info[$module];
}