You are here

function ldap_profile_custom_translate in Lightweight Directory Access Protocol (LDAP) 7

Modify this file to indicate any types of custom data translations that you need.

1 call to ldap_profile_custom_translate()
ldap_profile_translate in ldap_profile/ldap_profile.module
Provides a custom tranlation for ldap to drupal information example - ldap stores has a field that specfies supervior = supervisor in drupal you might want to store this a single on/off checkbox this will allow you write a data translation for that…

File

ldap_profile/ldap_profile_data_translate.inc, line 11
translate file for ldap_profile module

Code

function ldap_profile_custom_translate($field, $value) {
  $result = '';
  switch ($field) {

    /**
     * the following is an example of how this is used
     * if your ldap account has an ldap field of telephone_number with format '(xxx) xxx-xxx'
     * and your drupal account has field_phone with format 'xxx-xxx-xxxx'
     *
     * case 'telephone_number': $result = strtr($value, array('(' => '', ')' => '', ' ' => '-'));
     */
    default:
      $result = $value;
  }
  return $result;
}