$session = CRM_Core_Session::singleton();
$userID = $session->get('userID');
- $userChecksum = CRM_Utils_Request::retrieve('cs', 'String', $this);
+ $userChecksum = $this->getUserChecksum();
$validUser = FALSE;
- if (empty($userID) && $this->_contactId && $userChecksum) {
+ if ($userChecksum) {
$this->assign('userChecksum', $userChecksum);
$validUser = CRM_Contact_BAO_Contact_Utils::validChecksum($this->_contactId, $userChecksum);
$this->_isChecksumUser = $validUser;
return self::$_links;
}
+ /**
+ * Get the user checksum from the url to use in links.
+ *
+ * @return string
+ */
+ protected function getUserChecksum() {
+ $userChecksum = CRM_Utils_Request::retrieve('cs', 'String', $this);
+ if (empty($userID) && $this->_contactId) {
+ return $userChecksum;
+ }
+ return FALSE;
+ }
+
}