From b497b0686790c250825b8d631b403bb27d2ba2c8 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 14 Aug 2018 17:57:24 +0200 Subject: don't force LDAP updates on userExists anymore and remove some deprecated code Signed-off-by: Arthur Schiwon --- apps/user_ldap/lib/User_LDAP.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'apps') diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index ca7e0b304ea..11ed02f47ab 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -318,11 +318,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) { @@ -330,7 +325,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); @@ -376,9 +371,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; } -- cgit v1.2.3