From 4cfd4f4519b716e77c47aba6068ae265f9431a0e Mon Sep 17 00:00:00 2001 From: Alice Frumin Date: Thu, 19 Oct 2017 16:39:29 -0400 Subject: [PATCH] using civi function to get contact id because it is cms agnostic --- CRM/Core/Permission.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index c934bc6098..d6a1915cb3 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -1603,8 +1603,7 @@ class CRM_Core_Permission { * invoices permission and the invoice author is the current user. */ public static function checkDownloadInvoice() { - global $user; - $cid = CRM_Core_BAO_UFMatch::getContactId($user->uid); + $cid = CRM_Core_Session::getLoggedInContactID(); if (CRM_Core_Permission::check('access CiviContribute') || (CRM_Core_Permission::check('view my invoices') && $_GET['cid'] == $cid) ) { -- 2.25.1