Skip to content

Commit

Permalink
Merge pull request civicrm#6 from ginkgostreet/status-page-1
Browse files Browse the repository at this point in the history
CRM-13823: set severities for existing status checks
  • Loading branch information
agh1 committed Apr 25, 2015
2 parents 400c1ae + 0c180da commit ee5bcbc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
9 changes: 6 additions & 3 deletions CRM/Utils/Check/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public function checkMysqlTime() {
2 => $sqlNow,
3 => $phpNow,
)),
ts('Environment Settings')
ts('Environment Settings'),
\Psr\Log\LogLevel::ERROR
);
}

Expand All @@ -85,7 +86,8 @@ public function checkDebug() {
'checkDebug',
ts('Warning: Debug is enabled in <a href="%1">system settings</a>. 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
);
}

Expand All @@ -108,7 +110,8 @@ public function checkOutboundMail() {
'checkOutboundMail',
ts('Warning: Outbound email is disabled in <a href="%1">system settings</a>. 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
);
}

Expand Down
37 changes: 29 additions & 8 deletions CRM/Utils/Check/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public function checkLogFileIsNotAccessible() {
$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
);
}
}
Expand Down Expand Up @@ -158,7 +159,8 @@ public function checkUploadsAreNotAccessible() {
2 => $privateDir,
3 => $heuristicUrl,
)),
ts('Security Warning')
ts('Security Warning'),
\Psr\Log\LogLevel::WARNING
);
}
}
Expand Down Expand Up @@ -204,7 +206,8 @@ public function checkDirectoriesAreNotBrowseable() {
$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
);
}
}
Expand All @@ -226,16 +229,34 @@ public function checkFilesAreNotPresent() {

$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]
);
}
}
Expand Down

0 comments on commit ee5bcbc

Please sign in to comment.