search_username now returns Unix-only accounts, too
This commit is contained in:
parent
ef5026aadb
commit
15da8f76f0
|
@ -123,14 +123,7 @@ class Ldap{
|
||||||
// searches LDAP for a specific user name
|
// searches LDAP for a specific user name
|
||||||
// and returns its DN entry
|
// and returns its DN entry
|
||||||
function search_username($name) {
|
function search_username($name) {
|
||||||
if ($this->conf->is_samba3()) {
|
$filter = "(uid=$name)";
|
||||||
// users have the attribute "posixAccount" or "sambaSamAccount" and uid $name
|
|
||||||
$filter = "(&(objectClass=sambaSamAccount) (uid=$name))";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// users have the attribute "posixAccount" or "sambaAccount" and uid $name
|
|
||||||
$filter = "(&(objectClass=sambaAccount) (uid=$name))";
|
|
||||||
}
|
|
||||||
$attrs = array();
|
$attrs = array();
|
||||||
$sr = @ldap_search($this->server, $this->conf->get_UserSuffix(), $filter, $attrs);
|
$sr = @ldap_search($this->server, $this->conf->get_UserSuffix(), $filter, $attrs);
|
||||||
if ($sr) {
|
if ($sr) {
|
||||||
|
|
Loading…
Reference in New Issue