move definition of payment fields to the processor
[civicrm-core.git] / CRM / Core / Config.php
index aa9c708eb150ca55f2301c08e7ca0bd59cf393fb..8a4ed0df0e48961cc08ee17b64b2407c29cc2036 100644 (file)
@@ -41,6 +41,9 @@ require_once 'Mail.php';
 
 require_once 'api/api.php';
 
+/**
+ * Class CRM_Core_Config
+ */
 class CRM_Core_Config extends CRM_Core_Config_Variables {
   ///
   /// BASE SYSTEM PROPERTIES (CIVICRM.SETTINGS.PHP)
@@ -82,6 +85,11 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
    */
   public $userSystem = NULL;
 
+  /**
+   * @var CRM_Core_Permission_Base
+   */
+  public $userPermissionClass;
+
   /**
    * The root directory where Smarty should store compiled files
    *
@@ -213,7 +221,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
 
           self::$_singleton->_initVariables();
 
-          // I dont think we need to do this twice
+          // I don't think we need to do this twice
           // however just keeping this commented for now in 4.4
           // in case we hit any issues - CRM-13064
           // We can safely delete this once we release 4.4.4
@@ -227,7 +235,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
 
         // CRM-9803, NYSS-4822
         // this causes various settings to be reset and hence we should
-        // only use the config object that we retrived from memcache
+        // only use the config object that we retrieved from memcache
       }
 
       self::$_singleton->initialized = 1;
@@ -257,7 +265,6 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
           array(1 => array($userID, 'Integer'))
         );
       }
-      self::$_singleton->userSystem->setMySQLTimeZone();
 
       // initialize authentication source
       self::$_singleton->initAuthSrc();
@@ -500,7 +507,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
         CRM_Utils_System::mapConfigToSSL();
       }
       $rrb = parse_url($this->userFrameworkResourceURL);
-      // dont use absolute path if resources are stored on a different server
+      // don't use absolute path if resources are stored on a different server
       // CRM-4642
       $this->resourceBase = $this->userFrameworkResourceURL;
       if (isset($_SERVER['HTTP_HOST']) &&
@@ -647,7 +654,7 @@ class CRM_Core_Config extends CRM_Core_Config_Variables {
 
     // Whether we delete/create or simply preserve directories, we should
     // certainly make sure the restrictions are enforced.
-    foreach (array($this->templateCompileDir, $this->uploadDir, $this->configAndLogDir) as $dir) {
+    foreach (array($this->templateCompileDir, $this->uploadDir, $this->configAndLogDir, $this->customFileUploadDir) as $dir) {
       if ($dir && is_dir($dir)) {
         CRM_Utils_File::restrictAccess($dir);
       }
@@ -852,6 +859,13 @@ AND
     $this->userFramework = $userFramework;
     $this->_setUserFrameworkConfig($userFramework);
   }
-}
-// end CRM_Core_Config
 
+  /**
+   * Is back office credit card processing enabled for this site - ie are there any installed processors that support
+   * it?
+   * @return bool
+   */
+  static function isEnabledBackOfficeCreditCardPayments() {
+    return CRM_Financial_BAO_PaymentProcessor::hasPaymentProcessorSupporting(array('BackOffice'));
+  }
+}