Skip to content

Commit

Permalink
Merge pull request #150 from colemanw/checksum
Browse files Browse the repository at this point in the history
Grant CiviCRM permissions to the verified checksum contact
  • Loading branch information
colemanw authored Aug 27, 2018
2 parents 7f98c56 + 3f99084 commit 0b5359d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions includes/contact_component.inc
Original file line number Diff line number Diff line change
Expand Up @@ -707,11 +707,15 @@ function wf_crm_contact_access($component, $filters, $cid) {
// For legacy reasons we support "cid" param as an alias of "cid1"
if (wf_crm_aval($_GET, "cid$c") == $cid || $c == 1 && wf_crm_aval($_GET, "cid") == $cid) {
// For legacy reasons we support "cs" param as an alias of "cs1"
if (!empty($_GET['cs']) && $c == 1 && CRM_Contact_BAO_Contact_Utils::validChecksum($cid, $_GET['cs'])) {
$filters['check_permissions'] = FALSE;
}
elseif (!empty($_GET["cs$c"]) && CRM_Contact_BAO_Contact_Utils::validChecksum($cid, $_GET["cs$c"])) {
if (
(!empty($_GET['cs']) && $c == 1 && CRM_Contact_BAO_Contact_Utils::validChecksum($cid, $_GET['cs']))
|| (!empty($_GET["cs$c"]) && CRM_Contact_BAO_Contact_Utils::validChecksum($cid, $_GET["cs$c"]))
) {
$filters['check_permissions'] = FALSE;
// Grant CiviCRM permissions to the verified checksum contact.
if ($c == 1) {
CRM_Core_Session::singleton()->set('userID', $cid);
}
}
}
}
Expand Down

0 comments on commit 0b5359d

Please sign in to comment.