summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorpb1dft <pb1dft@ampache>2006-10-16 21:33:32 +0000
committerpb1dft <pb1dft@ampache>2006-10-16 21:33:32 +0000
commitfc27f3c7f30c06c9517772cf71976437cbac6807 (patch)
treeb1673ce9511ba458b92b16ebdcc80199ca356529 /modules
parentbe194f4f72443307998816293985831926460cce (diff)
downloadampache-fc27f3c7f30c06c9517772cf71976437cbac6807.tar.gz
ampache-fc27f3c7f30c06c9517772cf71976437cbac6807.tar.bz2
ampache-fc27f3c7f30c06c9517772cf71976437cbac6807.zip
Some major perfomance issues on large LDAP servers
Diffstat (limited to 'modules')
-rw-r--r--modules/vauth/auth.lib.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/vauth/auth.lib.php b/modules/vauth/auth.lib.php
index e383d0b5..aff9ee49 100644
--- a/modules/vauth/auth.lib.php
+++ b/modules/vauth/auth.lib.php
@@ -123,6 +123,9 @@ function vauth_ldap_auth($username, $password) {
// This is the ldap filter string (required)
$ldap_filter = vauth_conf('ldap_filter');
+ //This is the ldap objectclass (required)
+ $ldap_class = vauth_conf('ldap_objectclass');
+
$ldap_name_field = vauth_conf('ldap_name_field');
$ldap_email_field = vauth_conf('ldap_email_field');
@@ -137,8 +140,8 @@ function vauth_ldap_auth($username, $password) {
$results['error'] = "Could not bind to LDAP server.";
return $results;
} // If bind fails
-
- $sr = ldap_search($ldap_link, $ldap_dn, "($ldap_filter=$username)");
+
+ $sr = ldap_search($ldap_link, $ldap_dn, "(&(objectclass=$ldap_class)($ldap_filter=$username))");
$info = ldap_get_entries($ldap_link, $sr);
if ($info["count"] == 1) {