Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120016141
PhabricatorAuthInvite.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
Tue, Jul 1, 09:10
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Jul 3, 09:10 (2 d)
Engine
blob
Format
Raw Data
Handle
27126549
Attached To
rPH Phabricator
PhabricatorAuthInvite.php
View Options
<?php
final
class
PhabricatorAuthInvite
extends
PhabricatorUserDAO
{
protected
$authorPHID
;
protected
$emailAddress
;
protected
$verificationHash
;
protected
$acceptedByPHID
;
private
$verificationCode
;
protected
function
getConfiguration
()
{
return
array
(
self
::
CONFIG_COLUMN_SCHEMA
=>
array
(
'emailAddress'
=>
'sort128'
,
'verificationHash'
=>
'bytes12'
,
'acceptedByPHID'
=>
'phid?'
,
),
self
::
CONFIG_KEY_SCHEMA
=>
array
(
'key_address'
=>
array
(
'columns'
=>
array
(
'emailAddress'
),
'unique'
=>
true
,
),
'key_code'
=>
array
(
'columns'
=>
array
(
'verificationHash'
),
'unique'
=>
true
,
),
),
)
+
parent
::
getConfiguration
();
}
public
function
getVerificationCode
()
{
if
(!
$this
->
getVerificationHash
())
{
if
(
$this
->
verificationHash
)
{
throw
new
Exception
(
pht
(
'Verification code can not be regenerated after an invite is '
.
'created.'
));
}
$this
->
verificationCode
=
Filesystem
::
readRandomCharacters
(
16
);
}
return
$this
->
verificationCode
;
}
public
function
save
()
{
if
(!
$this
->
getVerificationHash
())
{
$hash
=
PhabricatorHash
::
digestForIndex
(
$this
->
getVerificationCode
());
$this
->
setVerificationHash
(
$hash
);
}
return
parent
::
save
();
}
}
Event Timeline
Log In to Comment