1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-15 10:00:55 +01:00

(stable) Restore the "Log In" menubar action

Summary:
See <https://discourse.phabricator-community.org/t/activation-link-in-welcome-mail-only-works-if-new-user-isnt-semi-logged-in/740/7>.

In T13024, I rewrote the main menu bar to hide potentially sensitive items (like notification and message counts and saved search filters) until users fully log in.

However, the "Log In" item got caught in this too. For clarity, rename `shouldAllowPartialSessions()` to `shouldRequireFullSession()` (since logged-out users don't have any session at all, so it would be a bit misleading to say that "Log In" "allows" a partial session). Then let "Log In" work again for logged-out users.

(In most cases, users are prompted to log in when they take an action which requires them to be logged in -- like creating or editing an object, or adding comments -- so this item doesn't really need to exist. However, it aligns better with user expectations in many cases to have it present, and some reasonable operations like "Check if I have notifications/messages" don't have an obvious thing to click otherwise.)

Test Plan: Viewed site in an incognito window, saw "Log In" button again. Browsed normally, saw normal menu.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18818
This commit is contained in:
epriestley 2017-12-05 05:42:03 -08:00
parent 861bb08141
commit 50d5fa87a3
4 changed files with 9 additions and 5 deletions

View file

@ -9,6 +9,10 @@ final class PhabricatorAuthMainMenuBarExtension
return true; return true;
} }
public function shouldRequireFullSession() {
return false;
}
public function getExtensionOrder() { public function getExtensionOrder() {
return 900; return 900;
} }

View file

@ -9,8 +9,8 @@ final class PeopleMainMenuBarExtension
return $viewer->isLoggedIn(); return $viewer->isLoggedIn();
} }
public function shouldAllowPartialSessions() { public function shouldRequireFullSession() {
return true; return false;
} }
public function getExtensionOrder() { public function getExtensionOrder() {

View file

@ -51,8 +51,8 @@ abstract class PhabricatorMainMenuBarExtension extends Phobject {
return true; return true;
} }
public function shouldAllowPartialSessions() { public function shouldRequireFullSession() {
return false; return true;
} }
public function isExtensionEnabledForViewer(PhabricatorUser $viewer) { public function isExtensionEnabledForViewer(PhabricatorUser $viewer) {

View file

@ -106,7 +106,7 @@ final class PhabricatorMainMenuView extends AphrontView {
if (!$is_full) { if (!$is_full) {
foreach ($extensions as $key => $extension) { foreach ($extensions as $key => $extension) {
if (!$extension->shouldAllowPartialSessions()) { if ($extension->shouldRequireFullSession()) {
unset($extensions[$key]); unset($extensions[$key]);
} }
} }