diff options
author | Malf Furious <m@lfurio.us> | 2016-03-06 14:22:50 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2016-03-27 20:16:32 -0400 |
commit | 7df5bfb84ac979e26cd23042bc8bbcf53d3f6ae6 (patch) | |
tree | d20b9ca54d6f6f8cd8a33143a3f96bd6fcb01ce6 /app/class/user.class.php | |
parent | 493e10764abe630e2537f72e3b98d95e6a679b6a (diff) | |
download | scrott-7df5bfb84ac979e26cd23042bc8bbcf53d3f6ae6.tar.gz scrott-7df5bfb84ac979e26cd23042bc8bbcf53d3f6ae6.zip |
Add function getDisplayName() to User class
If a user has an alias set, it should be displayed throughout the app instead of the username.
Diffstat (limited to 'app/class/user.class.php')
-rw-r--r-- | app/class/user.class.php | 11 |
1 files changed, 11 insertions, 0 deletions
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; + } } ?> |