From 7df5bfb84ac979e26cd23042bc8bbcf53d3f6ae6 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 6 Mar 2016 14:22:50 -0500 Subject: Add function getDisplayName() to User class If a user has an alias set, it should be displayed throughout the app instead of the username. --- app/class/user.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/class/user.class.php b/app/class/user.class.php index bd2e174..4f1bbfe 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -120,6 +120,17 @@ class User extends Object $key = $this->getKey($password, $this->salt); return $key == $this->key; } + + /* + * If a user has an alias set, display it instead of their username + */ + function getDisplayName() + { + if ($this->alias != "") + return $this->alias; + + return $this->name; + } } ?> -- cgit v1.2.3