From 9c72c1b1daa98bdf5c11ae08d543b3839d6cf848 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 9 Dec 2016 08:21:39 -0800 Subject: [PATCH] When rendering the "you were invited" header, query the inviting user with the omnipotent viewer Summary: Fixes T11982. If an install is not public, the registering user may not be able to see the inviting user. Test Plan: {F2097656} Reviewers: chad Reviewed By: chad Maniphest Tasks: T11982 Differential Revision: https://secure.phabricator.com/D17015 --- .../auth/controller/PhabricatorAuthController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/applications/auth/controller/PhabricatorAuthController.php b/src/applications/auth/controller/PhabricatorAuthController.php index ca4b89f571..4a572edf22 100644 --- a/src/applications/auth/controller/PhabricatorAuthController.php +++ b/src/applications/auth/controller/PhabricatorAuthController.php @@ -259,8 +259,12 @@ abstract class PhabricatorAuthController extends PhabricatorController { protected function renderInviteHeader(PhabricatorAuthInvite $invite) { $viewer = $this->getViewer(); + // Since the user hasn't registered yet, they may not be able to see other + // user accounts. Load the inviting user with the omnipotent viewer. + $omnipotent_viewer = PhabricatorUser::getOmnipotentUser(); + $invite_author = id(new PhabricatorPeopleQuery()) - ->setViewer($viewer) + ->setViewer($omnipotent_viewer) ->withPHIDs(array($invite->getAuthorPHID())) ->needProfileImage(true) ->executeOne();