Skip to content

Commit

Permalink
Merge pull request #17783 from pradpnayak/REF-1
Browse files Browse the repository at this point in the history
getLoggedInContactID() is a static function
  • Loading branch information
seamuslee001 authored Jul 10, 2020
2 parents 6a7a0a1 + 2dbdb9b commit 406e096
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CRM/ACL/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public static function groupPermission(
}

if (!$contactID) {
$contactID = CRM_Core_Session::singleton()->getLoggedInContactID();
$contactID = CRM_Core_Session::getLoggedInContactID();
}

$key = "{$tableName}_{$type}_{$contactID}";
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Merge.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public function bounceIfInvalid($cid, $oid) {
CRM_Utils_System::permissionDenied();
}
// ensure that oid is not the current user, if so refuse to do the merge
if (CRM_Core_Session::singleton()->getLoggedInContactID() == $oid) {
if (CRM_Core_Session::getLoggedInContactID() == $oid) {
$message = ts('The contact record which is linked to the currently logged in user account - \'%1\' - cannot be deleted.',
[1 => CRM_Core_Session::singleton()->getLoggedInContactDisplayName()]
);
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Task/PDFLetterCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public static function createActivities($form, $html_message, $contactIds, $subj
$activityParams = [
'subject' => $subject,
'campaign_id' => $campaign_id,
'source_contact_id' => CRM_Core_Session::singleton()->getLoggedInContactID(),
'source_contact_id' => CRM_Core_Session::getLoggedInContactID(),
'activity_type_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Print PDF Letter'),
'activity_date_time' => date('YmdHis'),
'details' => $html_message,
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Page/View/UserDashBoard.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct() {
}

$this->_contactId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$userID = CRM_Core_Session::singleton()->getLoggedInContactID();
$userID = CRM_Core_Session::getLoggedInContactID();

$userChecksum = $this->getUserChecksum();
$validUser = FALSE;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contribute/Form/ContributionBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function preProcess() {
$this->_emailExists = $this->get('emailExists');

// this was used prior to the cleverer this_>getContactID - unsure now
$this->_userID = CRM_Core_Session::singleton()->getLoggedInContactID();
$this->_userID = CRM_Core_Session::getLoggedInContactID();

$this->_contactID = $this->_membershipContactID = $this->getContactID();
$this->_mid = NULL;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public static function getDefaultReceiptFrom() {
return [$userName, $userEmail];
}

$userID = CRM_Core_Session::singleton()->getLoggedInContactID();
$userID = CRM_Core_Session::getLoggedInContactID();
if (!empty($userID)) {
list($userName, $userEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($userID);
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public static function getFromEmail() {

$contactFromEmails = [];
// add logged in user's active email ids
$contactID = CRM_Core_Session::singleton()->getLoggedInContactID();
$contactID = CRM_Core_Session::getLoggedInContactID();
if ($contactID) {
$contactEmails = self::allEmails($contactID);
$fromDisplayName = CRM_Core_Session::singleton()->getLoggedInContactDisplayName();
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public static function add(&$params, $ids = []) {

$noteActions = FALSE;

$loggedInContactID = CRM_Core_Session::singleton()->getLoggedInContactID();
$loggedInContactID = CRM_Core_Session::getLoggedInContactID();
if ($loggedInContactID) {
if ($loggedInContactID == $note->entity_id) {
$noteActions = TRUE;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/BAO/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -1810,7 +1810,7 @@ public static function addActivityForSelection($participantId, $activityType) {
];

// create activity with target contacts
$id = CRM_Core_Session::singleton()->getLoggedInContactID();
$id = CRM_Core_Session::getLoggedInContactID();
if ($id) {
$activityParams['source_contact_id'] = $id;
$activityParams['target_contact_id'][] = $contactId;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Profile/Selector/Listings.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $ex
if ($editLink && ($mask & CRM_Core_Permission::EDIT)) {
// do not allow edit for anon users in joomla frontend, CRM-4668
$config = CRM_Core_Config::singleton();
if (!$config->userFrameworkFrontend || CRM_Core_Session::singleton()->getLoggedInContactID()) {
if (!$config->userFrameworkFrontend || CRM_Core_Session::getLoggedInContactID()) {
$this->_editLink = TRUE;
}
}
Expand Down

0 comments on commit 406e096

Please sign in to comment.