function ldap_profile_get_mapping in Lightweight Directory Access Protocol (LDAP) 7
Provides an array of all the current profile fields mappings with ldap fields
2 calls to ldap_profile_get_mapping()
- ldap_profile_form_user_profile_form_alter in ldap_profile/
ldap_profile.module - Implements hook_form_user_profile_form_alter().
- ldap_profile_user_login in ldap_profile/
ldap_profile.module - Implements hook_user_login().
File
- ldap_profile/
ldap_profile.module, line 263 - 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_mapping($profile_field = '') {
$ldap_profile_conf = ldap_profile_get_valid_conf();
$result = array();
if ($ldap_profile_conf == NULL) {
return NULL;
}
$mapping = $ldap_profile_conf->mapping;
if ($profile_field != '') {
if (array_key_exists($profile_field, $mapping)) {
$result = array(
$mapping[$profile_field],
);
}
}
else {
$result = $mapping;
}
return $result;
}