diff --git a/bl-kernel/user.class.php b/bl-kernel/user.class.php index 275abab7..75a6b746 100644 --- a/bl-kernel/user.class.php +++ b/bl-kernel/user.class.php @@ -49,6 +49,11 @@ class User { return $this->getValue('username'); } + public function description() + { + return $this->getValue('description'); + } + public function nickname() { return $this->getValue('nickname'); @@ -149,4 +154,28 @@ class User { return DOMAIN_UPLOADS_PROFILES.$filename; } + public function json($returnsArray=false) + { + $tmp['username'] = $this->username(); + $tmp['firstName'] = $this->firstName(); + $tmp['lastName'] = $this->lastName(); + $tmp['nickname'] = $this->nickname(); + $tmp['description'] = $this->description(); + $tmp['twitter'] = $this->twitter(); + $tmp['facebook'] = $this->facebook(); + $tmp['codepen'] = $this->codepen(); + $tmp['instagram'] = $this->instagram(); + $tmp['github'] = $this->github(); + $tmp['gitlab'] = $this->gitlab(); + $tmp['linkedin'] = $this->linkedin(); + $tmp['mastodon'] = $this->mastodon(); + $tmp['profilePicture'] = $this->profilePicture(); + + if ($returnsArray) { + return $tmp; + } + + return json_encode($tmp); + } + } \ No newline at end of file