You are here

function _ldapdata_ldap_info in LDAP integration 6

Same name and namespace in other branches
  1. 5.2 ldapdata.module \_ldapdata_ldap_info()
  2. 5 ldapdata.module \_ldapdata_ldap_info()

Retrieve the saved ldapdata saved setting.

Parameters

$sid: A server ID or user object.

$req: An attribute name.

Return value

The attribute value.

12 calls to _ldapdata_ldap_info()
ldapdata_category_access in ./ldapdata.module
Checks if LDAP data category should be printed.
ldapdata_ldap_attributes_needed_alter in ./ldapdata.module
Implements hook_ldap_attributes_needed_alter
_ldapdata_attribute_filter in ./ldapdata.module
Filter LDAP attributes.
_ldapdata_reverse_mappings in ./ldapdata.module
Retrieve reverse LDAP to drupal mappings.
_ldapdata_user_form in ./ldapdata.module
Implements hook_user() categories operation. Only used for editable LDAP attributes with no Drupal equivalents.

... See full list

File

./ldapdata.module, line 864
ldapdata provides data maping against ldap server.

Code

function _ldapdata_ldap_info($sid, $req) {
  if (!($sid = is_object($sid) ? isset($sid->ldap_config) ? $sid->ldap_config : NULL : $sid)) {
    return;
  }
  $server = ldapauth_server_load($sid);
  switch ($req) {
    case 'mapping_type':
      $ldapdata_mappings = !empty($server->ldapdata_mappings) ? unserialize($server->ldapdata_mappings) : array();
      return isset($ldapdata_mappings['access']) ? $ldapdata_mappings['access'] : LDAPDATA_MAP_NOTHING;
    case 'ldapdata_mappings':
      return !empty($server->ldapdata_mappings) ? unserialize($server->ldapdata_mappings) : array();
    case 'ldapdata_roattrs':
      return !empty($server->ldapdata_roattrs) ? unserialize($server->ldapdata_roattrs) : array();
    case 'ldapdata_rwattrs':
      return !empty($server->ldapdata_rwattrs) ? unserialize($server->ldapdata_rwattrs) : array();
    case 'ldapdata_binddn':
      return $server->ldapdata_binddn;
    case 'ldapdata_bindpw':
      return $server->ldapdata_bindpw;
    case 'ldapdata_attrs':
      return !empty($server->ldapdata_attrs) ? unserialize($server->ldapdata_attrs) : array();
    case 'ldapdata_filter_php':
      return $server->ldapdata_filter_php;
  }
}