From 51ea7dc0208ef85e0318f5426c751cd9fc301ddb Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Mon, 22 Nov 2021 14:49:34 +0100 Subject: Make sure mapping cache is cleared when deleting a user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids phantom remnants staying after user deletion Signed-off-by: Côme Chilliet --- apps/user_ldap/lib/Mapping/AbstractMapping.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php index ae881f9dc17..85fc91590fb 100644 --- a/apps/user_ldap/lib/Mapping/AbstractMapping.php +++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php @@ -379,6 +379,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]); } -- cgit v1.2.3