mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Tailor the "No Access" message for logged-out users of Spaces
Summary: Fixes T8759. Test Plan: {F593519} Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T8759 Differential Revision: https://secure.phabricator.com/D13560
This commit is contained in:
parent
bdd0e340ff
commit
db6b729cf9
1 changed files with 36 additions and 9 deletions
|
@ -4,17 +4,44 @@ final class PhabricatorSpacesNoAccessController
|
||||||
extends PhabricatorSpacesController {
|
extends PhabricatorSpacesController {
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
public function handleRequest(AphrontRequest $request) {
|
||||||
return $this->newDialog()
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
|
$dialog = $this->newDialog()
|
||||||
->setTitle(pht('No Access to Spaces'))
|
->setTitle(pht('No Access to Spaces'))
|
||||||
|
->addCancelButton('/', pht('Drift Aimlessly'));
|
||||||
|
|
||||||
|
if ($viewer->isLoggedIn()) {
|
||||||
|
$dialog
|
||||||
->appendParagraph(
|
->appendParagraph(
|
||||||
pht(
|
pht(
|
||||||
'This install uses spaces to organize objects, but your account '.
|
'This install uses spaces to organize objects, but your account '.
|
||||||
'does not have access to any spaces.'))
|
'does not have access to any spaces.'))
|
||||||
->appendParagraph(
|
->appendParagraph(
|
||||||
pht(
|
pht(
|
||||||
'Ask someone to add you to a Space so you can view and create '.
|
'Ask someone to give you access to a space so you can view and '.
|
||||||
'objects.'))
|
'create objects.'));
|
||||||
->addCancelButton('/', pht('Drift Aimlessly'));
|
} else {
|
||||||
|
// Tailor the message a bit for logged-out users.
|
||||||
|
$dialog
|
||||||
|
->appendParagraph(
|
||||||
|
pht(
|
||||||
|
'This install uses spaces to organize objects, but logged out '.
|
||||||
|
'users do not have access to any spaces.'))
|
||||||
|
->appendParagraph(
|
||||||
|
pht(
|
||||||
|
'Log in, or ask someone to create a public space which logged '.
|
||||||
|
'out users are permitted to access.'))
|
||||||
|
->appendParagraph(
|
||||||
|
pht(
|
||||||
|
'(This error generally indicates that %s is enabled, but there '.
|
||||||
|
'are no spaces with a "%s" view policy. These settings are '.
|
||||||
|
'contradictory and imply a misconfiguration.)',
|
||||||
|
phutil_tag('tt', array(), 'policy.allow-public'),
|
||||||
|
pht('Public (No Login Required)')));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue