fixed messages if user suffix is invalid
This commit is contained in:
parent
2ef09760f4
commit
0e34df01c7
|
@ -113,13 +113,15 @@ class Ldap{
|
||||||
// users have the attribute "posixAccount" or "sambaAccount" and uid $name
|
// users have the attribute "posixAccount" or "sambaAccount" and uid $name
|
||||||
$filter = "(&(|(objectClass=posixAccount) (objectClass=sambaAccount)) (uid=$name))";
|
$filter = "(&(|(objectClass=posixAccount) (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) {
|
||||||
$info = ldap_get_entries($this->server, $sr);
|
$info = ldap_get_entries($this->server, $sr);
|
||||||
// return only first DN entry
|
// return only first DN entry
|
||||||
$ret = $info[0]["dn"];
|
$ret = $info[0]["dn"];
|
||||||
ldap_free_result($sr);
|
ldap_free_result($sr);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// returns the LDAP connection handle
|
// returns the LDAP connection handle
|
||||||
function server() {
|
function server() {
|
||||||
|
|
Loading…
Reference in New Issue