diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php --- a/src/applications/base/controller/PhabricatorController.php +++ b/src/applications/base/controller/PhabricatorController.php @@ -608,6 +608,7 @@ $this->setCurrentApplication($application); $controller = new LegalpadDocumentSignController(); + $controller->setIsSessionGate(true); return $this->delegateToController($controller); } diff --git a/src/applications/legalpad/controller/LegalpadDocumentSignController.php b/src/applications/legalpad/controller/LegalpadDocumentSignController.php --- a/src/applications/legalpad/controller/LegalpadDocumentSignController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentSignController.php @@ -2,6 +2,8 @@ final class LegalpadDocumentSignController extends LegalpadController { + private $isSessionGate; + public function shouldAllowPublic() { return true; } @@ -10,6 +12,15 @@ return true; } + public function setIsSessionGate($is_session_gate) { + $this->isSessionGate = $is_session_gate; + return $this; + } + + public function getIsSessionGate() { + return $this->isSessionGate; + } + public function handleRequest(AphrontRequest $request) { $viewer = $request->getUser(); @@ -251,8 +262,14 @@ $header = id(new PHUIHeaderView()) ->setHeader($title) ->setUser($viewer) - ->setEpoch($content_updated) - ->addActionLink( + ->setEpoch($content_updated); + + // If we're showing the user this document because it's required to use + // Phabricator and they haven't signed it, don't show the "Manage" button, + // since it won't work. + $is_gate = $this->getIsSessionGate(); + if (!$is_gate) { + $header->addActionLink( id(new PHUIButtonView()) ->setTag('a') ->setIcon('fa-pencil') @@ -260,6 +277,7 @@ ->setHref($manage_uri) ->setDisabled(!$can_edit) ->setWorkflow(!$can_edit)); + } $preamble_box = null; if (strlen($document->getPreamble())) {