From 83a8fcb7f9b9b3d76a82eef28a247666ddeae7db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Dec 2016 19:01:24 +0100 Subject: [PATCH] Fix filecheck tool. --- build/generate_filelist_xml.php | 0 htdocs/admin/system/filecheck.php | 15 ++++++++++++--- htdocs/langs/en_US/admin.lang | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) mode change 100644 => 100755 build/generate_filelist_xml.php diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php old mode 100644 new mode 100755 diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 6f90d2c0348..0d6c2e5cd1d 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -188,10 +188,10 @@ if ($xml) print '' . $langs->trans("DateModification") . ''; print ''."\n"; $var = true; - $tmpfilelist = dol_sort_array($file_list['updated'], 'filename'); - if (is_array($tmpfilelist) && count($tmpfilelist)) + $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename'); + if (is_array($tmpfilelist2) && count($tmpfilelist2)) { - foreach ($tmpfilelist as $file) + foreach ($tmpfilelist2 as $file) { $var = !$var; print ''; @@ -208,6 +208,15 @@ if ($xml) print ''.$langs->trans("None").''; } print ''; + + if (empty($tmpfilelist) && empty($tmpfilelist2)) + { + setEventMessage($langs->trans("FileIntegrityIsStrictlyConformedWithReference")); + } + else + { + setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings'); + } } else { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c57ea45858a..d8b0c586584 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -10,6 +10,8 @@ VersionUnknown=Unknown VersionRecommanded=Recommended FileCheck=Files integrity checker FileCheckDesc=This tool allows you to check the integrity of files of your application, comparing each files with the official ones. You can use this tool to detect if some files were modified by a hacker for example. +FileIntegrityIsStrictlyConformedWithReference=Files integrity is strictly conformed with the reference. +FileIntegritySomeFilesWereRemovedOrModified=Files integrity check has failed. Some files were modified of removed. MakeIntegrityAnalysisFrom=Make integrity analysis of application files from LocalSignature=Embedded local signature (less reliable) RemoteSignature=Remote distant signature (more reliable)