summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-06-03 13:46:05 +0200
committerRobin Appelman <icewind@owncloud.com>2013-06-03 13:46:05 +0200
commit2a82964830e79e0af7a66027cc885174f9954f4d (patch)
treee069a81ff2ab9ac2ea96243c2ac95a6544ddd21f
parent83fbdc903f324dc2a789f5b8ebedb020f7727d89 (diff)
downloadnextcloud-server-2a82964830e79e0af7a66027cc885174f9954f4d.tar.gz
nextcloud-server-2a82964830e79e0af7a66027cc885174f9954f4d.zip
use caching for userExists
-rw-r--r--lib/user/manager.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/user/manager.php b/lib/user/manager.php
index 9adf66c825c..07ebed83971 100644
--- a/lib/user/manager.php
+++ b/lib/user/manager.php
@@ -66,6 +66,7 @@ class Manager extends PublicEmitter {
* remove all user backends
*/
public function clearBackends() {
+ $this->cachedUsers = array();
$this->backends = array();
}
@@ -109,12 +110,8 @@ class Manager extends PublicEmitter {
* @return bool
*/
public function userExists($uid) {
- foreach ($this->backends as $backend) {
- if ($backend->userExists($uid)) {
- return true;
- }
- }
- return false;
+ $user = $this->get($uid);
+ return ($user !== null);
}
/**