Merge pull request #17723 from owncloud/fix-17631

fix runtime caching in ldap's user manager, fixes #17631
This commit is contained in:
blizzz 2015-07-20 09:29:15 +02:00
commit f573659b3a
2 changed files with 145 additions and 137 deletions

View File

@ -110,8 +110,8 @@ class Manager {
$user = new User($uid, $dn, $this->access, $this->ocConfig,
$this->ocFilesystem, clone $this->image, $this->ocLog,
$this->avatarManager);
$users['byDN'][$dn] = $user;
$users['byUid'][$uid] = $user;
$this->users['byDN'][$dn] = $user;
$this->users['byUid'][$uid] = $user;
return $user;
}

View File

@ -64,6 +64,10 @@ class Test_User_Manager extends \Test\TestCase {
$manager->setLdapAccess($access);
$user = $manager->get($inputDN);
// Now we fetch the user again. If this leads to a failing test,
// runtime caching the manager is broken.
$user = $manager->get($inputDN);
$this->assertInstanceOf('\OCA\user_ldap\lib\user\User', $user);
}
@ -173,6 +177,10 @@ class Test_User_Manager extends \Test\TestCase {
$manager->setLdapAccess($access);
$user = $manager->get($uid);
// Now we fetch the user again. If this leads to a failing test,
// runtime caching the manager is broken.
$user = $manager->get($uid);
$this->assertInstanceOf('\OCA\user_ldap\lib\user\User', $user);
}