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

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
This commit is contained in:
epriestley 2012-07-25 13:58:49 -07:00
parent 321df38ccf
commit 94bc4003f1

View file

@ -58,6 +58,17 @@ final class PhabricatorLogoutController
->setURI('/login/');
}
if ($user->getPHID()) {
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle('Log out of Phabricator?')
->appendChild('<p>Are you sure you want to log out?</p>')
->addSubmitButton('Log Out')
->addCancelButton('/');
return id(new AphrontDialogResponse())->setDialog($dialog);
}
return id(new AphrontRedirectResponse())->setURI('/');
}