diff --git a/lam/lib/ldap.inc b/lam/lib/ldap.inc index 1090463f..daa2bade 100644 --- a/lam/lib/ldap.inc +++ b/lam/lib/ldap.inc @@ -113,8 +113,14 @@ class Ldap{ // searches LDAP for a specific user name // and returns its DN entry function search_username($name) { - // users have the attribute "posixAccount" or "sambaAccount" and uid $name - $filter = "(&(|(objectClass=posixAccount) (objectClass=sambaAccount)) (uid=$name))"; + if ($this->conf->get_samba3() == "yes") { + // users have the attribute "posixAccount" or "sambaSamAccount" and uid $name + $filter = "(&(|(objectClass=posixAccount) (objectClass=sambaSamAccount)) (uid=$name))"; + } + else { + // users have the attribute "posixAccount" or "sambaAccount" and uid $name + $filter = "(&(|(objectClass=posixAccount) (objectClass=sambaAccount)) (uid=$name))"; + } $attrs = array(); $sr = @ldap_search($this->server, $this->conf->get_UserSuffix(), $filter, $attrs); if ($sr) { diff --git a/lam/templates/lists/listhosts.php b/lam/templates/lists/listhosts.php index e0b012b4..abf4d530 100644 --- a/lam/templates/lists/listhosts.php +++ b/lam/templates/lists/listhosts.php @@ -103,8 +103,14 @@ for ($k = 0; $k < sizeof($desc_array); $k++) { } // configure search filter -// Samba hosts have the attribute "sambaAccount" and end with "$" -$filter = "(&(objectClass=sambaAccount) (uid=*$)"; +if ($_SESSION['config']->get_samba3() == "yes") { + // Samba hosts have the attribute "sambaSamAccount" and end with "$" + $filter = "(&(objectClass=sambaSamAccount) (uid=*$)"; +} +else { + // Samba hosts have the attribute "sambaAccount" and end with "$" + $filter = "(&(objectClass=sambaAccount) (uid=*$)"; +} for ($k = 0; $k < sizeof($desc_array); $k++) { if ($_POST["filter" . strtolower($attr_array[$k])]) $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" .