diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-11-22 14:49:34 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-11-22 14:49:34 +0100 |
commit | 51ea7dc0208ef85e0318f5426c751cd9fc301ddb (patch) | |
tree | c4346431f3cf7544fb6df95e540cde0039595987 | |
parent | 68fecc1d9f6810e815c6a6ba80d4c13a0bde98b8 (diff) | |
download | nextcloud-server-51ea7dc0208ef85e0318f5426c751cd9fc301ddb.tar.gz nextcloud-server-51ea7dc0208ef85e0318f5426c751cd9fc301ddb.zip |
Make sure mapping cache is cleared when deleting a user
This avoids phantom remnants staying after user deletion
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | apps/user_ldap/lib/Mapping/AbstractMapping.php | 5 |
1 files changed, 5 insertions, 0 deletions
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]); } |