[Pkg-owncloud-commits] [owncloud] 18/153: Delay fetching the display name until it is requested
David Prévot
taffit at moszumanska.debian.org
Tue May 27 03:05:28 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit f4f72e77d8bf312b6fc693d43ef5fc831130db3b
Author: Bart Visscher <bartv at thisnet.nl>
Date: Fri Feb 21 22:53:31 2014 +0100
Delay fetching the display name until it is requested
---
lib/private/user/user.php | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lib/private/user/user.php b/lib/private/user/user.php
index ef5364c..710f906 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;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list