From 94bc4003f191578ca973ef52ae4cf9427e177421 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 25 Jul 2012 13:58:49 -0700 Subject: [PATCH] Show a "Logout?" dialog when the user goes to /logout/ Summary: Currently, the logout link is this awkward form in the footer since we have to CSRF it. Enable a GET + dialog + confirm workflow instead so the logout link can just be a link instead of this weird mess. Test Plan: Went to /logout/, logged out. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D3066 --- .../auth/controller/PhabricatorLogoutController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/applications/auth/controller/PhabricatorLogoutController.php b/src/applications/auth/controller/PhabricatorLogoutController.php index f4a1897209..d6362dafce 100644 --- a/src/applications/auth/controller/PhabricatorLogoutController.php +++ b/src/applications/auth/controller/PhabricatorLogoutController.php @@ -58,6 +58,17 @@ final class PhabricatorLogoutController ->setURI('/login/'); } + if ($user->getPHID()) { + $dialog = id(new AphrontDialogView()) + ->setUser($user) + ->setTitle('Log out of Phabricator?') + ->appendChild('

Are you sure you want to log out?

') + ->addSubmitButton('Log Out') + ->addCancelButton('/'); + + return id(new AphrontDialogResponse())->setDialog($dialog); + } + return id(new AphrontRedirectResponse())->setURI('/'); }