CRM-19372 allow payment processors to define an array of accepted credit card types
[civicrm-core.git] / CRM / Core / Invoke.php
index 24c0ecf77e7da2275941c674309b09c6af95ae3f..35158067b8b5ccee24e203919fa73de68d0ad0d9 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -31,7 +31,7 @@
  * Serves as a wrapper between the UserFrameWork and Core CRM
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2016
  * $Id$
  *
  */
@@ -344,19 +344,18 @@ class CRM_Core_Invoke {
   }
 
   /**
-   * Show status in the footer
+   * Show status in the footer (admin only)
    *
    * @param CRM_Core_Smarty $template
    */
   public static function statusCheck($template) {
-    if (CRM_Core_Config::isUpgradeMode()) {
+    if (CRM_Core_Config::isUpgradeMode() || !CRM_Core_Permission::check('administer CiviCRM')) {
       return;
     }
-    $statusSeverity = 0;
-    $statusMessage = ts('System status OK');
-    // TODO: get status from CRM_Utils_Check, if cached
-    $template->assign('footer_status_severity', $statusSeverity);
-    $template->assign('footer_status_message', $statusMessage);
+    // always use cached results - they will be refreshed by the session timer
+    $status = Civi::settings()->get('systemStatusCheckResult');
+    $template->assign('footer_status_severity', $status);
+    $template->assign('footer_status_message', CRM_Utils_Check::toStatusLabel($status));
   }
 
   /**