@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.

When users try to log out with no providers configured, warn them of the consequences

Summary: Fixes T13406. On the logout screen, test for no configured providers and warn users they may be getting into more trouble than they expect.

Test Plan:
- Logged out of a normal install and a fresh (unconfigured) install.

{F6847659}

Maniphest Tasks: T13406

Differential Revision: https://secure.phabricator.com/D20789

+48 -4
+33 -3
src/applications/auth/controller/PhabricatorLogoutController.php
··· 68 68 ->setURI('/auth/loggedout/'); 69 69 } 70 70 71 + 71 72 if ($viewer->getPHID()) { 72 - return $this->newDialog() 73 + $dialog = $this->newDialog() 73 74 ->setTitle(pht('Log Out?')) 74 - ->appendChild(pht('Are you sure you want to log out?')) 75 - ->addSubmitButton(pht('Log Out')) 75 + ->appendParagraph(pht('Are you sure you want to log out?')) 76 76 ->addCancelButton('/'); 77 + 78 + $configs = id(new PhabricatorAuthProviderConfigQuery()) 79 + ->setViewer(PhabricatorUser::getOmnipotentUser()) 80 + ->execute(); 81 + if (!$configs) { 82 + $dialog 83 + ->appendRemarkup( 84 + pht( 85 + 'WARNING: You have not configured any authentication providers '. 86 + 'yet, so your account has no login credentials. If you log out '. 87 + 'now, you will not be able to log back in normally.')) 88 + ->appendParagraph( 89 + pht( 90 + 'To enable the login flow, follow setup guidance and configure '. 91 + 'at least one authentication provider, then associate '. 92 + 'credentials with your account. After completing these steps, '. 93 + 'you will be able to log out and log back in normally.')) 94 + ->appendParagraph( 95 + pht( 96 + 'If you log out now, you can still regain access to your '. 97 + 'account later by using the account recovery workflow. The '. 98 + 'login screen will prompt you with recovery instructions.')); 99 + 100 + $button = pht('Log Out Anyway'); 101 + } else { 102 + $button = pht('Log Out'); 103 + } 104 + 105 + $dialog->addSubmitButton($button); 106 + return $dialog; 77 107 } 78 108 79 109 return id(new AphrontRedirectResponse())->setURI('/');
+1 -1
src/applications/auth/controller/config/PhabricatorAuthListController.php
··· 64 64 array( 65 65 'href' => $this->getApplicationURI('config/new/'), 66 66 ), 67 - pht('Add Authentication Provider')))); 67 + pht('Add Provider')))); 68 68 69 69 $crumbs = $this->buildApplicationCrumbs(); 70 70 $crumbs->addTextCrumb(pht('Login and Registration'));
+14
src/view/AphrontDialogView.php
··· 160 160 return $this->appendChild($box); 161 161 } 162 162 163 + public function appendRemarkup($remarkup) { 164 + $viewer = $this->getViewer(); 165 + $view = new PHUIRemarkupView($viewer, $remarkup); 166 + 167 + $view_tag = phutil_tag( 168 + 'div', 169 + array( 170 + 'class' => 'aphront-dialog-view-paragraph', 171 + ), 172 + $view); 173 + 174 + return $this->appendChild($view_tag); 175 + } 176 + 163 177 public function appendParagraph($paragraph) { 164 178 return $this->appendParagraphTag($paragraph); 165 179 }