mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
LDAP: silence warning, but handle the error
This commit is contained in:
parent
25ad1d5c3e
commit
b10f7aafb7
1 changed files with 6 additions and 1 deletions
|
|
@ -48,7 +48,12 @@ abstract class Access {
|
|||
return false;
|
||||
}
|
||||
$cr = $this->connection->getConnectionResource();
|
||||
$rr = ldap_read($cr, $dn, 'objectClass=*', array($attr));
|
||||
$rr = @ldap_read($cr, $dn, 'objectClass=*', array($attr));
|
||||
if(!is_resource($rr)) {
|
||||
\OCP\Util::writeLog('user_ldap', 'readAttribute failed for DN '.$dn, \OCP\Util::DEBUG);
|
||||
//in case an error occurs , e.g. object does not exist
|
||||
return false;
|
||||
}
|
||||
$er = ldap_first_entry($cr, $rr);
|
||||
//LDAP attributes are not case sensitive
|
||||
$result = \OCP\Util::mb_array_change_key_case(ldap_get_attributes($cr, $er), MB_CASE_LOWER, 'UTF-8');
|
||||
|
|
|
|||
Loading…
Reference in a new issue