You are here

function services_auth_info in Services 7

Same name and namespace in other branches
  1. 6.2 services.module \services_auth_info()

Gets information about a 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 forDefaults 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
services_auth_invoke in ./services.module
services_auth_invoke_custom in ./services.module

File

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

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];
}