Merge pull request #18212 from ryno83/treat_LDAP_users_not_available_by_user_filter_as_deleted
treat LDAP users not available by user filter as deleted
This commit is contained in:
commit
000523a7fe
2 changed files with 2 additions and 2 deletions
|
@ -177,7 +177,7 @@ class Access extends LDAPUtility implements user\IUserTools {
|
|||
//in case an error occurs , e.g. object does not exist
|
||||
return false;
|
||||
}
|
||||
if (empty($attr)) {
|
||||
if (empty($attr) && ($filter === 'objectclass=*' || $this->ldap->countEntries($cr, $rr) === 1)) {
|
||||
\OCP\Util::writeLog('user_ldap', 'readAttribute: '.$dn.' found', \OCP\Util::DEBUG);
|
||||
return array();
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
|
|||
|
||||
$dn = $user->getDN();
|
||||
//check if user really still exists by reading its entry
|
||||
if(!is_array($this->access->readAttribute($dn, ''))) {
|
||||
if(!is_array($this->access->readAttribute($dn, '', $this->access->connection->ldapUserFilter))) {
|
||||
$lcr = $this->access->connection->getConnectionResource();
|
||||
if(is_null($lcr)) {
|
||||
throw new \Exception('No LDAP Connection to server ' . $this->access->connection->ldapHost);
|
||||
|
|
Loading…
Reference in a new issue