Differential D21606 Diff 51435 src/applications/auth/extension/PhabricatorAuthMainMenuBarExtension.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/extension/PhabricatorAuthMainMenuBarExtension.php
Show All 33 Lines | public function buildMainMenus() { | ||||
return array( | return array( | ||||
$this->buildLoginMenu(), | $this->buildLoginMenu(), | ||||
); | ); | ||||
} | } | ||||
private function buildLoginMenu() { | private function buildLoginMenu() { | ||||
$controller = $this->getController(); | $controller = $this->getController(); | ||||
$uri = new PhutilURI('/auth/start/'); | // See T13636. This button may be rendered by the 404 controller on sites | ||||
// other than the primary PlatformSite. Link the button to the primary | |||||
// site. | |||||
$uri = '/auth/start/'; | |||||
$uri = PhabricatorEnv::getURI($uri); | |||||
$uri = new PhutilURI($uri); | |||||
if ($controller) { | if ($controller) { | ||||
$path = $controller->getRequest()->getPath(); | $path = $controller->getRequest()->getPath(); | ||||
$uri->replaceQueryParam('next', $path); | $uri->replaceQueryParam('next', $path); | ||||
} | } | ||||
return id(new PHUIButtonView()) | return id(new PHUIButtonView()) | ||||
->setTag('a') | ->setTag('a') | ||||
->setText(pht('Log In')) | ->setText(pht('Log In')) | ||||
->setHref($uri) | ->setHref($uri) | ||||
->setNoCSS(true) | ->setNoCSS(true) | ||||
->addClass('phabricator-core-login-button'); | ->addClass('phabricator-core-login-button'); | ||||
} | } | ||||
} | } |