This commit is contained in:
Laurent Destailleur
2025-10-21 14:41:42 +02:00
parent d8b63e6fa6
commit f35536712f
5 changed files with 81 additions and 16 deletions

View File

@@ -272,6 +272,16 @@ $checksumconcat = array();
fputs($fp, '<dolibarr_unalterable_files version="'.$release.'">'."\n"); fputs($fp, '<dolibarr_unalterable_files version="'.$release.'">'."\n");
// TODO Use this array to make the scan
$arrayofunalterablefiles = array(
array('dir' => dirname(__FILE__).'/../../htdocs/blockedlog', 'files' => 'all', 'regextoinclude' => '(\.php|\.sql)$', 'regextoexclude' => ''),
array('dir' => dirname(__FILE__).'/../../htdocs/install/mysql/tables', 'files' => 'all', 'regextoinclude' => 'llx_blockedlog.*(\.php|\.sql)$'),
array('dir' => dirname(__FILE__).'/../../htdocs/core/triggers', 'files' => 'interface_50_modBlockedlog_ActionsBlockedLog.class.php'),
array('dir' => dirname(__FILE__).'/../../htdocs/core/class', 'files' => 'interfaces.class.php'),
array('dir' => dirname(__FILE__).'/../../htdocs/core/class', 'files' => 'commontrigger.class.php'),
array('dir' => dirname(__FILE__).'/../../htdocs/takepos', 'files' => 'receipt.php')
);
$regextoinclude = '(\.php|\.sql)$'; $regextoinclude = '(\.php|\.sql)$';
$regextoexclude = ''; // Exclude dirs $regextoexclude = ''; // Exclude dirs
$files = dol_dir_list(dirname(__FILE__).'/../../htdocs/blockedlog', 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $files = dol_dir_list(dirname(__FILE__).'/../../htdocs/blockedlog', 'files', 1, $regextoinclude, $regextoexclude, 'fullname');

View File

@@ -134,7 +134,7 @@ $enableremotecheck = true;
print '<form name="check" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">'; print '<form name="check" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
print '<input type="hidden" name="token" value="'.newToken().'">'; print '<input type="hidden" name="token" value="'.newToken().'">';
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>'; print img_picto('', 'search', 'class="pictofixedwidth"').$langs->trans("MakeIntegrityAnalysisFrom").'...<br><br>';
print '<div class="divsection">'; print '<div class="divsection">';
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n"; print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
@@ -245,14 +245,52 @@ if (empty($error) && !empty($xml)) {
$out .= '<tr class="oddeven">'; $out .= '<tr class="oddeven">';
$out .= '<td></td>'."\n"; $out .= '<td></td>'."\n";
$out .= '<td>'.$langs->trans("Country").'</td>'."\n"; $out .= '<td>'.$langs->trans("Country").'</td>'."\n";
$out .= '<td class="center"></td>'."\n"; $out .= '<td class="center"><span class="opacitymedium">'.$langs->trans("YourCountryCode").'</span></td>'."\n";
$out .= '<td class="center">'.$mysoc->country_code.'</td>'."\n"; $out .= '<td class="center">'.$mysoc->country_code.'</td>'."\n";
$out .= "</tr>\n"; $out .= "</tr>\n";
$out .= '<tr class="oddeven">'; $out .= '<tr class="oddeven">';
$out .= '<td></td>'."\n"; $out .= '<td></td>'."\n";
$out .= '<td>'.$langs->trans("ModuleMustBeEnabled", $langs->transnoentitiesnoconv("BlockedLog")).'</td>'."\n"; $out .= '<td>'.$langs->trans("StatusOfModule", $langs->transnoentitiesnoconv("BlockedLog")).'</td>'."\n";
$out .= '<td class="center">'.yn(1).'</td>'."\n"; $out .= '<td class="center">'.$langs->trans("Enabled").'</td>'."\n";
$out .= '<td class="center">'.yn(isModEnabled('blockedlog') ? 1 : 0).'</td>'."\n"; $out .= '<td class="center">';
$out .= isModEnabled('blockedlog') ? '<span class="ok">'.$langs->trans("Enabled").'</span>' : '<span class="warning">'.$langs->trans("Disabled").'</span>';
include_once DOL_DOCUMENT_ROOT.'/core/modules/modBlockedLog.class.php';
$objMod = new modBlockedLog($db);
$modulename = $objMod->getName();
$moduledesc = $objMod->getDesc();
$moduleauthor = $objMod->getPublisher();
$moduledir = strtolower(preg_replace('/^mod/i', '', get_class($objMod)));
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
$text = '<span class="opacitymedium">'.$langs->trans("LastActivationDate").':</span> ';
if (getDolGlobalString($const_name)) {
$text .= dol_print_date($objMod->getLastActivationDate(), 'dayhour');
} else {
$text .= $langs->trans("Disabled");
}
$tmp = $objMod->getLastActivationInfo();
$authorid = (empty($tmp['authorid']) ? '' : $tmp['authorid']);
if ($authorid > 0) {
$tmpuser = new User($db);
$tmpuser->fetch($authorid);
$text .= '<br><span class="opacitymedium">'.$langs->trans("LastActivationAuthor").':</span> ';
$text .= $tmpuser->getNomUrl(0, 'nolink', -1, 1);
}
$ip = (empty($tmp['ip']) ? '' : $tmp['ip']);
if ($ip) {
$text .= '<br><span class="opacitymedium">'.$langs->trans("LastActivationIP").':</span> ';
$text .= $ip;
}
$lastactivationversion = (empty($tmp['lastactivationversion']) ? '' : $tmp['lastactivationversion']);
if ($lastactivationversion && $lastactivationversion != 'dolibarr') {
$text .= '<br><span class="opacitymedium">'.$langs->trans("LastActivationVersion").':</span> ';
$text .= $lastactivationversion;
}
$out .= $form->textwithpicto('', $text);
$out . '</td>'."\n";
$out .= "</tr>\n"; $out .= "</tr>\n";
} }
@@ -500,23 +538,24 @@ if (empty($error) && !empty($xml)) {
$resultcomment = ''; $resultcomment = '';
$outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans("Unknown")); $outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans("Unknown"));
$outcurrentchecksumtext = '';
if ($checksumget == $checksumtoget) { if ($checksumget == $checksumtoget) {
if (empty($onlymodifiedorremoved) && !empty($file_list['added'])) { if (empty($onlymodifiedorremoved) && !empty($file_list['added'])) {
$resultcode = 'warning'; $resultcode = 'warning';
$resultcomment = 'FileIntegrityIsOkButFilesWereAdded'; $resultcomment = 'FileIntegrityIsOkButFilesWereAdded';
$outcurrentchecksum = $checksumget; $outcurrentchecksum = $checksumget;
$outcurrentchecksum .= '<br><br>'.img_picto('', 'tick').' <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>'; $outcurrentchecksumtext .= img_picto('', 'tick').' <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>';
} else { } else {
$resultcode = 'ok'; $resultcode = 'ok';
$resultcomment = 'Success'; $resultcomment = 'Success';
$outcurrentchecksum = '<span class="'.$resultcode.'" title="Checksum of all current checksums concatenated separated by a comma">'.$checksumget.'</span>'; $outcurrentchecksum = '<span class="'.$resultcode.'" title="Checksum of all current checksums concatenated separated by a comma">'.$checksumget.'</span>';
$outcurrentchecksum.= '<br><br>'.img_picto('', 'tick').' <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>'; $outcurrentchecksumtext.= img_picto('', 'tick').' <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>';
} }
} else { } else {
$resultcode = 'error'; $resultcode = 'error';
$resultcomment = 'FileIntegrityIsKO'; $resultcomment = 'FileIntegrityIsKO';
$outcurrentchecksum = '<span class="'.$resultcode.'" title="Checksum of all current checksums concatenated separated by a comma">'.$checksumget.'</span>'; $outcurrentchecksum = '<span class="'.$resultcode.'" title="Checksum of all current checksums concatenated separated by a comma">'.$checksumget.'</span>';
$outcurrentchecksum .= '<br><br>'.img_picto('', 'error').' <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>'; $outcurrentchecksumtext .= img_picto('', 'error').' <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>';
} }
// Show warning // Show warning
@@ -554,13 +593,27 @@ if (empty($error) && !empty($xml)) {
} else { } else {
print load_fiche_titre($langs->trans("GlobalChecksum")); print load_fiche_titre($langs->trans("GlobalChecksum"));
} }
print $langs->trans("ExpectedChecksum").' = ';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("ExpectedChecksum").'</td>';
print '<td>'.$langs->trans("CurrentChecksum").'</td>';
print '</tr>'."\n";
print '<tr><td>';
print '<span title="Checksum of all checksums in file separated by a comma and saved into '.$nameofsection.'">'; print '<span title="Checksum of all checksums in file separated by a comma and saved into '.$nameofsection.'">';
print $outexpectedchecksum; print $outexpectedchecksum;
print '</span><br>'; print '</span>';
print $langs->trans("CurrentChecksum").' = '.$outcurrentchecksum; print '</td><td>';
print $outcurrentchecksum;
print '</td>';
print '</tr>';
print '</table>';
print $outcurrentchecksumtext.'<br>';
print '<br><br>'; print '<br>';
print $outforlistoffiles; print $outforlistoffiles;
print '<br>'; print '<br>';

