diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-07-17 18:57:56 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-07-17 18:57:56 +0200 |
commit | 4f910221c4f538fba44c0cafd6ad6c342ccc7f28 (patch) | |
tree | 077832a90946d37c241bef9945d98d1bd625c736 /apps | |
parent | 37d085901b5eec59d1cf79356c7e8656599bc638 (diff) | |
download | nextcloud-server-4f910221c4f538fba44c0cafd6ad6c342ccc7f28.tar.gz nextcloud-server-4f910221c4f538fba44c0cafd6ad6c342ccc7f28.zip |
fix runtime caching in ldap's user manager, fixes #17631
Diffstat (limited to 'apps')
-rw-r--r-- | apps/user_ldap/lib/user/manager.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/tests/user/manager.php | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/user/manager.php b/apps/user_ldap/lib/user/manager.php index 2f5ee3adfb7..b70e057741f 100644 --- a/apps/user_ldap/lib/user/manager.php +++ b/apps/user_ldap/lib/user/manager.php @@ -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; } diff --git a/apps/user_ldap/tests/user/manager.php b/apps/user_ldap/tests/user/manager.php index e86db6b9f81..f7e4a1a5e89 100644 --- a/apps/user_ldap/tests/user/manager.php +++ b/apps/user_ldap/tests/user/manager.php @@ -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); } |