You are here

function _ldapdata_ldap_info in LDAP integration 5.2

Same name and namespace in other branches
  1. 5 ldapdata.module \_ldapdata_ldap_info()
  2. 6 ldapdata.module \_ldapdata_ldap_info()
7 calls to _ldapdata_ldap_info()
ldapdata_user_form in ./ldapdata.module
Only used for editable LDAP attributes with no Drupal equivalents
ldapdata_user_load in ./ldapdata.module
ldapdata_user_login in ./ldapdata.module
ldapdata_user_update in ./ldapdata.module
ldapdata_user_update_ldap_attributes in ./ldapdata.module

... See full list

File

./ldapdata.module, line 832

Code

function _ldapdata_ldap_info(&$user, $req) {
  $ldap_config_name = $user->ldap_config;
  $ret = null;
  if (!$ldap_config_name) {
    $ret = null;
  }
  $result = db_fetch_array(db_query("SELECT * FROM {ldapauth} WHERE name = '%s'", $ldap_config_name));
  switch ($req) {
    case 'mapping_type':
      $mappings = unserialize($result['ldapdata_mappings']);
      $ret = $mappings['access'];
      break;
    case 'ldapdata_roattrs':
      $ret = unserialize($result['ldapdata_roattrs']);
      break;
    case 'ldapdata_rwattrs':
      $ret = unserialize($result['ldapdata_rwattrs']);
      break;
    case 'ldapdata_binddn':
      $ret = $result['ldapdata_binddn'];
      break;
    case 'ldapdata_bindpw':
      $ret = $result['ldapdata_bindpw'];
      break;
    case 'encrypted':
      $ret = $result['encrypted'];
      break;
    default:
      $ret = null;
      break;
  }
  return $ret;
}