summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpb1dft <pb1dft@ampache>2006-10-15 01:07:46 +0000
committerpb1dft <pb1dft@ampache>2006-10-15 01:07:46 +0000
commit8a644eb74fea37111e6950d5883144100bf4a99c (patch)
treef2c149a06897bfe2fe7061d7aec6336ec0f507ec
parent0ac27764e1d5e3499a3ca2ded0018d33c42ae50b (diff)
downloadampache-8a644eb74fea37111e6950d5883144100bf4a99c.tar.gz
ampache-8a644eb74fea37111e6950d5883144100bf4a99c.tar.bz2
ampache-8a644eb74fea37111e6950d5883144100bf4a99c.zip
Modified the LDAP authentication to support Microsoft AD and fixed some minor typos
-rw-r--r--config/ampache.cfg.php.dist12
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--modules/vauth/auth.lib.php7
3 files changed, 15 insertions, 6 deletions
diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist
index da19b161..cfe5d409 100644
--- a/config/ampache.cfg.php.dist
+++ b/config/ampache.cfg.php.dist
@@ -303,8 +303,13 @@ refresh_limit = "60"
# DEFAULT: false
#auto_create = "false"
-# Some LDAP servers won't let you search for the username
-# without logging in with an application user account.
+# LDAP filter string to use
+# For OpenLDAP use "uid"
+# For Microsoft Active Directory (MAD) use "sAMAccountName"
+# DEFAULT: null
+# ldap_filter = "uid"
+# ldap_filter = "sAMAccountName"
+
# if this is the case, fill these in here:
# DEFAULT: null
#ldap_username = ""
@@ -320,7 +325,8 @@ refresh_limit = "60"
# This is the search dn used to find your user, uid=username is added on to
# This string
# DEFAULT: null
-#ldap_search_dn = "ou=People,dc=yoursubdomain,dc=yourdomain,dc=yourtld?uid?sub?(objectclass=*)"
+#For OpenLDAP use ldap_search_dn = "ou=People,dc=yoursubdomain,dc=yourdomain,dc=yourtld?uid?sub?(objectclass=*)"
+#For MAD use ldap_search_dn = "ou=People,dc=yoursubdomain,dc=yourdomain,dc=yourtld"
# This is the address of your ldap server
# DEFAULT: null
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index c1797605..b321b683 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,7 +4,7 @@
--------------------------------------------------------------------------
v.3.3.3-Alpha1
- - Added LDAP auth support (Thx Rubin)
+ - Added LDAP auth support (Thx Rubin & pb1dft for the modification to support Microsoft AD)
- Added ajax support to ratings, no longer requires a refresh,
hello instant gratification.
- Tweaked Kajax, now accepts an array of elements to replace
diff --git a/modules/vauth/auth.lib.php b/modules/vauth/auth.lib.php
index ff0ca5e8..e383d0b5 100644
--- a/modules/vauth/auth.lib.php
+++ b/modules/vauth/auth.lib.php
@@ -120,7 +120,10 @@ function vauth_ldap_auth($username, $password) {
// This is the server url (required)
$ldap_url = vauth_conf('ldap_url');
- $ldap_name_field = vauth_conf('ldap_name_field');
+ // This is the ldap filter string (required)
+ $ldap_filter = vauth_conf('ldap_filter');
+
+ $ldap_name_field = vauth_conf('ldap_name_field');
$ldap_email_field = vauth_conf('ldap_email_field');
if ($ldap_link = ldap_connect($ldap_url) ) {
@@ -135,7 +138,7 @@ function vauth_ldap_auth($username, $password) {
return $results;
} // If bind fails
- $sr = ldap_search($ldap_link, $ldap_search_dn, "(uid=$username)");
+ $sr = ldap_search($ldap_link, $ldap_dn, "($ldap_filter=$username)");
$info = ldap_get_entries($ldap_link, $sr);
if ($info["count"] == 1) {