remove non required db requests

This commit is contained in:
Loki3000 2017-01-10 13:09:33 +03:00 committed by GitHub
parent 33259b41cd
commit b0ff59d42f
1 changed files with 6 additions and 1 deletions

View File

@ -75,7 +75,6 @@ class Database extends Backend implements IUserBackend {
*/
public function __construct($eventDispatcher = null) {
$this->cache = new CappedMemoryCache();
$this->cache[null] = false;
$this->eventDispatcher = $eventDispatcher ? $eventDispatcher : \OC::$server->getEventDispatcher();
}
@ -239,6 +238,12 @@ class Database extends Backend implements IUserBackend {
*/
private function loadUser($uid) {
if (!isset($this->cache[$uid])) {
//guests $uid could be NULL or ''
if (empty($uid)) {
$this->cache[$uid]=false;
return true;
}
$query = \OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)');
$result = $query->execute(array($uid));