use caching for userExists

This commit is contained in:
Robin Appelman 2013-06-03 13:46:05 +02:00
parent 83fbdc903f
commit 2a82964830
1 changed files with 3 additions and 6 deletions

View 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);
}
/**