1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Disable "Send Message" profile action if viewer is logged out

Summary: Fixes T9598.

Test Plan:
  - Used "Send Message" as a logged-in user.
  - Used "Send Message" as a logged-out user. The action was disabled and clicking it popped up a login dialog.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9598

Differential Revision: https://secure.phabricator.com/D14326
This commit is contained in:
epriestley 2015-10-24 08:13:14 -07:00
parent ad53e7b878
commit 32dc62955a

View file

@ -72,11 +72,14 @@ final class PhabricatorPeopleProfileController
$href = id(new PhutilURI('/conpherence/new/')) $href = id(new PhutilURI('/conpherence/new/'))
->setQueryParam('participant', $user->getPHID()); ->setQueryParam('participant', $user->getPHID());
$can_send = $viewer->isLoggedIn();
$actions->addAction( $actions->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setIcon('fa-comments') ->setIcon('fa-comments')
->setName(pht('Send Message')) ->setName(pht('Send Message'))
->setWorkflow(true) ->setWorkflow(true)
->setDisabled(!$can_send)
->setHref($href)); ->setHref($href));
} }