Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F79326497
PhabricatorExternalAccount.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, Aug 25, 20:37
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Aug 27, 20:37 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20175592
Attached To
rPH Phabricator
PhabricatorExternalAccount.php
View Options
<?php
final
class
PhabricatorExternalAccount
extends
PhabricatorUserDAO
{
protected
$userPHID
;
protected
$accountType
;
protected
$accountDomain
;
protected
$accountSecret
;
protected
$accountID
;
protected
$displayName
;
protected
$username
;
protected
$realName
;
protected
$email
;
protected
$emailVerified
=
0
;
protected
$accountURI
;
protected
$profileImagePHID
;
protected
$properties
=
array
();
public
function
generatePHID
()
{
return
PhabricatorPHID
::
generateNewPHID
(
PhabricatorPHIDConstants
::
PHID_TYPE_XUSR
);
}
public
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_AUX_PHID
=>
true
,
self
::
CONFIG_SERIALIZATION
=>
array
(
'properties'
=>
self
::
SERIALIZATION_JSON
,
),
)
+
parent
::
getConfiguration
();
}
public
function
getPhabricatorUser
()
{
$tmp_usr
=
id
(
new
PhabricatorUser
())
->
makeEphemeral
()
->
setPHID
(
$this
->
getPHID
());
return
$tmp_usr
;
}
public
function
getProviderKey
()
{
return
$this
->
getAccountType
().
':'
.
$this
->
accountDomain
();
}
public
function
save
()
{
if
(!
$this
->
getAccountSecret
())
{
$this
->
setAccountSecret
(
Filesystem
::
readRandomCharacters
(
32
));
}
return
parent
::
save
();
}
public
function
setProperty
(
$key
,
$value
)
{
$this
->
properties
[
$key
]
=
$value
;
return
$this
;
}
public
function
getProperty
(
$key
,
$default
=
null
)
{
return
idx
(
$this
->
properties
,
$key
,
$default
);
}
}
Event Timeline
Log In to Comment