diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-05-19 01:21:37 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-05-19 01:21:37 +0200 |
commit | 804020bb6d7822a7010c3b8f95c25c2521b09a45 (patch) | |
tree | d8d0ec22414b17358d98a6665a5977e332aa7f18 /lib/private/user | |
parent | db9cfaa56dfaedf628755a7678249d24ad9f1ea5 (diff) | |
parent | f569c721a64486d0e7c7e307ed77ac0caed2dc2d (diff) | |
download | nextcloud-server-804020bb6d7822a7010c3b8f95c25c2521b09a45.tar.gz nextcloud-server-804020bb6d7822a7010c3b8f95c25c2521b09a45.zip |
Merge pull request #7363 from owncloud/optimize-startup-queries
Optimize some queries that are always executed when loading base.php
Diffstat (limited to 'lib/private/user')
-rw-r--r-- | lib/private/user/user.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/user/user.php b/lib/private/user/user.php index 229cbf68ff1..bc5c541e521 100644 --- a/lib/private/user/user.php +++ b/lib/private/user/user.php @@ -55,11 +55,6 @@ class User { */ public function __construct($uid, $backend, $emitter = null, $config = null) { $this->uid = $uid; - if ($backend and $backend->implementsActions(OC_USER_BACKEND_GET_DISPLAYNAME)) { - $this->displayName = $backend->getDisplayName($uid); - } else { - $this->displayName = $uid; - } $this->backend = $backend; $this->emitter = $emitter; $this->config = $config; @@ -86,6 +81,13 @@ class User { * @return string */ public function getDisplayName() { + if (!isset($this->displayName)) { + if ($this->backend and $this->backend->implementsActions(OC_USER_BACKEND_GET_DISPLAYNAME)) { + $this->displayName = $this->backend->getDisplayName($this->uid); + } else { + $this->displayName = $this->uid; + } + } return $this->displayName; } |