Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93529125
PhabricatorAuthInviteController.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
Fri, Nov 29, 11:58
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 11:58 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22660286
Attached To
rPH Phabricator
PhabricatorAuthInviteController.php
View Options
<?php
final
class
PhabricatorAuthInviteController
extends
PhabricatorAuthController
{
public
function
shouldRequireLogin
()
{
return
false
;
}
public
function
handleRequest
(
AphrontRequest
$request
)
{
$viewer
=
$this
->
getViewer
();
$engine
=
id
(
new
PhabricatorAuthInviteEngine
())
->
setViewer
(
$viewer
);
if
(
$request
->
isFormPost
())
{
$engine
->
setUserHasConfirmedVerify
(
true
);
}
try
{
$invite
=
$engine
->
processInviteCode
(
$request
->
getURIData
(
'code'
));
}
catch
(
PhabricatorAuthInviteDialogException
$ex
)
{
$response
=
$this
->
newDialog
()
->
setTitle
(
$ex
->
getTitle
())
->
appendParagraph
(
$ex
->
getBody
());
$submit_text
=
$ex
->
getSubmitButtonText
();
if
(
$submit_text
)
{
$response
->
addSubmitButton
(
$submit_text
);
}
$submit_uri
=
$ex
->
getSubmitButtonURI
();
if
(
$submit_uri
)
{
$response
->
setSubmitURI
(
$submit_uri
);
}
$cancel_uri
=
$ex
->
getCancelButtonURI
();
$cancel_text
=
$ex
->
getCancelButtonText
();
if
(
$cancel_uri
&&
$cancel_text
)
{
$response
->
addCancelButton
(
$cancel_uri
,
$cancel_text
);
}
else
if
(
$cancel_uri
)
{
$response
->
addCancelButton
(
$cancel_uri
);
}
return
$response
;
}
catch
(
PhabricatorAuthInviteRegisteredException
$ex
)
{
// We're all set on processing this invite, just send the user home.
return
id
(
new
AphrontRedirectResponse
())->
setURI
(
'/'
);
}
// TODO: This invite is good, but we need to drive the user through
// registration.
throw
new
Exception
(
pht
(
'TODO: Build invite/registration workflow.'
));
}
}
Event Timeline
Log In to Comment