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';
60llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-system_filecheck');
62print
load_fiche_titre($langs->trans(
"FileCheckDolibarr"),
'',
'title_setup');
64print
'<div class="opacitymedium hideonsmartphone justify">'.$langs->trans(
"FileCheckDesc");
66 $s = $langs->trans(
"DataIntegrityDesc",
'{s}');
67 $s = str_replace(
'{s}', DOL_URL_ROOT.
'/blockedlog/admin/blockedlog_list.php', $s);
73print
'<div class="div-table-responsive-no-min">';
74print
'<table class="noborder centpercent">';
75print
'<tr class="liste_titre"><td>'.$langs->trans(
"Version").
'</td><td></td></tr>'.
"\n";
77$htmltooltip .= $langs->trans(
"VersionLastInstall").
': '.
getDolGlobalString(
'MAIN_VERSION_LAST_INSTALL').
'<br>'.
"\n";
78$htmltooltip .= $langs->trans(
"VersionLastUpgrade").
': '.
getDolGlobalString(
'MAIN_VERSION_LAST_UPGRADE').
'<br>'.
"\n";
80print
'<tr class="oddeven nohover"><td width="300">'.$langs->trans(
"VersionProgram").
'</td><td>';
81print
'<span class="badge-text badge-secondary valignmiddle">'.DOL_VERSION.
'</span>';
86 print
' '.img_warning($langs->trans(
"RunningUpdateProcessMayBeRequired", DOL_VERSION,
getDolGlobalString(
'MAIN_VERSION_LAST_INSTALL')));
91 print
' '.img_warning($langs->trans(
"RunningUpdateProcessMayBeRequired", DOL_VERSION,
getDolGlobalString(
'MAIN_VERSION_LAST_UPGRADE')));
94print
' '.$form->textwithpicto(
'', $htmltooltip);
95print
'</td></tr>'.
"\n";
102$file_list = array(
'missing' => array(),
'updated' => array());
107$xmlfile = DOL_DOCUMENT_ROOT.
'/install/'.$xmlshortfile;
108if (!preg_match(
'/\.zip$/i', $xmlfile) &&
dol_is_file($xmlfile.
'.zip')) {
113$xmlremote =
GETPOST(
'xmlremote',
'alphanohtml');
117$param =
'MAIN_FILECHECK_URL_'.DOL_VERSION;
121if (empty($xmlremote)) {
122 $xmlremote =
'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.
'.xml';
124if (!preg_match(
'/^https?:\/\//', $xmlremote)) {
125 $langs->load(
"errors");
126 setEventMessages($langs->trans(
"ErrorURLMustStartWithHttp", $xmlremote),
null,
'errors');
128} elseif ($xmlremote && !preg_match(
'/\.xml$/', $xmlremote)) {
129 $langs->load(
"errors");
130 setEventMessages($langs->trans(
"ErrorURLMustEndWith", $xmlremote,
'.xml'),
null,
'errors');
135$enableremotecheck =
true;
136if (preg_match(
'/beta|alpha|rc/i', DOL_VERSION) ||
getDolGlobalString(
'MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE')) {
137 $enableremotecheck =
false;
140print
'<form name="check" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
141print
'<input type="hidden" name="token" value="'.newToken().
'">';
142print
img_picto(
'',
'search',
'class="pictofixedwidth"').$langs->trans(
"MakeIntegrityAnalysisFrom").
'...<br><br>';
144print
'<div class="divsection">';
145print
'<!-- for a local check target=local&xmlshortfile=... -->'.
"\n";
147 print
'<input type="radio" name="target" id="checkboxlocal" value="local"'.((!
GETPOST(
'target') ||
GETPOST(
'target') ==
'local') ?
'checked="checked"' :
'').
'"> <label for="checkboxlocal">'.$langs->trans(
"LocalSignature").
'</label> = ';
148 print
'<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).
'" spellcheck="false">';
151 print
'<input type="radio" name="target" id="checkboxlocal" value="local"> <label for="checkboxlocal">'.$langs->trans(
"LocalSignature").
' = ';
152 print
'<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).
'" spellcheck="false">';
153 print
'<br><span class="warning paddingtop inline-block">'.$langs->trans(
"AvailableOnlyOnPackagedVersions").
'</span></label>';
159print
'<!-- for a remote target=remote&xmlremote=... -->'.
"\n";
160if ($enableremotecheck) {
161 print
'<input type="radio" name="target" id="checkboxremote" value="remote"'.(GETPOST(
'target') ==
'remote' ?
'checked="checked"' :
'').
'> <label for="checkboxremote">'.$langs->trans(
"RemoteSignature").
'</label> = ';
162 print
'<input name="xmlremote" class="flat minwidth500" value="'.dol_escape_htmltag($xmlremote).
'" spellcheck="false"><br>';
164 print
'<input type="radio" name="target" id="checkboxremote" value="remote" disabled="disabled"> '.$langs->trans(
"RemoteSignature").
' = '.
dol_escape_htmltag($xmlremote);
166 print
' <span class="warning">('.$langs->trans(
"FeatureAvailableOnlyOnStable").
')</span>';
173print
'<div class="center">';
174if (
$mysoc->country_code ==
'FR') {
175 print
'<input type="checkbox" name="mode" id="mode" value="unalterable"'.($mode ==
'unalterable' ?
' checked="checked"' :
'').
'>';
176 print
'<label for="mode" class="opacitymedium">'.$langs->trans(
"AnalyzeUnalterableScopeOnly", $langs->transnoentitiesnoconv(
"BlockedLog")).
'</label><br>';
178print
'<input type="submit" name="check" class="button" value="'.$langs->trans(
"Check").
'">';
184if (
GETPOST(
'target') ==
'local') {
187 if (preg_match(
'/\.zip$/i', $xmlfile)) {
189 $xmlfilenew = preg_replace(
'/\.zip$/i',
'', $xmlfile);
191 if (empty($result[
'error'])) {
192 $xmlfile = $conf->admin->dir_temp.
'/'.basename($xmlfilenew);
194 print $langs->trans(
'FailedToUncompressFile').
': '.$xmlfile;
198 $xml = simplexml_load_file($xmlfile);
199 if ($xml ===
false) {
200 print
'<div class="warning">'.$langs->trans(
'XmlCorrupted').
': '.$xmlfile.
'</span>';
204 print
'<div class="warning">'.$langs->trans(
'XmlNotFound').
': '.$xmlfile.
'</span>';
208if (
GETPOST(
'target') ==
'remote') {
209 $xmlarray =
getURLContent($xmlremote,
'GET',
'', 1, array(), array(
'http',
'https'), 0);
212 if (!$xmlarray[
'curl_error_no'] && $xmlarray[
'http_code'] != 400 && $xmlarray[
'http_code'] != 404) {
213 $xmlfile = $xmlarray[
'content'];
215 if (LIBXML_VERSION < 20900) {
219 libxml_disable_entity_loader(
true);
222 $xml = simplexml_load_string($xmlfile,
'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
224 $errormsg = $langs->trans(
'XmlNotFound').
': '.$xmlremote.
' - '.$xmlarray[
'http_code'].(($xmlarray[
'http_code'] == 400 && $xmlarray[
'content']) ?
' '.$xmlarray[
'content'] :
'').
' '.$xmlarray[
'curl_error_no'].
' '.$xmlarray[
'curl_error_msg'];
231if (empty($error) && !empty($xml)) {
232 $checksumconcat = array();
233 $file_list = array();
236 $algo = (string) $xml[
'algo'];
243 if (is_object($xml->dolibarr_constants[0]) || $mode ==
'unalterable') {
246 $out .=
'<div class="div-table-responsive-no-min">';
247 $out .=
'<table class="noborder">';
248 $out .=
'<tr class="liste_titre">';
249 $out .=
'<td>#</td>';
250 $out .=
'<td>'.$langs->trans(
"Parameter").
'</td>';
251 $out .=
'<td class="center">'.$langs->trans(
"ExpectedValue").
'</td>';
252 $out .=
'<td class="center">'.$langs->trans(
"CurrentValue").
'</td>';
253 $out .=
'</tr>'.
"\n";
257 if ($mode ==
'unalterable') {
260 $out .=
'<tr class="oddeven">';
261 $out .=
'<td>'.$i.
'</td>'.
"\n";
262 $out .=
'<td>'.$langs->trans(
"Country").
'</td>'.
"\n";
263 $out .=
'<td class="center"><span class="opacitymedium">'.$langs->trans(
"YourCountryCode").
'</span></td>'.
"\n";
264 $out .=
'<td class="center">'.$mysoc->country_code.
'</td>'.
"\n";
269 $out .=
'<tr class="oddeven">';
270 $out .=
'<td>'.$i.
'</td>'.
"\n";
271 $out .=
'<td>'.$langs->trans(
"StatusOfModule", $langs->transnoentitiesnoconv(
"BlockedLog")).
'</td>'.
"\n";
272 $out .=
'<td class="center">'.$langs->trans(
"Enabled").
'</td>'.
"\n";
273 $out .=
'<td class="center">';
274 $out .=
isModEnabled(
'blockedlog') ?
'<span class="ok">'.$langs->trans(
"Enabled").
'</span>' :
'<span class="warning">'.$langs->trans(
"Disabled").
'</span>';
276 include_once DOL_DOCUMENT_ROOT.
'/core/modules/modBlockedLog.class.php';
282 $const_name =
'MAIN_MODULE_'.strtoupper(preg_replace(
'/^mod/i',
'', get_class($objMod)));
284 $htmltooltip =
'<span class="opacitymedium">'.$langs->trans(
"LastActivationDate").
':</span> ';
286 $htmltooltip .=
dol_print_date($objMod->getLastActivationDate(),
'dayhour');
288 $htmltooltip .= $langs->trans(
"Disabled");
290 $tmp = $objMod->getLastActivationInfo();
291 $authorid = (empty($tmp[
'authorid']) ?
'' : $tmp[
'authorid']);
293 $tmpuser =
new User($db);
294 $tmpuser->fetch($authorid);
295 $htmltooltip .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationAuthor").
':</span> ';
296 $htmltooltip .= $tmpuser->getNomUrl(0,
'nolink', -1, 1);
298 $ip = (empty($tmp[
'ip']) ?
'' : $tmp[
'ip']);
300 $htmltooltip .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationIP").
':</span> ';
303 $lastactivationversion = (empty($tmp[
'lastactivationversion']) ?
'' : $tmp[
'lastactivationversion']);
304 if ($lastactivationversion && $lastactivationversion !=
'dolibarr') {
305 $htmltooltip .=
'<br><span class="opacitymedium">'.$langs->trans(
"LastActivationVersion").
':</span> ';
306 $htmltooltip .= $lastactivationversion;
309 $out .= $form->textwithpicto(
'', $htmltooltip);
315 foreach ($xml->dolibarr_constants[0]->constant as $constant) {
316 $constname = (string) $constant[
'name'];
317 $constvalue = (string) $constant;
319 $constvalue = (empty($constvalue) ?
'0' : $constvalue);
325 $valueforchecksum = (empty($value) ?
'0' : $value);
327 $checksumconcat[$constname] = $valueforchecksum;
331 $out .=
'<tr class="oddeven">';
332 $out .=
'<td>'.$i.
'</td>'.
"\n";
333 $out .=
'<td>'.dol_escape_htmltag($constname).
'</td>'.
"\n";
334 $out .=
'<td class="center">'.dol_escape_htmltag($constvalue).
'</td>'.
"\n";
335 $out .=
'<td class="center">'.dol_escape_htmltag($valueforchecksum).
'</td>'.
"\n";
339 if ($i == 0 && $mode !=
'unalterable') {
340 $out .=
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
349 $onlymodifiedorremoved = 0;
350 if ($mode ==
'unalterable') {
351 $listoffilestoanalyze = $xml->dolibarr_unalterable_files[0];
352 $onlymodifiedorremoved = 1;
354 $listoffilestoanalyze = $xml->dolibarr_htdocs_dir[0];
355 $onlymodifiedorremoved = 0;
360 if (is_object($listoffilestoanalyze)) {
362 $includecustom = (empty($listoffilestoanalyze[
'includecustom']) ? 0 : $listoffilestoanalyze[
'includecustom']);
365 $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)$';
366 $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)$';
367 $scanfiles =
dol_dir_list(DOL_DOCUMENT_ROOT,
'files', 1, $regextoinclude, $regextoexclude);
370 getFilesUpdated($file_list, $listoffilestoanalyze,
'', DOL_DOCUMENT_ROOT, $checksumconcat);
371 '@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';
374 if (empty($onlymodifiedorremoved)) {
375 foreach ($scanfiles as $valfile) {
376 $tmprelativefilename = preg_replace(
'/^'.preg_quote(DOL_DOCUMENT_ROOT,
'/').
'/',
'', $valfile[
'fullname']);
377 if (!in_array($tmprelativefilename, $file_list[
'insignature'])) {
378 $hashnewfile = @hash_file($algo, $valfile[
'fullname']);
379 $file_list[
'added'][] = array(
'filename' => $tmprelativefilename,
'hash' => $hashnewfile,
'algo' => $algo);
387 $out .=
'<div class="div-table-responsive-no-min">';
388 $out .=
'<table class="noborder">';
389 $out .=
'<tr class="liste_titre">';
390 $out .=
'<td>#</td>';
391 $out .=
'<td>'.$langs->trans(
"Filename").
'</td>';
392 $out .=
'<td class="right">'.$langs->trans(
"ExpectedSize").
'</td>';
393 $out .=
'<td class="center">'.$langs->trans(
"ExpectedChecksum").
'</td>';
394 $out .=
'</tr>'.
"\n";
396 if (is_array($tmpfilelist) && count($tmpfilelist)) {
398 foreach ($tmpfilelist as $file) {
400 $out .=
'<tr class="oddeven">';
401 $out .=
'<td>'.$i.
'</td>'.
"\n";
402 $out .=
'<td>'.dol_escape_htmltag($file[
'filename']).
'</td>'.
"\n";
403 $out .=
'<td class="right">';
404 if (!empty($file[
'expectedsize'])) {
407 $out .=
'</td>'.
"\n";
408 $out .=
'<td class="center">'.dol_escape_htmltag($file[
'expectedhash']).
'</td>'.
"\n";
412 $out .=
'<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
423 $out .=
'<div class="div-table-responsive-no-min">';
424 $out .=
'<table class="noborder">';
425 $out .=
'<tr class="liste_titre">';
426 $out .=
'<td>#</td>';
427 $out .=
'<td>'.$langs->trans(
"Filename").
'</td>';
428 $out .=
'<td class="center">'.$langs->trans(
"ExpectedChecksum").
'</td>';
429 $out .=
'<td class="center">'.$langs->trans(
"CurrentChecksum").
'</td>';
430 $out .=
'<td class="right">'.$langs->trans(
"ExpectedSize").
'</td>';
431 $out .=
'<td class="right">'.$langs->trans(
"CurrentSize").
'</td>';
432 $out .=
'<td class="right">'.$langs->trans(
"DateModification").
'</td>';
433 $out .=
'</tr>'.
"\n";
434 $tmpfilelist2 =
dol_sort_array($file_list[
'updated'],
'filename');
435 if (is_array($tmpfilelist2) && count($tmpfilelist2)) {
437 foreach ($tmpfilelist2 as $file) {
439 $out .=
'<tr class="oddeven">';
440 $out .=
'<td>'.$i.
'</td>'.
"\n";
441 $out .=
'<td>'.dol_escape_htmltag($file[
'filename']).
'</td>'.
"\n";
442 $out .=
'<td class="center">'.dol_escape_htmltag($file[
'expectedhash']).
'</td>'.
"\n";
443 $out .=
'<td class="center">'.dol_escape_htmltag($file[
'hash']).
'</td>'.
"\n";
444 $out .=
'<td class="right">';
445 if ($file[
'expectedsize']) {
448 $out .=
'</td>'.
"\n";
449 $size =
dol_filesize(DOL_DOCUMENT_ROOT.
'/'.$file[
'filename']);
451 $out .=
'<td class="right">'.dol_print_size($size).
'</td>'.
"\n";
452 $out .=
'<td class="right">'.dol_print_date(
dol_filemtime(DOL_DOCUMENT_ROOT.
'/'.$file[
'filename']),
'dayhour').
'</td>'.
"\n";
455 $out .=
'<tr class="liste_total">';
456 $out .=
'<td></td>'.
"\n";
457 $out .=
'<td>'.$langs->trans(
"Total").
'</td>'.
"\n";
458 $out .=
'<td class="center"></td>'.
"\n";
459 $out .=
'<td class="center"></td>'.
"\n";
460 $out .=
'<td class="center"></td>'.
"\n";
461 $out .=
'<td class="right">'.dol_print_size($totalsize).
'</td>'.
"\n";
462 $out .=
'<td class="right"></td>'.
"\n";
465 $out .=
'<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
473 if (empty($onlymodifiedorremoved)) {
477 $out .=
'<div class="div-table-responsive-no-min">';
478 $out .=
'<table class="noborder">';
479 $out .=
'<tr class="liste_titre">';
480 $out .=
'<td>#</td>';
481 $out .=
'<td>'.$langs->trans(
"Filename").
'</td>';
482 $out .=
'<td class="center">'.$langs->trans(
"ExpectedChecksum").
'</td>';
483 $out .=
'<td class="center">'.$langs->trans(
"CurrentChecksum").
'</td>';
484 $out .=
'<td class="right">'.$langs->trans(
"Size").
'</td>';
485 $out .=
'<td class="right">'.$langs->trans(
"DateModification").
'</td>';
486 $out .=
'</tr>'.
"\n";
488 if (is_array($tmpfilelist3) && count($tmpfilelist3)) {
490 foreach ($tmpfilelist3 as $file) {
492 $out .=
'<tr class="oddeven">';
493 $out .=
'<td>'.$i.
'</td>'.
"\n";
494 $out .=
'<td>'.dol_escape_htmltag($file[
'filename']);
495 if (!preg_match(
'/^win/i', PHP_OS)) {
496 $htmltext = $langs->trans(
"YouCanDeleteFileOnServerWith",
'rm '.DOL_DOCUMENT_ROOT.$file[
'filename']);
497 $out .=
' '.$form->textwithpicto(
'', $htmltext, 1,
'help',
'', 0, 2,
'helprm'.$i);
499 $out .=
'</td>'.
"\n";
500 $out .=
'<td class="center">'.dol_escape_htmltag((
string) $file[
'expectedhash']).
'</td>'.
"\n";
501 $out .=
'<td class="center">'.dol_escape_htmltag($file[
'hash']).
'</td>'.
"\n";
502 $size =
dol_filesize(DOL_DOCUMENT_ROOT.
'/'.$file[
'filename']);
504 $out .=
'<td class="right">'.dol_print_size($size).
'</td>'.
"\n";
505 $out .=
'<td class="right nowraponall">'.dol_print_date(
dol_filemtime(DOL_DOCUMENT_ROOT.
'/'.$file[
'filename']),
'dayhour').
'</td>'.
"\n";
508 $out .=
'<tr class="liste_total">';
509 $out .=
'<td></td>'.
"\n";
510 $out .=
'<td>'.$langs->trans(
"Total").
'</td>'.
"\n";
511 $out .=
'<td class="center"></td>'.
"\n";
512 $out .=
'<td class="center"></td>'.
"\n";
513 $out .=
'<td class="right">'.dol_print_size($totalsize).
'</td>'.
"\n";
514 $out .=
'<td class="right"></td>'.
"\n";
517 $out .=
'<tr class="oddeven"><td colspan="6"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
523 print
'<div class="error">';
524 print
'Error: Failed to found <b>dolibarr_htdocs_dir</b> into content of XML file:<br>'.dol_escape_htmltag(
dol_trunc($xmlfile, 500));
540 asort($checksumconcat);
542 $checksumget = hash($algo, implode(
',', $checksumconcat));
544 if ($mode ==
'unalterable') {
545 $nameofsection =
'dolibarr_unalterable_files_checksum';
546 $checksumtoget = trim((
string) $xml->dolibarr_unalterable_files_checksum);
548 $nameofsection =
'dolibarr_htdocs_dir_checksum';
549 $checksumtoget = trim((
string) $xml->dolibarr_htdocs_dir_checksum);
554 $outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans(
"Unknown"));
555 $outcurrentchecksumtext =
'';
556 if ($checksumget == $checksumtoget) {
557 if (empty($onlymodifiedorremoved) && !empty($file_list[
'added'])) {
558 $resultcode =
'warning';
559 $resultcomment =
'FileIntegrityIsOkButFilesWereAdded';
560 $outcurrentchecksum = $checksumget;
561 $outcurrentchecksumtext .=
img_picto(
'',
'tick').
' <span class="'.$resultcode.
'">'.$langs->trans($resultcomment).
'</span>';
564 $resultcomment =
'Success';
565 $outcurrentchecksum =
'<span class="'.$resultcode.
'" title="Checksum of all current checksums concatenated separated by a comma">'.$checksumget.
'</span>';
566 $outcurrentchecksumtext.=
img_picto(
'',
'tick').
' <span class="badge badge-status4 badge-status '.$resultcode.
'">'.$langs->trans($resultcomment).
'</span>';
569 $resultcode =
'error';
570 $resultcomment =
'FileIntegrityIsKO';
571 $outcurrentchecksum =
'<span class="'.$resultcode.
'" title="Checksum of all current checksums concatenated separated by a comma">'.$checksumget.
'</span>';
572 $outcurrentchecksumtext .=
img_picto(
'',
'error').
' <span class="'.$resultcode.
'">'.$langs->trans($resultcomment).
'</span>';
576 if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3) && $resultcode ==
'ok') {
577 setEventMessages($langs->trans(
"FileIntegrityIsStrictlyConformedWithReference"),
null,
'mesgs');
579 if ($resultcode ==
'warning') {
582 setEventMessages($langs->trans(
"FileIntegritySomeFilesWereRemovedOrModified"),
null,
'errors');
586 $outforlistoffiles =
'';
587 if ($mode ==
'unalterable') {
591 $outforlistoffiles =
'<a href="#" onclick="console.log(\'Click\'); jQuery(\'#listofunalterablefiles\').toggle(); return false;">'.$langs->trans(
"ShowListOfFiles").
'</a><br>';
592 $outforlistoffiles .=
'<textarea id="listofunalterablefiles" class="hideobject quatrevingtpercent" rows="12">';
594 foreach ($listoffilestoanalyze as $dirtoanalyze) {
596 if (!empty($dirtoanalyze->md5file)) {
597 $entry = $dirtoanalyze->md5file;
599 } elseif (!empty($dirtoanalyze->sha256file)) {
600 $entry = $dirtoanalyze->sha256file;
604 foreach ($entry as $filetoanalyze) {
606 $outforlistoffiles .=
"\n";
608 $outforlistoffiles .= (string) $dirtoanalyze[
'name'];
609 $outforlistoffiles .=
'/';
610 $outforlistoffiles .= (string) $filetoanalyze[
'name'];
614 $outforlistoffiles .=
'</textarea>';
615 $outforlistoffiles .=
'<br>';
621 print
'<div class="div-table-responsive-no-min">';
622 print
'<table class="noborder">';
623 print
'<tr class="liste_titre">';
624 print
'<td>'.$langs->trans(
"ExpectedChecksum").
' <span class="opacitymedium">('.$algo.
')</span></td>';
625 print
'<td>'.$langs->trans(
"CurrentChecksum").
' <span class="opacitymedium">('.$algo.
')</span></td>';
629 print
'<span title="Checksum of all checksums in file separated by a comma and saved into '.$nameofsection.
'">';
630 print $outexpectedchecksum;
633 print $outcurrentchecksum;
637 print $outcurrentchecksumtext.
'<br>';
640 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.
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)
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())
Function to get a content from an URL (use proxy if proxy defined).
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.