You are here

function ldap_profile_get_derived_mapping in Lightweight Directory Access Protocol (LDAP) 7

Provides an array of all the current derived profile field mappings with ldap fields

1 call to ldap_profile_get_derived_mapping()
ldap_profile_user_login in ldap_profile/ldap_profile.module
Implements hook_user_login().

File

ldap_profile/ldap_profile.module, line 285
This module provides the LDAP package the ability populate drupal profile fields with ldap entry data such as last name, first name, etc.

Code

function ldap_profile_get_derived_mapping($profile_field = '') {
  $ldap_profile_conf = ldap_profile_get_valid_conf();
  $result = array();
  if ($ldap_profile_conf == NULL) {
    return NULL;
  }
  $mapping = $ldap_profile_conf->derivedMapping;
  if ($profile_field != '') {
    if (array_key_exists($profile_field, $mapping)) {
      $result = array(
        $mapping[$profile_field],
      );
    }
  }
  else {
    $result = $mapping;
  }
  return $result;
}