View File

@@ -431,7 +431,6 @@ $s = $langs->trans("FilesIntegrityDesc", '{s}');
$s = str_replace('{s}', DOL_URL_ROOT.'/admin/system/filecheck.php', $s); $s = str_replace('{s}', DOL_URL_ROOT.'/admin/system/filecheck.php', $s);
print $s; print $s;
print "<br>\n"; print "<br>\n";
print "</div>\n"; print "</div>\n";
print '<br>'; print '<br>';
@@ -548,7 +547,7 @@ print '</td>';
// Actions code // Actions code
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print $form->multiselectarray('search_code', $block_static->trackedevents, $search_code, 0, 0, 'maxwidth200', 1); print $form->multiselectarray('search_code', $block_static->trackedevents, $search_code, 0, 0, 'maxwidth150', 1);
print '</td>'; print '</td>';
// Ref // Ref

View File

@@ -2662,7 +2662,7 @@ AlgorithmFor=Algorithm for: %s
SensitiveData=Sensitive data SensitiveData=Sensitive data
ToolToDecryptAString=Tool to decrypt a string ToolToDecryptAString=Tool to decrypt a string
Decrypt=Decrypt Decrypt=Decrypt
FilesIntegrityDesc=If you want to check the integrity of files instead of database, you can do it by using <a href="%s">this tool</a>. FilesIntegrityDesc=If you want to check the integrity of files instead of database, you can do it by using <a href="%s"><span class="fas fa-external-link-alt pictofixedwidth"></span>this tool</a>.
AttributeCodeHelp=A code of your choice (without special chars and spaces) to identify the property.<br>Note that if an object B is created from an existing object A that has a different type (for example creation of an invoice from an order), the value of the complementary attributes of A are also copied into the complementary attributes of B when the code of the attribute is the same. AttributeCodeHelp=A code of your choice (without special chars and spaces) to identify the property.<br>Note that if an object B is created from an existing object A that has a different type (for example creation of an invoice from an order), the value of the complementary attributes of A are also copied into the complementary attributes of B when the code of the attribute is the same.
ThereIsMoreThanXAnswers=There is more than %s answers with your filter. Please add more filters... ThereIsMoreThanXAnswers=There is more than %s answers with your filter. Please add more filters...
PdfAddTermOfSaleHelp=You can upload the file at the bottom of this setup page PdfAddTermOfSaleHelp=You can upload the file at the bottom of this setup page
@@ -2736,3 +2736,4 @@ ModuleProviderSites=Module providers
StillInDevelopment=Still in development StillInDevelopment=Still in development
SeeValueIntoConfPhp=Some sensitive data in database are encrypted using this key. Without it, system backup and restoration is still possible but sensitive data (Tokens, BAN) would remain obfuscated and you will need to regenerate them. SeeValueIntoConfPhp=Some sensitive data in database are encrypted using this key. Without it, system backup and restoration is still possible but sensitive data (Tokens, BAN) would remain obfuscated and you will need to regenerate them.
SeeValueIntoConfPhp2=For security purpose, this value can be read from a system user, that have file system access to the conf/conf.php file. If you need a non system backup, without encrypted data, you can use the "export" menu to export your data in clear CSV files. SeeValueIntoConfPhp2=For security purpose, this value can be read from a system user, that have file system access to the conf/conf.php file. If you need a non system backup, without encrypted data, you can use the "export" menu to export your data in clear CSV files.
StatusOfModule=Status of module %s

