From e901ec494134675f0bcc1489daf26b516ceb615e Mon Sep 17 00:00:00 2001 From: felixboehm Date: Mon, 4 Jul 2016 14:16:13 +0200 Subject: [PATCH] check if renamed user is still valid by reapplying the ldap filter (#25338) --- apps/user_ldap/lib/User_LDAP.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php index 230c82a304..7929394893 100644 --- a/apps/user_ldap/lib/User_LDAP.php +++ b/apps/user_ldap/lib/User_LDAP.php @@ -228,6 +228,10 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn return false; } $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))) { + return false; + } $this->access->getUserMapper()->setDNbyUUID($newDn, $uuid); return true; } catch (\Exception $e) {