diff --git a/lam/lib/account.inc b/lam/lib/account.inc index 3ff38d07..2f574722 100644 --- a/lam/lib/account.inc +++ b/lam/lib/account.inc @@ -782,7 +782,7 @@ function ldapGetDN($dn, $attributes = array('dn'), $handle = null) { $return = null; $sr = @ldap_read($handle, escapeDN($dn), 'objectClass=*', $attributes, 0, 0, 0, LDAP_DEREF_NEVER); if ($sr) { - $entries = ldap_get_entries($_SESSION['ldap']->server(), $sr); + $entries = ldap_get_entries($handle, $sr); if ($entries) { cleanLDAPResult($entries); $return = $entries[0];