Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUser.php
| Show All 10 Lines | final class PhabricatorUser | ||||
| implements | implements | ||||
| PhutilPerson, | PhutilPerson, | ||||
| PhabricatorPolicyInterface, | PhabricatorPolicyInterface, | ||||
| PhabricatorCustomFieldInterface, | PhabricatorCustomFieldInterface, | ||||
| PhabricatorDestructibleInterface, | PhabricatorDestructibleInterface, | ||||
| PhabricatorSSHPublicKeyInterface, | PhabricatorSSHPublicKeyInterface, | ||||
| PhabricatorFlaggableInterface, | PhabricatorFlaggableInterface, | ||||
| PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
| PhabricatorFulltextInterface { | PhabricatorFulltextInterface, | ||||
| PhabricatorConduitResultInterface { | |||||
| const SESSION_TABLE = 'phabricator_session'; | const SESSION_TABLE = 'phabricator_session'; | ||||
| const NAMETOKEN_TABLE = 'user_nametoken'; | const NAMETOKEN_TABLE = 'user_nametoken'; | ||||
| const MAXIMUM_USERNAME_LENGTH = 64; | const MAXIMUM_USERNAME_LENGTH = 64; | ||||
| protected $userName; | protected $userName; | ||||
| protected $realName; | protected $realName; | ||||
| protected $sex; | protected $sex; | ||||
| ▲ Show 20 Lines • Show All 1,356 Lines • ▼ Show 20 Lines | |||||
| /* -( PhabricatorFulltextInterface )--------------------------------------- */ | /* -( PhabricatorFulltextInterface )--------------------------------------- */ | ||||
| public function newFulltextEngine() { | public function newFulltextEngine() { | ||||
| return new PhabricatorUserFulltextEngine(); | return new PhabricatorUserFulltextEngine(); | ||||
| } | } | ||||
| /* -( PhabricatorConduitResultInterface )---------------------------------- */ | |||||
| public function getFieldSpecificationsForConduit() { | |||||
| return array( | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('username') | |||||
| ->setType('string') | |||||
| ->setDescription(pht("The user's username.")), | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('realName') | |||||
| ->setType('string') | |||||
| ->setDescription(pht("The user's real name.")), | |||||
| id(new PhabricatorConduitSearchFieldSpecification()) | |||||
| ->setKey('roles') | |||||
| ->setType('list<string>') | |||||
| ->setDescription(pht('List of acccount roles.')), | |||||
| ); | |||||
| } | |||||
| public function getFieldValuesForConduit() { | |||||
| $roles = array(); | |||||
| if ($this->getIsDisabled()) { | |||||
| $roles[] = 'disabled'; | |||||
| } | |||||
| if ($this->getIsSystemAgent()) { | |||||
| $roles[] = 'bot'; | |||||
| } | |||||
| if ($this->getIsMailingList()) { | |||||
| $roles[] = 'list'; | |||||
| } | |||||
| if ($this->getIsAdmin()) { | |||||
| $roles[] = 'admin'; | |||||
| } | |||||
| if ($this->getIsEmailVerified()) { | |||||
| $roles[] = 'verified'; | |||||
| } | |||||
| if ($this->getIsApproved()) { | |||||
| $roles[] = 'approved'; | |||||
| } | |||||
| if ($this->isUserActivated()) { | |||||
| $roles[] = 'activated'; | |||||
| } | |||||
| return array( | |||||
| 'username' => $this->getUsername(), | |||||
| 'realName' => $this->getRealName(), | |||||
| 'roles' => $roles, | |||||
| ); | |||||
| } | |||||
| public function getConduitSearchAttachments() { | |||||
| return array(); | |||||
| } | |||||
| } | } | ||||