@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+53 -3
+3 -3
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '3c8a0668', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => '7fa376a9', 12 + 'core.pkg.css' => 'e94cc920', 13 13 'core.pkg.js' => '5c737607', 14 14 'differential.pkg.css' => 'b8df73d4', 15 15 'differential.pkg.js' => '67c9ea4c', ··· 36 36 'rsrc/css/aphront/typeahead-browse.css' => 'b7ed02d2', 37 37 'rsrc/css/aphront/typeahead.css' => '8779483d', 38 38 'rsrc/css/application/almanac/almanac.css' => '2e050f4f', 39 - 'rsrc/css/application/auth/auth.css' => '9f6e4ed8', 39 + 'rsrc/css/application/auth/auth.css' => 'add92fd8', 40 40 'rsrc/css/application/base/main-menu-view.css' => '8e2d9a28', 41 41 'rsrc/css/application/base/notification-menu.css' => 'e6962e89', 42 42 'rsrc/css/application/base/phui-theme.css' => '35883b37', ··· 524 524 'aphront-tooltip-css' => 'e3f2412f', 525 525 'aphront-typeahead-control-css' => '8779483d', 526 526 'application-search-view-css' => '0f7c06d8', 527 - 'auth-css' => '9f6e4ed8', 527 + 'auth-css' => 'add92fd8', 528 528 'bulk-job-css' => '73af99f5', 529 529 'conduit-api-css' => 'ce2cfc41', 530 530 'config-options-css' => '16c920ae',
+1
src/applications/auth/controller/PhabricatorAuthLoginController.php
··· 17 17 if ($parameter_name == 'code') { 18 18 return true; 19 19 } 20 + 20 21 return parent::shouldAllowRestrictedParameter($parameter_name); 21 22 } 22 23
+24
src/applications/auth/controller/PhabricatorAuthStartController.php
··· 194 194 $invite_message = $this->renderInviteHeader($invite); 195 195 } 196 196 197 + $custom_message = $this->newCustomStartMessage(); 198 + 197 199 $crumbs = $this->buildApplicationCrumbs(); 198 200 $crumbs->addTextCrumb(pht('Login')); 199 201 $crumbs->setBorder(true); ··· 202 204 $view = array( 203 205 $header, 204 206 $invite_message, 207 + $custom_message, 205 208 $out, 206 209 ); 207 210 ··· 303 306 return id(new AphrontRedirectResponse()) 304 307 ->setIsExternal(true) 305 308 ->setURI($auto_uri); 309 + } 310 + 311 + private function newCustomStartMessage() { 312 + $viewer = $this->getViewer(); 313 + 314 + $text = PhabricatorAuthMessage::loadMessageText( 315 + $viewer, 316 + PhabricatorAuthLoginMessageType::MESSAGEKEY); 317 + 318 + if (!strlen($text)) { 319 + return null; 320 + } 321 + 322 + $remarkup_view = new PHUIRemarkupView($viewer, $text); 323 + 324 + return phutil_tag( 325 + 'div', 326 + array( 327 + 'class' => 'auth-custom-message', 328 + ), 329 + $remarkup_view); 306 330 } 307 331 308 332 }
+16
src/applications/auth/storage/PhabricatorAuthMessage.php
··· 61 61 return $this->getMessageType()->getDisplayName(); 62 62 } 63 63 64 + public static function loadMessageText( 65 + PhabricatorUser $viewer, 66 + $message_key) { 67 + 68 + $message = id(new PhabricatorAuthMessageQuery()) 69 + ->setViewer($viewer) 70 + ->withMessageKeys(array($message_key)) 71 + ->executeOne(); 72 + 73 + if (!$message) { 74 + return null; 75 + } 76 + 77 + return $message->getMessageText(); 78 + } 79 + 64 80 65 81 /* -( PhabricatorPolicyInterface )----------------------------------------- */ 66 82
+9
webroot/rsrc/css/application/auth/auth.css
··· 55 55 .auth-account-view-account-uri { 56 56 word-break: break-word; 57 57 } 58 + 59 + .auth-custom-message { 60 + margin: 32px auto 64px; 61 + max-width: 548px; 62 + background: #fff; 63 + padding: 16px; 64 + border: 1px solid {$lightblueborder}; 65 + border-radius: 4px; 66 + }