View File

@@ -1,7 +1,8 @@
BlockedLog=Unalterable Logs BlockedLog=Unalterable Logs
BlockedLogDesc=This module tracks some events into an unalterable log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Finance 2016 - Norme NF525). BlockedLogDesc=This module tracks some events into an unalterable log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Finance 2016 - Norme NF525).
Fingerprints=Archived events and fingerprints Fingerprints=Archived events and fingerprints
FingerprintsDesc=This is the tool to browse or extract the unalterable logs. Unalterable logs are generated and archived locally into a dedicated table, in real time when you record a business event. You can use this tool to export this archive and save it into an external support (some countries, like France, ask that you do it every year). Note that, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non-valid fingerprint. If you really need to purge this table because you used your application for a demo/test purpose and want to clean your data to start your production, you can ask your reseller or integrator to reset your database (all your data will be removed). FingerprintsDesc=This is the tool to browse or extract the unalterable logs. Unalterable logs are generated and archived locally into a dedicated table, in real time when a business event appears. You can use this tool to export this archive and save it into an external support (some countries, like France, ask that you do it at least every year). Note that, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non-valid fingerprint.
FingerprintsDesc2=If you really need to purge this table because you used your application for a demo/test purpose and want to clean your data to start your production, you can ask your reseller or integrator to reset your database (all your data will be removed).
CompanyInitialKey=Company initial key (hash of genesis block) CompanyInitialKey=Company initial key (hash of genesis block)
BrowseBlockedLog=Unalterable logs BrowseBlockedLog=Unalterable logs
ShowAllFingerPrintsMightBeTooLong=Show all archived unlaterable logs (might be long) ShowAllFingerPrintsMightBeTooLong=Show all archived unlaterable logs (might be long)
@@ -34,6 +35,7 @@ BlockedLogDisabledBis=System to track events into unalterable logs has been disa
LinkHasBeenDisabledForPerformancePurpose=For performance purpose, direct link to the document is not shown after the 100th line. LinkHasBeenDisabledForPerformancePurpose=For performance purpose, direct link to the document is not shown after the 100th line.
SavedOnLine=Saved on line SavedOnLine=Saved on line
UnlaterableDataOfEvent=Unalterable data of event UnlaterableDataOfEvent=Unalterable data of event
YourCountryCode=Your country code
## logTypes ## logTypes
logBILL_DELETE=Customer invoice logically deleted logBILL_DELETE=Customer invoice logically deleted