From 7456a9bc0c156cffdb969dd2f07e2249dc0f5ee6 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Mon, 8 Jul 2013 17:05:46 -0700 Subject: [PATCH] Tokens - make action disabled if user not logged in Summary: ref T2691. These actions should be visually disabled if user not logged in consistently. Tokens was the odd one out, staying active regardless of user status. Test Plan: viewed a mock logged out and verified "give token" was inactive from a UI-sense Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2691 Differential Revision: https://secure.phabricator.com/D6385 --- .../tokens/event/PhabricatorTokenUIEventListener.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/applications/tokens/event/PhabricatorTokenUIEventListener.php b/src/applications/tokens/event/PhabricatorTokenUIEventListener.php index ec4c9e08f7..a55ac4eb59 100644 --- a/src/applications/tokens/event/PhabricatorTokenUIEventListener.php +++ b/src/applications/tokens/event/PhabricatorTokenUIEventListener.php @@ -54,6 +54,9 @@ final class PhabricatorTokenUIEventListener ->setName(pht('Rescind Token')) ->setIcon('dislike'); } + if (!$user->isLoggedIn()) { + $token_action->setDisabled(true); + } $actions = $event->getValue('actions'); $actions[] = $token_action;