Show the customized "Login" message on the login screen

Summary: Depends on D19992. Ref T13222. If administrators provide a custom login message, show it on the login screen.

Test Plan:
{F6137930}

  - Viewed login screen with and without a custom message.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13222

Differential Revision: https://secure.phabricator.com/D19994
This commit is contained in:
epriestley
2019-01-17 18:29:42 -08:00
parent 2c713b2d25
commit 22ad1ff2c5
5 changed files with 53 additions and 3 deletions

View File

@@ -194,6 +194,8 @@ final class PhabricatorAuthStartController
$invite_message = $this->renderInviteHeader($invite);
}
$custom_message = $this->newCustomStartMessage();
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Login'));
$crumbs->setBorder(true);
@@ -202,6 +204,7 @@ final class PhabricatorAuthStartController
$view = array(
$header,
$invite_message,
$custom_message,
$out,
);
@@ -305,4 +308,25 @@ final class PhabricatorAuthStartController
->setURI($auto_uri);
}
private function newCustomStartMessage() {
$viewer = $this->getViewer();
$text = PhabricatorAuthMessage::loadMessageText(
$viewer,
PhabricatorAuthLoginMessageType::MESSAGEKEY);
if (!strlen($text)) {
return null;
}
$remarkup_view = new PHUIRemarkupView($viewer, $text);
return phutil_tag(
'div',
array(
'class' => 'auth-custom-message',
),
$remarkup_view);
}
}