Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15397746
D20789.id49569.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D20789.id49569.diff
View Options
diff --git a/src/applications/auth/controller/PhabricatorLogoutController.php b/src/applications/auth/controller/PhabricatorLogoutController.php
--- a/src/applications/auth/controller/PhabricatorLogoutController.php
+++ b/src/applications/auth/controller/PhabricatorLogoutController.php
@@ -68,12 +68,42 @@
->setURI('/auth/loggedout/');
}
+
if ($viewer->getPHID()) {
- return $this->newDialog()
+ $dialog = $this->newDialog()
->setTitle(pht('Log Out?'))
- ->appendChild(pht('Are you sure you want to log out?'))
- ->addSubmitButton(pht('Log Out'))
+ ->appendParagraph(pht('Are you sure you want to log out?'))
->addCancelButton('/');
+
+ $configs = id(new PhabricatorAuthProviderConfigQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->execute();
+ if (!$configs) {
+ $dialog
+ ->appendRemarkup(
+ pht(
+ 'WARNING: You have not configured any authentication providers '.
+ 'yet, so your account has no login credentials. If you log out '.
+ 'now, you will not be able to log back in normally.'))
+ ->appendParagraph(
+ pht(
+ 'To enable the login flow, follow setup guidance and configure '.
+ 'at least one authentication provider, then associate '.
+ 'credentials with your account. After completing these steps, '.
+ 'you will be able to log out and log back in normally.'))
+ ->appendParagraph(
+ pht(
+ 'If you log out now, you can still regain access to your '.
+ 'account later by using the account recovery workflow. The '.
+ 'login screen will prompt you with recovery instructions.'));
+
+ $button = pht('Log Out Anyway');
+ } else {
+ $button = pht('Log Out');
+ }
+
+ $dialog->addSubmitButton($button);
+ return $dialog;
}
return id(new AphrontRedirectResponse())->setURI('/');
diff --git a/src/applications/auth/controller/config/PhabricatorAuthListController.php b/src/applications/auth/controller/config/PhabricatorAuthListController.php
--- a/src/applications/auth/controller/config/PhabricatorAuthListController.php
+++ b/src/applications/auth/controller/config/PhabricatorAuthListController.php
@@ -64,7 +64,7 @@
array(
'href' => $this->getApplicationURI('config/new/'),
),
- pht('Add Authentication Provider'))));
+ pht('Add Provider'))));
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Login and Registration'));
diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php
--- a/src/view/AphrontDialogView.php
+++ b/src/view/AphrontDialogView.php
@@ -160,6 +160,20 @@
return $this->appendChild($box);
}
+ public function appendRemarkup($remarkup) {
+ $viewer = $this->getViewer();
+ $view = new PHUIRemarkupView($viewer, $remarkup);
+
+ $view_tag = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'aphront-dialog-view-paragraph',
+ ),
+ $view);
+
+ return $this->appendChild($view_tag);
+ }
+
public function appendParagraph($paragraph) {
return $this->appendParagraphTag($paragraph);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 17, 10:04 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7651689
Default Alt Text
D20789.id49569.diff (3 KB)
Attached To
Mode
D20789: When users try to log out with no providers configured, warn them of the consequences
Attached
Detach File
Event Timeline
Log In to Comment