29require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
48if (!$user->admin && !$user->hasRight(
'bockedlog',
'read')) {
55$versionbadge =
'<span class="badge-text badge-secondary">'.getBlockedLogVersionToShow();
56if (
$mysoc->country_code ==
'FR' && !constant(
'CERTIF_LNE')) {
58 $versionbadge .=
' - '.$langs->trans(
"NeedAThirdPartyStatement");
60$versionbadge .=
'</span>';
69llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-system_filecheck');
71print
load_fiche_titre($langs->trans(
"FileCheckDolibarr"),
'',
'title_setup');
73print
'<div class="opacitymedium hideonsmartphone justify">'.$langs->trans(
"FileCheckDesc").
'</div>';
75 print
'<span class="opacitymedium">';
76 print $langs->trans(
"DataIntegrityDesc").
': ';
78 print
'<a href="'.DOL_URL_ROOT.
'/blockedlog/admin/blockedlog_list.php">'.
img_picto(
'',
'url',
'class="pictofixedwidth"').$langs->trans(
"BlockedLog").
'</a><br>';
84print
'<div class="div-table-responsive-no-min">';
85print
'<table class="noborder centpercent">';
86print
'<tr class="liste_titre"><td>'.$langs->trans(
"Version").
'</td><td></td></tr>'.
"\n";
88$htmltooltip .= $langs->trans(
"VersionLastInstall").
': '.
getDolGlobalString(
'MAIN_VERSION_LAST_INSTALL').
'<br>'.
"\n";
89$htmltooltip .= $langs->trans(
"VersionLastUpgrade").
': '.
getDolGlobalString(
'MAIN_VERSION_LAST_UPGRADE').
'<br>'.
"\n";
91print
'<tr class="oddeven nohover">';
92print
'<td width="300">'.$langs->trans(
"VersionProgram").
'</td><td>';
93print
'<span class="badge-text badge-secondary valignmiddle">'.DOL_VERSION.
'</span>';
98 print
' '.img_warning($langs->trans(
"RunningUpdateProcessMayBeRequired", DOL_VERSION,
getDolGlobalString(
'MAIN_VERSION_LAST_INSTALL')));
103 print
' '.img_warning($langs->trans(
"RunningUpdateProcessMayBeRequired", DOL_VERSION,
getDolGlobalString(
'MAIN_VERSION_LAST_UPGRADE')));
106print
' '.$form->textwithpicto(
'', $htmltooltip);
107print
'</td></tr>'.
"\n";
109$showblockedlogversion = 0;
110if (
$mysoc->country_code ==
'FR') {
111 $showblockedlogversion = 1;
114 $showblockedlogversion = 1;
117if ($showblockedlogversion) {
118 print
'<tr class="oddeven nohover">';
119 print
'<td width="300">'.$langs->trans(
"VersionOfModule", $langs->transnoentitiesnoconv(
"BlockedLog")).
'</td><td>';
130if (
$mysoc->country_code ==
'FR') {
151$file_list = array(
'missing' => array(),
'updated' => array());
156$xmlfile = DOL_DOCUMENT_ROOT.
'/install/'.$xmlshortfile;
157if (!preg_match(
'/\.zip$/i', $xmlfile) &&
dol_is_file($xmlfile.
'.zip')) {
162$xmlremote =
GETPOST(
'xmlremote',
'alphanohtml');
166$param =
'MAIN_FILECHECK_URL_'.DOL_VERSION;
170if (empty($xmlremote)) {
171 $xmlremote =
'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.
'.xml';
173if (!preg_match(
'/^https?:\/\//', $xmlremote)) {
174 $langs->load(
"errors");
175 setEventMessages($langs->trans(
"ErrorURLMustStartWithHttp", $xmlremote),
null,
'errors');
177} elseif ($xmlremote && !preg_match(
'/\.xml$/', $xmlremote)) {
178 $langs->load(
"errors");
179 setEventMessages($langs->trans(
"ErrorURLMustEndWith", $xmlremote,
'.xml'),
null,
'errors');
184$enableremotecheck =
true;
185if (preg_match(
'/beta|alpha|rc/i', DOL_VERSION) ||
getDolGlobalString(
'MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE')) {
186 $enableremotecheck =
false;
189print
'<form name="check" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
190print
'<input type="hidden" name="token" value="'.newToken().
'">';
191print
img_picto(
'',
'search',
'class="pictofixedwidth"').$langs->trans(
"MakeIntegrityAnalysisFrom").
'...<br><br>';
193print
'<div class="divsection">';
194print
'<!-- for a local check target=local&xmlshortfile=... -->'.
"\n";
196 print
'<input type="radio" name="target" id="checkboxlocal" value="local"'.((!
GETPOST(
'target') ||
GETPOST(
'target') ==
'local') ?
'checked="checked"' :
'').
'"> <label for="checkboxlocal">'.$langs->trans(
"LocalSignature").
'</label> = ';
197 print
'<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).
'" spellcheck="false">';
200 print
'<input type="radio" name="target" id="checkboxlocal" value="local"> <label for="checkboxlocal">'.$langs->trans(
"LocalSignature").
' = ';
201 print
'<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).
'" spellcheck="false">';
202 print
'<br><span class="warning paddingtop inline-block">'.$langs->trans(
"AvailableOnlyOnPackagedVersions").
'</span></label>';
208print
'<!-- for a remote target=remote&xmlremote=... -->'.
"\n";
209if ($enableremotecheck) {
210 print
'<input type="radio" name="target" id="checkboxremote" value="remote"'.(GETPOST(
'target') ==
'remote' ?
'checked="checked"' :
'').
'> <label for="checkboxremote">'.$langs->trans(
"RemoteSignature").
'</label> = ';
211 print
'<input name="xmlremote" class="flat minwidth500" value="'.dol_escape_htmltag($xmlremote).
'" spellcheck="false"><br>';
213 print
'<input type="radio" name="target" id="checkboxremote" value="remote" disabled="disabled"> '.$langs->trans(
"RemoteSignature").
' = '.
dol_escape_htmltag($xmlremote);
215 print
' <span class="warning">('.$langs->trans(
"FeatureAvailableOnlyOnStable").
')</span>';
222print
'<div class="center">';
223if (
$mysoc->country_code ==
'FR') {
224 print
'<input type="checkbox" name="mode" id="mode" value="unalterable"'.($mode ==
'unalterable' ?
' checked="checked"' :
'').
'>';
225 print
'<label for="mode" class="opacitymedium">'.$langs->trans(
"AnalyzeUnalterableScopeOnly", $langs->transnoentitiesnoconv(
"BlockedLog")).
'</label><br>';
227print
'<input type="submit" name="check" class="button" value="'.$langs->trans(
"Check").
'">';
233if (
GETPOST(
'target') ==
'local') {
236 if (preg_match(
'/\.zip$/i', $xmlfile)) {
238 $xmlfilenew = preg_replace(
'/\.zip$/i',
'', $xmlfile);
240 if (empty($result[
'error'])) {
241 $xmlfile =
$conf->admin->dir_temp.
'/'.basename($xmlfilenew);
243 print $langs->trans(
'FailedToUncompressFile').
': '.$xmlfile;
247 $xml = simplexml_load_file($xmlfile);
248 if ($xml ===
false) {
249 print
'<div class="warning">'.$langs->trans(
'XmlCorrupted').
': '.$xmlfile.
'</span>';
253 print
'<div class="warning">'.$langs->trans(
'XmlNotFound').
': '.$xmlfile.
'</span>';
257if (
GETPOST(
'target') ==
'remote') {
258 $xmlarray =
getURLContent($xmlremote,
'GET',
'', 1, array(), array(
'http',
'https'), 0);
261 if (!$xmlarray[
'curl_error_no'] && $xmlarray[
'http_code'] != 400 && $xmlarray[
'http_code'] != 404) {
262 $xmlfile = $xmlarray[
'content'];
264 if (LIBXML_VERSION < 20900) {
268 libxml_disable_entity_loader(
true);
271 $xml = simplexml_load_string($xmlfile,
'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
273 $errormsg = $langs->trans(
'XmlNotFound').
': '.$xmlremote.
' - '.$xmlarray[
'http_code'].(($xmlarray[
'http_code'] == 400 && $xmlarray[
'content']) ?
' '.$xmlarray[
'content'] :
'').
' '.$xmlarray[
'curl_error_no'].
' '.$xmlarray[
'curl_error_msg'];
280if (empty($error) && !empty($xml)) {
281 $checksumconcat = array();
282 $file_list = array();
285 $algo = (
string) $xml[
'algo'];
292 if (is_object($xml->dolibarr_constants[0]) || $mode ==
'unalterable') {
295 $out .=
'<div class="div-table-responsive-no-min">';
296 $out .=
'<table class="noborder">';
297 $out .=
'<tr class="liste_titre">';
298 $out .=
'<td>#</td>';
299 $out .=
'<td>'.$langs->trans(
"Parameter").
'</td>';
300 $out .=
'<td class="center">'.$langs->trans(
"ExpectedValue").
'</td>';
301 $out .=
'<td class="center">'.$langs->trans(
"CurrentValue").
'</td>';
302 $out .=
'</tr>'.
"\n";
306 if ($mode ==
'unalterable') {
309 $out .=
'<tr class="oddeven">';
310 $out .=
'<td>'.$i.
'</td>'.
"\n";
311 $out .=
'<td>'.$langs->trans(
"Country").
'</td>'.
"\n";
312 $out .=
'<td class="center"><span class="opacitymedium">'.$langs->trans(
"YourCountryCode").
'</span></td>'.
"\n";
313 $out .=
'<td class="center">'.$mysoc->country_code.
'</td>'.
"\n";
318 $out .=
'<tr class="oddeven">';
319 $out .=
'<td>'.$i.
'</td>'.
"\n";
320 $out .=
'<td>'.$langs->trans(
"StatusOfModule", $langs->transnoentitiesnoconv(
"BlockedLog")).
'</td>'.
"\n";
321 $out .=
'<td class="center">'.$langs->trans(
"Enabled").
'</td>'.
"\n";
322 $out .=
'<td class="center">';
323 $out .=
isModEnabled(
'blockedlog') ?
'<span class="ok">'.$langs->trans(
"Enabled").
'</span>' :
'<span class="warning">'.$langs->trans(
"Disabled").
'</span>';
325 include_once DOL_DOCUMENT_ROOT.
'/core/modules/modBlockedLog.class.php';
331 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
333 $htmltooltip =
'<span class="opacitymedium">'.$langs->trans(
"LastActivationDate").
':</span> ';
335 $htmltooltip .=
dol_print_date($objMod->getLastActivationDate(),
'dayhour');
337 $htmltooltip .= $langs->trans(
"Disabled");
339 $tmp = $objMod->getLastActivationInfo();
340 $authorid = (empty($tmp[
'authorid']) ?
'' : $tmp[
'authorid']);
343 $tmpuser->fetch($authorid);
344 $htmltooltip .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationAuthor").
':</span> ';
345 $htmltooltip .= $tmpuser->getNomUrl(0,
'nolink', -1, 1);
347 $ip = (empty($tmp[
'ip']) ?
'' : $tmp[
'ip']);
349 $htmltooltip .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationIP").
':</span> ';
352 $lastactivationversion = (empty($tmp[
'lastactivationversion']) ?
'' : $tmp[
'lastactivationversion']);
353 if ($lastactivationversion && $lastactivationversion !=
'dolibarr') {
354 $htmltooltip .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationVersion").
':</span> ';
355 $htmltooltip .= $lastactivationversion;
358 $out .= $form->textwithpicto(
'', $htmltooltip);
364 foreach ($xml->dolibarr_constants[0]->constant as $constant) {
365 $constname = (
string) $constant[
'name'];
366 $constvalue = (
string) $constant;
368 $constvalue = (empty($constvalue) ?
'0' : $constvalue);
374 $valueforchecksum = (empty($value) ?
'0' : $value);
376 $checksumconcat[$constname] = $valueforchecksum;
380 $out .=
'<tr class="oddeven">';
381 $out .=
'<td>'.$i.
'</td>'.
"\n";
382 $out .=
'<td>'.dol_escape_htmltag($constname).
'</td>'.
"\n";
383 $out .=
'<td class="center">'.dol_escape_htmltag($constvalue).
'</td>'.
"\n";
384 $out .=
'<td class="center">'.dol_escape_htmltag($valueforchecksum).
'</td>'.
"\n";
388 if ($i == 0 && $mode !=
'unalterable') {
389 $out .=
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
398 $onlymodifiedorremoved = 0;
399 if ($mode ==
'unalterable') {
400 $listoffilestoanalyze = $xml->dolibarr_unalterable_files[0];
401 $onlymodifiedorremoved = 1;
403 $listoffilestoanalyze = $xml->dolibarr_htdocs_dir[0];
404 $onlymodifiedorremoved = 0;
409 if (is_object($listoffilestoanalyze)) {
411 $includecustom = (empty($listoffilestoanalyze[
'includecustom']) ? 0 : $listoffilestoanalyze[
'includecustom']);
414 $regextoinclude =
'\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
415 $regextoexclude =
'('.($includecustom ?
'' :
'custom|').
'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$';
416 $scanfiles =
dol_dir_list(DOL_DOCUMENT_ROOT,
'files', 1, $regextoinclude, $regextoexclude);
419 getFilesUpdated($file_list, $listoffilestoanalyze,
'', DOL_DOCUMENT_ROOT, $checksumconcat);
420 '@phan-var-force array{insignature:string[],missing?:array<array{filename:string,expectedhash:string,expectedsize:string,algo:string}>,updated:array<array{filename:string,expectedhash:string,expectedsize:string,hash:string,algo:string}>} $file_list';
423 if (empty($onlymodifiedorremoved)) {
424 foreach ($scanfiles as $valfile) {
425 $tmprelativefilename = preg_replace(
'/^'.preg_quote(DOL_DOCUMENT_ROOT,
'/').
'/',
'', $valfile[
'fullname']);
426 if (!in_array($tmprelativefilename, $file_list[
'insignature'])) {
427 $hashnewfile = @hash_file($algo, $valfile[
'fullname']);
428 $file_list[
'added'][] = array(
'filename' => $tmprelativefilename,
'hash' => $hashnewfile,
'algo' => $algo);
436 $out .=
'<div class="div-table-responsive-no-min">';
437 $out .=
'<table class="noborder">';
438 $out .=
'<tr class="liste_titre">';
439 $out .=
'<td>#</td>';
440 $out .=
'<td>'.$langs->trans(
"Filename").
'</td>';
441 $out .=
'<td class="right">'.$langs->trans(
"ExpectedSize").
'</td>';
442 $out .=
'<td class="center">'.$langs->trans(
"ExpectedChecksum").
'</td>';
443 $out .=
'</tr>'.
"\n";
445 if (is_array($tmpfilelist) && count($tmpfilelist)) {
447 foreach ($tmpfilelist as $file) {
449 $out .=
'<tr class="oddeven">';
450 $out .=
'<td>'.$i.
'</td>'.
"\n";
451 $out .=
'<td>'.dol_escape_htmltag($file[
'filename']).
'</td>'.
"\n";
452 $out .=
'<td class="right">';
453 if (!empty($file[
'expectedsize'])) {
456 $out .=
'</td>'.
"\n";
457 $out .=
'<td class="center">'.dol_escape_htmltag($file[
'expectedhash']).
'</td>'.
"\n";
461 $out .=
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
472 $out .=
'<div class="div-table-responsive-no-min">';
473 $out .=
'<table class="noborder">';
474 $out .=
'<tr class="liste_titre">';
475 $out .=
'<td>#</td>';
476 $out .=
'<td>'.$langs->trans(
"Filename").
'</td>';
477 $out .=
'<td class="center">'.$langs->trans(
"ExpectedChecksum").
'</td>';
478 $out .=
'<td class="center">'.$langs->trans(
"CurrentChecksum").
'</td>';
479 $out .=
'<td class="right">'.$langs->trans(
"ExpectedSize").
'</td>';
480 $out .=
'<td class="right">'.$langs->trans(
"CurrentSize").
'</td>';
481 $out .=
'<td class="right">'.$langs->trans(
"DateModification").
'</td>';
482 $out .=
'</tr>'.
"\n";
483 $tmpfilelist2 =
dol_sort_array($file_list[
'updated'],
'filename');
484 if (is_array($tmpfilelist2) && count($tmpfilelist2)) {
486 foreach ($tmpfilelist2 as $file) {
488 $out .=
'<tr class="oddeven">';
489 $out .=
'<td>'.$i.
'</td>'.
"\n";
490 $out .=
'<td>'.dol_escape_htmltag($file[
'filename']).
'</td>'.
"\n";
491 $out .=
'<td class="center" title="'.dol_escape_htmltag($file[
'expectedhash']).
'">'.
dol_escape_htmltag(
dol_trunc($file[
'expectedhash'], 16)).
'</td>'.
"\n";
492 $out .=
'<td class="center" title="'.dol_escape_htmltag($file[
'hash']).
'">'.
dol_escape_htmltag(
dol_trunc($file[
'hash'], 16)).
'</td>'.
"\n";
493 $out .=
'<td class="right">';
494 if ($file[
'expectedsize']) {
497 $out .=
'</td>'.
"\n";
498 $size =
dol_filesize(DOL_DOCUMENT_ROOT.
'/'.$file[
'filename']);
500 $out .=
'<td class="right">'.dol_print_size($size).
'</td>'.
"\n";
501 $out .=
'<td class="right">'.dol_print_date(
dol_filemtime(DOL_DOCUMENT_ROOT.
'/'.$file[
'filename']),
'dayhour').
'</td>'.
"\n";
504 $out .=
'<tr class="liste_total">';
505 $out .=
'<td></td>'.
"\n";
506 $out .=
'<td>'.$langs->trans(
"Total").
'</td>'.
"\n";
507 $out .=
'<td class="center"></td>'.
"\n";
508 $out .=
'<td class="center"></td>'.
"\n";
509 $out .=
'<td class="center"></td>'.
"\n";
510 $out .=
'<td class="right">'.dol_print_size($totalsize).
'</td>'.
"\n";
511 $out .=
'<td class="right"></td>'.
"\n";
514 $out .=
'<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
522 if (empty($onlymodifiedorremoved)) {
526 $out .=
'<div class="div-table-responsive-no-min">';
527 $out .=
'<table class="noborder">';
528 $out .=
'<tr class="liste_titre">';
529 $out .=
'<td>#</td>';
530 $out .=
'<td>'.$langs->trans(
"Filename").
'</td>';
531 $out .=
'<td class="center">'.$langs->trans(
"ExpectedChecksum").
'</td>';
532 $out .=
'<td class="center">'.$langs->trans(
"CurrentChecksum").
'</td>';
533 $out .=
'<td class="right">'.$langs->trans(
"Size").
'</td>';
534 $out .=
'<td class="right">'.$langs->trans(
"DateModification").
'</td>';
535 $out .=
'</tr>'.
"\n";
537 if (is_array($tmpfilelist3) && count($tmpfilelist3)) {
539 foreach ($tmpfilelist3 as $file) {
541 $out .=
'<tr class="oddeven">';
542 $out .=
'<td>'.$i.
'</td>'.
"\n";
543 $out .=
'<td>'.dol_escape_htmltag($file[
'filename']);
544 if (!preg_match(
'/^win/i', PHP_OS)) {
545 $htmltext = $langs->trans(
"YouCanDeleteFileOnServerWith",
'rm '.DOL_DOCUMENT_ROOT.$file[
'filename']);
546 $out .=
' '.$form->textwithpicto(
'', $htmltext, 1,
'help',
'', 0, 2,
'helprm'.$i);
548 $out .=
'</td>'.
"\n";
549 $out .=
'<td class="center" title="'.dol_escape_htmltag((
string) $file[
'expectedhash']).
'">'.
dol_escape_htmltag(
dol_trunc((
string) $file[
'expectedhash'], 16)).
'</td>'.
"\n";
550 $out .=
'<td class="center" title="'.dol_escape_htmltag((
string) $file[
'hash']).
'">'.
dol_escape_htmltag(
dol_trunc($file[
'hash'], 16)).
'</td>'.
"\n";
551 $size =
dol_filesize(DOL_DOCUMENT_ROOT.
'/'.$file[
'filename']);
553 $out .=
'<td class="right">'.dol_print_size($size).
'</td>'.
"\n";
554 $out .=
'<td class="right nowraponall">'.dol_print_date(
dol_filemtime(DOL_DOCUMENT_ROOT.
'/'.$file[
'filename']),
'dayhour').
'</td>'.
"\n";
557 $out .=
'<tr class="liste_total">';
558 $out .=
'<td></td>'.
"\n";
559 $out .=
'<td>'.$langs->trans(
"Total").
'</td>'.
"\n";
560 $out .=
'<td class="center"></td>'.
"\n";
561 $out .=
'<td class="center"></td>'.
"\n";
562 $out .=
'<td class="right">'.dol_print_size($totalsize).
'</td>'.
"\n";
563 $out .=
'<td class="right"></td>'.
"\n";
566 $out .=
'<tr class="oddeven"><td colspan="6"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
572 print
'<div class="error">';
573 print
'Error: Failed to found <b>dolibarr_htdocs_dir</b> into content of XML file:<br>'.dol_escape_htmltag(
dol_trunc($xmlfile, 500));
589 asort($checksumconcat);
591 $checksumget = hash($algo, implode(
',', $checksumconcat));
593 if ($mode ==
'unalterable') {
594 $nameofsection =
'dolibarr_unalterable_files_checksum';
595 $checksumtoget = trim((
string) $xml->dolibarr_unalterable_files_checksum);
597 $nameofsection =
'dolibarr_htdocs_dir_checksum';
598 $checksumtoget = trim((
string) $xml->dolibarr_htdocs_dir_checksum);
603 $outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans(
"Unknown"));
604 $outcurrentchecksumtext =
'';
605 if ($checksumget == $checksumtoget) {
606 if (empty($onlymodifiedorremoved) && !empty($file_list[
'added'])) {
607 $resultcode =
'warning';
608 $resultcomment =
'FileIntegrityIsOkButFilesWereAdded';
609 $outcurrentchecksum = $checksumget;
610 $outcurrentchecksumtext .=
img_picto(
'',
'tick').
' <span class="'.$resultcode.
'">'.$langs->trans($resultcomment).
'</span>';
613 $resultcomment =
'Success';
614 $outcurrentchecksum =
'<span class="'.$resultcode.
'" title="Checksum of all current checksums concatenated separated by a comma">'.$checksumget.
'</span>';
615 $outcurrentchecksumtext.=
img_picto(
'',
'tick').
' <span class="badge badge-status4 badge-status '.$resultcode.
'">'.$langs->trans($resultcomment).
'</span>';
618 $resultcode =
'error';
619 $resultcomment =
'FileIntegrityIsKO';
620 $outcurrentchecksum =
'<span class="'.$resultcode.
'" title="Checksum of all current checksums concatenated separated by a comma">'.$checksumget.
'</span>';
621 $outcurrentchecksumtext .=
img_picto(
'',
'error').
' <span class="'.$resultcode.
'">'.$langs->trans($resultcomment).
'</span>';
625 if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3) && $resultcode ==
'ok') {
626 setEventMessages($langs->trans(
"FileIntegrityIsStrictlyConformedWithReference"),
null,
'mesgs');
628 if ($resultcode ==
'warning') {
631 setEventMessages($langs->trans(
"FileIntegritySomeFilesWereRemovedOrModified"),
null,
'errors');
635 $outforlistoffiles =
'';
636 if ($mode ==
'unalterable') {
640 $outforlistoffiles =
'<a href="#" onclick="console.log(\'Click\'); jQuery(\'#listofunalterablefiles\').toggle(); return false;">'.$langs->trans(
"ShowListOfFiles").
'</a><br>';
641 $outforlistoffiles .=
'<textarea id="listofunalterablefiles" class="hideobject quatrevingtpercent" rows="12" spellcheck="false">';
643 foreach ($listoffilestoanalyze as $dirtoanalyze) {
645 if (!empty($dirtoanalyze->md5file)) {
646 $entry = $dirtoanalyze->md5file;
648 } elseif (!empty($dirtoanalyze->sha256file)) {
649 $entry = $dirtoanalyze->sha256file;
653 foreach ($entry as $filetoanalyze) {
655 $outforlistoffiles .=
"\n";
657 $outforlistoffiles .= (
string) $dirtoanalyze[
'name'];
658 $outforlistoffiles .=
'/';
659 $outforlistoffiles .= (
string) $filetoanalyze[
'name'];
663 $outforlistoffiles .=
'</textarea>';
664 $outforlistoffiles .=
'<br>';
670 print
'<div class="div-table-responsive-no-min">';
671 print
'<table class="noborder">';
672 print
'<tr class="liste_titre">';
673 print
'<td>'.$langs->trans(
"ExpectedChecksum").
' <span class="opacitymedium">('.$algo.
')</span></td>';
674 print
'<td>'.$langs->trans(
"CurrentChecksum").
' <span class="opacitymedium">('.$algo.
')</span></td>';
678 print
'<span title="Checksum of all checksums in file separated by a comma and saved into '.$nameofsection.
'">';
679 print $outexpectedchecksum;
682 print $outcurrentchecksum;
686 print $outcurrentchecksumtext.
'<br>';
689 print $outforlistoffiles;
versiondolibarrarray()
Return version Dolibarr.
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays), to know if a version (a,b,c) is lower than (x,...
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
getBlockedLogVersionToShow()
Define head array for tabs of blockedlog tools setup pages.
isALNEQualifiedVersion($ignoredev=0, $ignoremodule=0)
Return if the version is a candidate version to get the LNE certification and if the prerequisites ar...
isALNERunningVersion($blockedlogtestalreadydone=0, $blockedlogmodulealreadydone=0)
Return if the application is executed with the LNE requirements on.
Class to manage Dolibarr users.
Class to describe a BlockedLog module.
getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path='', $pathref='', &$checksumconcat=array())
Function to get list of updated or modified files.
dol_filemtime($pathoffile)
Return time of a file.
dol_filesize($pathoffile)
Return size of a file.
dol_uncompress($inputfile, $outputdir)
Uncompress a file.
dol_is_file($pathoffile)
Return if path is a file.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formatted size.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
getURLContent($url, $postorget='GET', $param='', $followlocation=1, $addheaders=array(), $allowedschemes=array('http', 'https'), $localurl=0, $ssl_verifypeer=-1, $timeoutconnect=0, $timeoutresponse=0, $otherCurlOptions=array(), $morelogsuffix='')
Function to get a content from an URL (use proxy if proxy defined).
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.