Browse Source

Fix filecheck tool.

Laurent Destailleur 8 years ago
parent
commit
83a8fcb7f9

+ 0 - 0
build/generate_filelist_xml.php


+ 12 - 3
htdocs/admin/system/filecheck.php

@@ -188,10 +188,10 @@ if ($xml)
         print '<td align="right">' . $langs->trans("DateModification") . '</td>';
         print '</tr>'."\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 '<tr ' . $bc[$var] . '>';
@@ -208,6 +208,15 @@ if ($xml)
             print '<tr ' . $bc[false] . '><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
         }
         print '</table>';
+        
+        if (empty($tmpfilelist) && empty($tmpfilelist2))
+        {
+            setEventMessage($langs->trans("FileIntegrityIsStrictlyConformedWithReference"));
+        }
+        else
+        {
+            setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings');
+        }
     }
     else
     {

+ 2 - 0
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)