From 0799e1c45ed1ac9dc2a7c325c91e201d1efc9dfe Mon Sep 17 00:00:00 2001 From: Edsel Date: Mon, 6 Apr 2015 18:08:21 +0530 Subject: [PATCH] CIVI-28 Added check for base financial type in online contributions --- CRM/Contribute/Form/ContributionBase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/ContributionBase.php b/CRM/Contribute/Form/ContributionBase.php index 5f1984b3d0..b5e6930caf 100644 --- a/CRM/Contribute/Form/ContributionBase.php +++ b/CRM/Contribute/Form/ContributionBase.php @@ -274,7 +274,9 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form { $this->_fields = array(); CRM_Contribute_BAO_ContributionPage::setValues($this->_id, $this->_values); - + if (!CRM_Core_Permission::check('add contributions of type ' . CRM_Contribute_PseudoConstant::financialType($this->_values['financial_type_id']))) { + CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); + } if (empty($this->_values['is_active'])) { throw new CRM_Contribute_Exception_InactiveContributionPageException(ts('The page you requested is currently unavailable.'), $this->_id); } -- 2.25.1