mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-15 01:50: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:
parent
861bb08141
commit
50d5fa87a3
4 changed files with 9 additions and 5 deletions
|
@ -9,6 +9,10 @@ final class PhabricatorAuthMainMenuBarExtension
|
|||
return true;
|
||||
}
|
||||
|
||||
public function shouldRequireFullSession() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getExtensionOrder() {
|
||||
return 900;
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ final class PeopleMainMenuBarExtension
|
|||
return $viewer->isLoggedIn();
|
||||
}
|
||||
|
||||
public function shouldAllowPartialSessions() {
|
||||
return true;
|
||||
public function shouldRequireFullSession() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getExtensionOrder() {
|
||||
|
|
|
@ -51,8 +51,8 @@ abstract class PhabricatorMainMenuBarExtension extends Phobject {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function shouldAllowPartialSessions() {
|
||||
return false;
|
||||
public function shouldRequireFullSession() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isExtensionEnabledForViewer(PhabricatorUser $viewer) {
|
||||
|
|
|
@ -106,7 +106,7 @@ final class PhabricatorMainMenuView extends AphrontView {
|
|||
|
||||
if (!$is_full) {
|
||||
foreach ($extensions as $key => $extension) {
|
||||
if (!$extension->shouldAllowPartialSessions()) {
|
||||
if ($extension->shouldRequireFullSession()) {
|
||||
unset($extensions[$key]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue