summaryrefslogtreecommitdiff
path: root/modules/user/models/user.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-07-19 16:50:35 -0700
committerBharat Mediratta <bharat@menalto.com>2009-07-19 16:50:35 -0700
commit51dca582cd2cda9416ec0172f8ed9a19ba828fec (patch)
tree66f988ab4dd00d25a32452cdd2aa32835cb5dcd9 /modules/user/models/user.php
parent2572e5810f9d66fa39fa97838818a25bf4f393f3 (diff)
More thorough fix for #421. Create User_Model::display_name() which
uses the full name if there is one, or falls back to the name if that's all we have.
Diffstat (limited to 'modules/user/models/user.php')
-rw-r--r--modules/user/models/user.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/user/models/user.php b/modules/user/models/user.php
index 0234f186..def65a6f 100644
--- a/modules/user/models/user.php
+++ b/modules/user/models/user.php
@@ -72,4 +72,13 @@ class User_Model extends ORM {
}
return $this;
}
+
+ /**
+ * Return the best version of the user's name. Either their specified full name, or fall back
+ * to the user name.
+ * @return string
+ */
+ public function display_name() {
+ return empty($this->full_name) ? $this->name : $this->full_name;
+ }
} \ No newline at end of file