You are here

function _ldapdata_reverse_mappings in LDAP integration 5

Same name and namespace in other branches
  1. 5.2 ldapdata.module \_ldapdata_reverse_mappings()
  2. 6 ldapdata.module \_ldapdata_reverse_mappings()
6 calls to _ldapdata_reverse_mappings()
ldapdata_admin_edit in ./ldapdata.module
ldapdata_user_load in ./ldapdata.module
ldapdata_user_login in ./ldapdata.module
ldapdata_user_profile_load in ./ldapdata.module
ldapdata_user_update_drupal_account in ./ldapdata.module

... See full list

File

./ldapdata.module, line 789

Code

function _ldapdata_reverse_mappings($config) {
  $ret = array();
  $result = db_fetch_array(db_query("SELECT ldapdata_mappings FROM {ldapauth} WHERE name = '%s'", $config));
  $mappings = unserialize($result['ldapdata_mappings']);
  if (is_array($mappings)) {
    foreach ($mappings as $key => $value) {
      $drupal_key = preg_replace('/^ldap_amap-(.*)$/', '$1', $key);
      $ldap_attr = $value;
      if ($drupal_key && $ldap_attr) {
        $ret[$drupal_key] = $ldap_attr;
      }
    }
  }
  return $ret;
}