3 abstract class UserConduitAPIMethod
extends ConduitAPIMethod
{
5 final public function getApplication() {
6 return PhabricatorApplication
::getByClass('PhabricatorPeopleApplication');
9 protected function buildUserInformationDictionary(
10 PhabricatorUser
$user,
12 $with_availability = false) {
15 if ($user->getIsDisabled()) {
16 $roles[] = 'disabled';
18 if ($user->getIsSystemAgent()) {
21 if ($user->getIsMailingList()) {
24 if ($user->getIsAdmin()) {
28 $primary = $user->loadPrimaryEmail();
29 if ($primary && $primary->getIsVerified()) {
30 $email = $primary->getAddress();
31 $roles[] = 'verified';
34 $roles[] = 'unverified';
37 if ($user->getIsApproved()) {
38 $roles[] = 'approved';
41 if ($user->isUserActivated()) {
42 $roles[] = 'activated';
46 'phid' => $user->getPHID(),
47 'userName' => $user->getUserName(),
48 'realName' => $user->getRealName(),
49 'image' => $user->getProfileImageURI(),
50 'uri' => PhabricatorEnv
::getURI('/p/'.$user->getUsername().'/'),
55 $return['primaryEmail'] = $email;
58 if ($with_availability) {
59 // TODO: Modernize this once we have a more long-term view of what the
61 $until = $user->getAwayUntil();
63 $return['currentStatus'] = 'away';
64 $return['currentStatusUntil'] = $until;