Page MenuHomePhabricator

D20312.diff
No OneTemporary

D20312.diff

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())) {

File Metadata

Mime Type
text/plain
Expires
Sun, May 12, 2:57 AM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6284697
Default Alt Text
D20312.diff (2 KB)

Event Timeline