From 021335b9b73ded06dda226369b7927658d4bd20f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 22 Jan 2015 09:38:48 -0800 Subject: [PATCH] LDAP support: fixes from Ben --- html/inc/ldap.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/inc/ldap.inc b/html/inc/ldap.inc index ba60e10395..9540edba95 100644 --- a/html/inc/ldap.inc +++ b/html/inc/ldap.inc @@ -25,18 +25,18 @@ // your project.inc must define LDAP_HOST and LDAP_BASE_DN // function ldap_auth($uid, $passwd) { - $ad = @ldap_connect("ldap://".LDAP_HOST); + $ad = @ldap_connect(LDAP_HOST); if (!$ad) { return array(null, "Can't connect to LDAP server"); } ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ad, LDAP_OPT_REFERRALS, 0); - $rn = "uid=$uid,ou=people,".LDAP_BASE_DN; + $rn = "uid=$uid,".LDAP_BASE_DN; $r = @ldap_bind($ad, $rn, $passwd); if (!$r) { return array(null, "Invalid credentials"); } - $x = ldap_search($ad, "ou=People,".LDAP_BASE_DN, "uid=$uid"); + $x = ldap_search($ad, $rn, "(objectclass=*)"); $x = ldap_get_entries($ad, $x); $user = new StdClass;