mirror of
https://github.com/nextcloud/server.git
synced 2026-03-19 17:13:56 -04:00
Merge pull request #29848 from nextcloud/backport/29836/stable23
[stable23] Make sure mapping cache is cleared when deleting a user
This commit is contained in:
commit
1441f46bbe
2 changed files with 9 additions and 0 deletions
|
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,8 +127,12 @@ abstract class AbstractMappingTest extends \Test\TestCase {
|
|||
[$mapper, $data] = $this->initTest();
|
||||
|
||||
foreach ($data as $entry) {
|
||||
$fdnBefore = $mapper->getDNByName($entry['name']);
|
||||
$result = $mapper->unmap($entry['name']);
|
||||
$fdnAfter = $mapper->getDNByName($entry['name']);
|
||||
$this->assertTrue($result);
|
||||
$this->assertSame($fdnBefore, $entry['dn']);
|
||||
$this->assertFalse($fdnAfter);
|
||||
}
|
||||
|
||||
$result = $mapper->unmap('notAnEntry');
|
||||
|
|
|
|||
Loading…
Reference in a new issue