]> source.dussan.org Git - nextcloud-server.git/commitdiff
use caching for userExists
authorRobin Appelman <icewind@owncloud.com>
Mon, 3 Jun 2013 11:46:05 +0000 (13:46 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 3 Jun 2013 11:46:05 +0000 (13:46 +0200)
lib/user/manager.php

index 9adf66c825c4db5162819397ccee3227e2c888c2..07ebed83971d31a84e4cbba07d796096d0a62da9 100644 (file)
@@ -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);
        }
 
        /**