<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id: PaymentProcessor.php 9702 2007-05-29 23:57:16Z lobo $
*
*/
protected $_ppDAO;
function preProcess() {
+ if(!CRM_Core_Permission::check('administer payment processors')) {
+ CRM_Core_Error::fatal('The \'administer payment processors\' permission is required to add or edit a payment processor.');
+ }
parent::preProcess();
CRM_Utils_System::setTitle(ts('Settings - Payment Processor'));
/**
* Function to build the form
*
- * @return None
+ * @param bool $check
+ *
+ * @return void
* @access public
*/
public function buildQuickForm($check = FALSE) {
$this->add('text', "test_{$field['name']}",
$field['label'], $attributes[$field['name']]
);
- if (CRM_Utils_Array::value('rule', $field)) {
+ if (!empty($field['rule'])) {
$this->addRule($field['name'], $field['msg'], $field['rule']);
$this->addRule("test_{$field['name']}", $field['msg'], $field['rule']);
}
$values = $this->controller->exportValues($this->_name);
$domainID = CRM_Core_Config::domainID();
- if (CRM_Utils_Array::value('is_default', $values)) {
+ if (!empty($values['is_default'])) {
$query = "UPDATE civicrm_payment_processor SET is_default = 0 WHERE domain_id = $domainID";
CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
}
/**
* Save a payment processor
*
+ * @param $values
+ * @param $domainID
+ * @param $test
+ *
* @return Void
*/
function updatePaymentProcessor(&$values, $domainID, $test) {