From 7df9b5d53bd1c6ed81d4e9a809b8ecef7b6512d6 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Sat, 25 Apr 2015 19:12:09 -0400 Subject: [PATCH] CRM-13823: set severities for existing status checks ---------------------------------------- * CRM-13823: Admin Status Page https://issues.civicrm.org/jira/browse/CRM-13823 --- CRM/Utils/Check/Env.php | 9 ++++++--- CRM/Utils/Check/Security.php | 37 ++++++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/CRM/Utils/Check/Env.php b/CRM/Utils/Check/Env.php index 8939c38f3c..461be3439e 100644 --- a/CRM/Utils/Check/Env.php +++ b/CRM/Utils/Check/Env.php @@ -66,7 +66,8 @@ class CRM_Utils_Check_Env { 2 => $sqlNow, 3 => $phpNow, )), - ts('Environment Settings') + ts('Environment Settings'), + \Psr\Log\LogLevel::ERROR ); } @@ -85,7 +86,8 @@ class CRM_Utils_Check_Env { 'checkDebug', ts('Warning: Debug is enabled in system settings. This should not be enabled on production servers.', array(1 => CRM_Utils_System::url('civicrm/admin/setting/debug', 'reset=1'))), - ts('Debug Mode') + ts('Debug Mode'), + \Psr\Log\LogLevel::WARNING ); } @@ -108,7 +110,8 @@ class CRM_Utils_Check_Env { 'checkOutboundMail', ts('Warning: Outbound email is disabled in system settings. Proper settings should be enabled on production servers.', array(1 => CRM_Utils_System::url('civicrm/admin/setting/smtp', 'reset=1'))), - ts('Outbound Email Settings') + ts('Outbound Email Settings'), + \Psr\Log\LogLevel::WARNING ); } diff --git a/CRM/Utils/Check/Security.php b/CRM/Utils/Check/Security.php index 0ef911f4ae..43b01fa606 100644 --- a/CRM/Utils/Check/Security.php +++ b/CRM/Utils/Check/Security.php @@ -112,7 +112,8 @@ class CRM_Utils_Check_Security { $messages[] = new CRM_Utils_Check_Message( 'checkLogFileIsNotAccessible', ts($msg, array(1 => $log_url, 2 => $docs_url)), - ts('Security Warning') + ts('Security Warning'), + \Psr\Log\LogLevel::CRITICAL ); } } @@ -159,7 +160,8 @@ class CRM_Utils_Check_Security { 2 => $privateDir, 3 => $heuristicUrl, )), - ts('Security Warning') + ts('Security Warning'), + \Psr\Log\LogLevel::WARNING ); } } @@ -205,7 +207,8 @@ class CRM_Utils_Check_Security { $messages[] = new CRM_Utils_Check_Message( 'checkDirectoriesAreNotBrowseable', ts($msg, array(1 => $publicDir, 2 => $publicDir, 3 => $docs_url)), - ts('Security Warning') + ts('Security Warning'), + \Psr\Log\LogLevel::ERROR ); } } @@ -227,16 +230,34 @@ class CRM_Utils_Check_Security { $messages = array(); $files = array( - "{$civicrm_root}/packages/dompdf/dompdf.php", // CRM-16005, upgraded from Civi <= 4.5.6 - "{$civicrm_root}/packages/vendor/dompdf/dompdf/dompdf.php", // CRM-16005, Civi >= 4.5.7 - "{$civicrm_root}/vendor/dompdf/dompdf/dompdf.php", // CRM-16005, Civi >= 4.6.0 + array( + "{$civicrm_root}/packages/dompdf/dompdf.php", // CRM-16005, upgraded from Civi <= 4.5.6 + \Psr\Log\LogLevel::CRITICAL, + ), + array( + "{$civicrm_root}/packages/vendor/dompdf/dompdf/dompdf.php", // CRM-16005, Civi >= 4.5.7 + \Psr\Log\LogLevel::CRITICAL, + ), + array( + "{$civicrm_root}/vendor/dompdf/dompdf/dompdf.php", // CRM-16005, Civi >= 4.6.0 + \Psr\Log\LogLevel::CRITICAL, + ), + array( + "{$civicrm_root}/packages/OpenFlashChart/php-ofc-library/ofc_upload_image.php", // CIVI-SA-2013-001 + \Psr\Log\LogLevel::CRITICAL, + ), + array( + "{$civicrm_root}/packages/html2text/class.html2text.inc", + \Psr\Log\LogLevel::CRITICAL, + ), ); foreach ($files as $file) { - if (file_exists($file)) { + if (file_exists($file[0])) { $messages[] = new CRM_Utils_Check_Message( 'checkFilesAreNotPresent', ts('File \'%1\' presents a security risk and should be deleted.', array(1 => $file)), - ts('Security Warning') + ts('Security Warning'), + $file[1] ); } } -- 2.25.1