From: Donald A. Lobo Date: Fri, 8 Mar 2013 18:02:45 +0000 (-0800) Subject: fix CRM-12062 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=213f28bb4abe0f6bad5cabc93b7e11b11b1a88a4;p=civicrm-core.git fix CRM-12062 --- diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 7bef63f798..8895790056 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -1212,6 +1212,14 @@ WHERE v.option_group_id = g.id return $tempID; } + // check if the user is logged in and has a contact ID + $session = CRM_Core_Session::singleton(); + $userID = $session->get('userID'); + + if ($tempID == $userID) { + return $userID; + } + //check if this is a checksum authentication $userChecksum = CRM_Utils_Request::retrieve('cs', 'String', $this); if ($userChecksum) { @@ -1221,10 +1229,12 @@ WHERE v.option_group_id = g.id return $tempID; } } + // check if user has permission, CRM-12062 + else if (CRM_Contact_BAO_Contact_Permission::allow($tempID)) { + return $tempID; + } - // check if the user is registered and we have a contact ID - $session = CRM_Core_Session::singleton(); - return $session->get('userID'); + return $userID; } /* Validate price set submitted params for price option limit,