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:
parent
7dfb837766
commit
0f958bf595
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue