Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F105317623
UserConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Mar 16, 06:38
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Mar 18, 06:38 (2 d)
Engine
blob
Format
Raw Data
Handle
24961071
Attached To
rPH Phabricator
UserConduitAPIMethod.php
View Options
<?php
abstract
class
UserConduitAPIMethod
extends
ConduitAPIMethod
{
final
public
function
getApplication
()
{
return
PhabricatorApplication
::
getByClass
(
'PhabricatorPeopleApplication'
);
}
protected
function
buildUserInformationDictionary
(
PhabricatorUser
$user
,
PhabricatorCalendarEvent
$current_status
=
null
)
{
$roles
=
array
();
if
(
$user
->
getIsDisabled
())
{
$roles
[]
=
'disabled'
;
}
if
(
$user
->
getIsSystemAgent
())
{
$roles
[]
=
'agent'
;
}
if
(
$user
->
getIsAdmin
())
{
$roles
[]
=
'admin'
;
}
$primary
=
$user
->
loadPrimaryEmail
();
if
(
$primary
&&
$primary
->
getIsVerified
())
{
$roles
[]
=
'verified'
;
}
else
{
$roles
[]
=
'unverified'
;
}
if
(
$user
->
getIsApproved
())
{
$roles
[]
=
'approved'
;
}
if
(
$user
->
isUserActivated
())
{
$roles
[]
=
'activated'
;
}
$return
=
array
(
'phid'
=>
$user
->
getPHID
(),
'userName'
=>
$user
->
getUserName
(),
'realName'
=>
$user
->
getRealName
(),
'image'
=>
$user
->
loadProfileImageURI
(),
'uri'
=>
PhabricatorEnv
::
getURI
(
'/p/'
.
$user
->
getUsername
().
'/'
),
'roles'
=>
$roles
,
);
if
(
$current_status
)
{
$return
[
'currentStatus'
]
=
$current_status
->
getTextStatus
();
$return
[
'currentStatusUntil'
]
=
$current_status
->
getDateTo
();
}
return
$return
;
}
}
Event Timeline
Log In to Comment