don't force LDAP updates on userExists anymore

and remove some deprecated code

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2018-08-14 17:57:24 +02:00
parent 7dfb837766
commit 0f958bf595
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 1 additions and 9 deletions

View File

@ -317,11 +317,6 @@ 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, '', $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);
}
try {
$uuid = $this->access->getUserMapper()->getUUIDByDN($dn);
if (!$uuid) {
@ -329,7 +324,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
}
$newDn = $this->access->getUserDnByUuid($uuid);
//check if renamed user is still valid by reapplying the ldap filter
if (!is_array($this->access->readAttribute($newDn, '', $this->access->connection->ldapUserFilter))) {
if ($newDn === $dn || !is_array($this->access->readAttribute($newDn, '', $this->access->connection->ldapUserFilter))) {
return false;
}
$this->access->getUserMapper()->setDNbyUUID($newDn, $uuid);
@ -375,9 +370,6 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
$result = $this->userExistsOnLDAP($user);
$this->access->connection->writeToCache('userExists'.$uid, $result);
if($result === true) {
$user->update();
}
return $result;
}