From: Janusz Dobrowolski Date: Wed, 12 May 2010 10:46:42 +0000 (+0000) Subject: [0000226] Fixed checks for js cached files, colors in messages X-Git-Tag: 2.3-final~910 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=6af84555a04644be398474cb1c49e52af27c2ddb;p=fa-stable.git [0000226] Fixed checks for js cached files, colors in messages --- diff --git a/admin/system_diagnostics.php b/admin/system_diagnostics.php index 45fa5dd1..4f941e94 100644 --- a/admin/system_diagnostics.php +++ b/admin/system_diagnostics.php @@ -188,6 +188,16 @@ function tst_subdirs() if (!is_dir($spath) || !is_writable($spath) ) { $test['result'] = false; $test['comments'][] = sprintf(_("'%s' is not writeable"), $spath); + } else { + $dir = opendir($spath); + while (false !== ($fname = readdir($dir))) { + // check only *.js files. Manually installed package can contain other + // non-writable files which are non-crucial for normal operations + if (preg_match('/.*(\.js)/', $fname) && !is_writable("$spath/$fname")) { + $test['result'] = false; + $test['comments'][] = sprintf(_("'%s' is not writeable"), "$spath/$fname"); + } + } } } } @@ -314,7 +324,11 @@ foreach ($system_tests as $test) $comm = is_array(@$result['comments']) ? implode('
', $result['comments']) : @$result['comments']; - label_cell($result['result'] ? _('Ok') : ''.$comm.''); + $color = ($result['result'] ? 'green': + ($result['type']==3 ? 'red' : + ($result['type']==2 ? 'orange' : 'green'))); + label_cell("". + ($result['result'] ? _('Ok') : ''.$comm.'').''); end_row(); }