diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Helper/UserHelper.php | 3 | ||||
-rw-r--r-- | app/Model/UserModel.php | 13 |
2 files changed, 3 insertions, 13 deletions
diff --git a/app/Helper/UserHelper.php b/app/Helper/UserHelper.php index ab259a62..e42bafe4 100644 --- a/app/Helper/UserHelper.php +++ b/app/Helper/UserHelper.php @@ -50,7 +50,8 @@ class UserHelper extends Base */ public function getFullname(array $user = array()) { - return $this->userModel->getFullname(empty($user) ? $this->userSession->getAll() : $user); + $user = empty($user) ? $this->userSession->getAll() : $user; + return $user['name'] ?: $user['username']; } /** diff --git a/app/Model/UserModel.php b/app/Model/UserModel.php index f7a051c5..56b1a960 100644 --- a/app/Model/UserModel.php +++ b/app/Model/UserModel.php @@ -65,17 +65,6 @@ class UserModel extends Base } /** - * Return the full name - * - * @param array $user User properties - * @return string - */ - public function getFullname(array $user) - { - return $user['name'] ?: $user['username']; - } - - /** * Return true is the given user id is administrator * * @access public @@ -230,7 +219,7 @@ class UserModel extends Base $result = array(); foreach ($users as $user) { - $result[$user['id']] = $this->getFullname($user); + $result[$user['id']] = $this->helper->user->getFullname($user); } asort($result); |