]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure mapping cache is cleared when deleting a user
authorCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 22 Nov 2021 13:49:34 +0000 (14:49 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Tue, 23 Nov 2021 10:23:14 +0000 (10:23 +0000)
This avoids phantom remnants staying after user deletion

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/user_ldap/lib/Mapping/AbstractMapping.php

index dcff88de008bd4e369cd2117124f561f3985de53..50cf57ac5f946cbc16e54dea937ab1864b29fca1 100644 (file)
@@ -380,6 +380,11 @@ abstract class AbstractMapping {
                        DELETE FROM `' . $this->getTableName() . '`
                        WHERE `owncloud_name` = ?');
 
+               $dn = array_search($name, $this->cache);
+               if ($dn !== false) {
+                       unset($this->cache[$dn]);
+               }
+
                return $this->modify($statement, [$name]);
        }