Skip to content
Snippets Groups Projects
Commit b10f7aaf authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

LDAP: silence warning, but handle the error

parent 25ad1d5c
Branches
No related tags found
No related merge requests found
......@@ -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');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment