dolibarr 21.0.0-alpha
filecheck.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4 * Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
6 * Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
7 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
28// Load Dolibarr environment
29require '../../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
32
33$langs->load("admin");
34
35if (!$user->admin) {
37}
38
39$error = 0;
40
41
42/*
43 * View
44 */
45
46@set_time_limit(300);
47
48llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-system_filecheck');
49
50print load_fiche_titre($langs->trans("FileCheckDolibarr"), '', 'title_setup');
51
52print '<span class="opacitymedium">'.$langs->trans("FileCheckDesc").'</span><br><br>';
53
54// Version
55print '<div class="div-table-responsive-no-min">';
56print '<table class="noborder centpercent">';
57print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td></td></tr>'."\n";
58print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.getDolGlobalString('MAIN_VERSION_LAST_INSTALL').'</td></tr>'."\n";
59print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastUpgrade").'</td><td>'.getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'</td></tr>'."\n";
60print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionProgram").'</td><td>'.DOL_VERSION;
61// If current version differs from last upgrade
62if (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
63 // Compare version with last install database version (upgrades never occurred)
64 if (DOL_VERSION != getDolGlobalString('MAIN_VERSION_LAST_INSTALL')) {
65 print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_INSTALL')));
66 }
67} else {
68 // Compare version with last upgrade database version
69 if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) {
70 print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')));
71 }
72}
73print '</td></tr>'."\n";
74print '</table>';
75print '</div>';
76print '<br>';
77
78
79// Modified or missing files
80$file_list = array('missing' => array(), 'updated' => array());
81
82// Local file to compare to
83$xmlshortfile = dol_sanitizeFileName(GETPOST('xmlshortfile', 'alpha') ? GETPOST('xmlshortfile', 'alpha') : 'filelist-'.DOL_VERSION.getDolGlobalString('MAIN_FILECHECK_LOCAL_SUFFIX').'.xml'.getDolGlobalString('MAIN_FILECHECK_LOCAL_EXT'));
84
85$xmlfile = DOL_DOCUMENT_ROOT.'/install/'.$xmlshortfile;
86if (!preg_match('/\.zip$/i', $xmlfile) && dol_is_file($xmlfile.'.zip')) {
87 $xmlfile .= '.zip';
88}
89
90// Remote file to compare to
91$xmlremote = GETPOST('xmlremote', 'alphanohtml');
92if (empty($xmlremote) && getDolGlobalString('MAIN_FILECHECK_URL')) {
93 $xmlremote = getDolGlobalString('MAIN_FILECHECK_URL');
94}
95$param = 'MAIN_FILECHECK_URL_'.DOL_VERSION;
96if (empty($xmlremote) && getDolGlobalString($param)) {
97 $xmlremote = getDolGlobalString($param);
98}
99if (empty($xmlremote)) {
100 $xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
101}
102if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) {
103 $langs->load("errors");
104 setEventMessages($langs->trans("ErrorURLMustStartWithHttp", $xmlremote), null, 'errors');
105 $error++;
106} elseif ($xmlremote && !preg_match('/\.xml$/', $xmlremote)) {
107 $langs->load("errors");
108 setEventMessages($langs->trans("ErrorURLMustEndWith", $xmlremote, '.xml'), null, 'errors');
109 $error++;
110}
111
112// Test if remote test is ok
113$enableremotecheck = true;
114if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || getDolGlobalString('MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE')) {
115 $enableremotecheck = false;
116}
117$enableremotecheck = true;
118
119print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
120print '<input type="hidden" name="token" value="'.newToken().'">';
121print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
122
123print '<div class="divsection">';
124print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
125if (dol_is_file($xmlfile)) {
126 print '<input type="radio" name="target" id="checkboxlocal" value="local"'.((!GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"' : '').'"> <label for="checkboxlocal">'.$langs->trans("LocalSignature").'</label> = ';
127 print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
128 print '<br>';
129} else {
130 print '<input type="radio" name="target" id="checkboxlocal" value="local"> <label for="checkboxlocal">'.$langs->trans("LocalSignature").' = ';
131 print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'">';
132 print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span></label>';
133 print '<br>';
134}
135print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
136if ($enableremotecheck) {
137 print '<input type="radio" name="target" id="checkboxremote" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> <label for="checkboxremote">'.$langs->trans("RemoteSignature").'</label> = ';
138 print '<input name="xmlremote" class="flat minwidth500" value="'.dol_escape_htmltag($xmlremote).'"><br>';
139} else {
140 print '<input type="radio" name="target" id="checkboxremote" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.dol_escape_htmltag($xmlremote);
141 if (!GETPOST('xmlremote')) {
142 print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
143 }
144 print '<br>';
145}
146print '</div>';
147
148print '<div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
149print '</form>';
150print '<br>';
151print '<br>';
152
153if (GETPOST('target') == 'local') {
154 if (dol_is_file($xmlfile)) {
155 // If file is a zip file (.../filelist-x.y.z.xml.zip), we uncompress it before
156 if (preg_match('/\.zip$/i', $xmlfile)) {
157 dol_mkdir($conf->admin->dir_temp);
158 $xmlfilenew = preg_replace('/\.zip$/i', '', $xmlfile);
159 $result = dol_uncompress($xmlfile, $conf->admin->dir_temp);
160 if (empty($result['error'])) {
161 $xmlfile = $conf->admin->dir_temp.'/'.basename($xmlfilenew);
162 } else {
163 print $langs->trans('FailedToUncompressFile').': '.$xmlfile;
164 $error++;
165 }
166 }
167 $xml = simplexml_load_file($xmlfile);
168 if ($xml === false) {
169 print '<div class="warning">'.$langs->trans('XmlCorrupted').': '.$xmlfile.'</span>';
170 $error++;
171 }
172 } else {
173 print '<div class="warning">'.$langs->trans('XmlNotFound').': '.$xmlfile.'</span>';
174 $error++;
175 }
176}
177if (GETPOST('target') == 'remote') {
178 $xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into api_setup.class.php.
179
180 // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
181 if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
182 $xmlfile = $xmlarray['content'];
183 //print "xmlfilestart".$xmlfile."xmlfileend";
184 if (LIBXML_VERSION < 20900) {
185 // Avoid load of external entities (security problem).
186 // Required only if LIBXML_VERSION < 20900
187 // @phan-suppress-next-line PhanDeprecatedFunctionInternal
188 libxml_disable_entity_loader(true);
189 }
190
191 $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
192 } else {
193 $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
194 setEventMessages($errormsg, null, 'errors');
195 $error++;
196 }
197}
198
199
200if (empty($error) && !empty($xml)) {
201 $checksumconcat = array();
202 $file_list = array();
203 $out = '';
204
205 // Forced constants
206 if (is_object($xml->dolibarr_constants[0])) {
207 $out .= load_fiche_titre($langs->trans("ForcedConstants"));
208
209 $out .= '<div class="div-table-responsive-no-min">';
210 $out .= '<table class="noborder">';
211 $out .= '<tr class="liste_titre">';
212 $out .= '<td>#</td>';
213 $out .= '<td>'.$langs->trans("Constant").'</td>';
214 $out .= '<td class="center">'.$langs->trans("ExpectedValue").'</td>';
215 $out .= '<td class="center">'.$langs->trans("Value").'</td>';
216 $out .= '</tr>'."\n";
217
218 $i = 0;
219 foreach ($xml->dolibarr_constants[0]->constant as $constant) { // $constant is a simpleXMLElement
220 $constname = $constant['name'];
221 $constvalue = (string) $constant;
222 $constvalue = (empty($constvalue) ? '0' : $constvalue);
223 // Value found
224 $value = '';
225 if ($constname && getDolGlobalString($constname) != '') {
226 $value = getDolGlobalString($constname);
227 }
228 $valueforchecksum = (empty($value) ? '0' : $value);
229
230 $checksumconcat[] = $valueforchecksum;
231
232 $i++;
233 $out .= '<tr class="oddeven">';
234 $out .= '<td>'.$i.'</td>'."\n";
235 $out .= '<td>'.dol_escape_htmltag($constname).'</td>'."\n";
236 $out .= '<td class="center">'.dol_escape_htmltag($constvalue).'</td>'."\n";
237 $out .= '<td class="center">'.dol_escape_htmltag($valueforchecksum).'</td>'."\n";
238 $out .= "</tr>\n";
239 }
240
241 if ($i == 0) {
242 $out .= '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
243 }
244 $out .= '</table>';
245 $out .= '</div>';
246
247 $out .= '<br>';
248 }
249
250 // Scan htdocs
251 if (is_object($xml->dolibarr_htdocs_dir[0])) {
252 //var_dump($xml->dolibarr_htdocs_dir[0]['includecustom']);exit;
253 $includecustom = (empty($xml->dolibarr_htdocs_dir[0]['includecustom']) ? 0 : $xml->dolibarr_htdocs_dir[0]['includecustom']);
254
255 // Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php)
256 $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)$';
257 $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)$'; // Exclude dirs
258 $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
259
260 // Fill file_list with files in signature, new files, modified files
261 $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
262 // Complete with list of new files
263 foreach ($scanfiles as $keyfile => $valfile) {
264 $tmprelativefilename = preg_replace('/^'.preg_quote(DOL_DOCUMENT_ROOT, '/').'/', '', $valfile['fullname']);
265 if (!in_array($tmprelativefilename, $file_list['insignature'])) {
266 $md5newfile = @md5_file($valfile['fullname']); // Can fails if we don't have permission to open/read file
267 $file_list['added'][] = array('filename' => $tmprelativefilename, 'md5' => $md5newfile);
268 }
269 }
270
271 // Files missing
272 $out .= load_fiche_titre($langs->trans("FilesMissing"));
273
274 $out .= '<div class="div-table-responsive-no-min">';
275 $out .= '<table class="noborder">';
276 $out .= '<tr class="liste_titre">';
277 $out .= '<td>#</td>';
278 $out .= '<td>'.$langs->trans("Filename").'</td>';
279 $out .= '<td class="right">'.$langs->trans("ExpectedSize").'</td>';
280 $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
281 $out .= '</tr>'."\n";
282 $tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
283 if (is_array($tmpfilelist) && count($tmpfilelist)) {
284 $i = 0;
285 foreach ($tmpfilelist as $file) {
286 $i++;
287 $out .= '<tr class="oddeven">';
288 $out .= '<td>'.$i.'</td>'."\n";
289 $out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n";
290 $out .= '<td class="right">';
291 if (!empty($file['expectedsize'])) {
292 $out .= dol_print_size($file['expectedsize']);
293 }
294 $out .= '</td>'."\n";
295 $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
296 $out .= "</tr>\n";
297 }
298 } else {
299 $out .= '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
300 }
301 $out .= '</table>';
302 $out .= '</div>';
303
304 $out .= '<br>';
305
306 // Files modified
307 $out .= load_fiche_titre($langs->trans("FilesModified"));
308
309 $totalsize = 0;
310 $out .= '<div class="div-table-responsive-no-min">';
311 $out .= '<table class="noborder">';
312 $out .= '<tr class="liste_titre">';
313 $out .= '<td>#</td>';
314 $out .= '<td>'.$langs->trans("Filename").'</td>';
315 $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
316 $out .= '<td class="center">'.$langs->trans("CurrentChecksum").'</td>';
317 $out .= '<td class="right">'.$langs->trans("ExpectedSize").'</td>';
318 $out .= '<td class="right">'.$langs->trans("CurrentSize").'</td>';
319 $out .= '<td class="right">'.$langs->trans("DateModification").'</td>';
320 $out .= '</tr>'."\n";
321 $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
322 if (is_array($tmpfilelist2) && count($tmpfilelist2)) {
323 $i = 0;
324 foreach ($tmpfilelist2 as $file) {
325 $i++;
326 $out .= '<tr class="oddeven">';
327 $out .= '<td>'.$i.'</td>'."\n";
328 $out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n";
329 $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
330 $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n";
331 $out .= '<td class="right">';
332 if ($file['expectedsize']) {
333 $out .= dol_print_size($file['expectedsize']);
334 }
335 $out .= '</td>'."\n";
336 $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
337 $totalsize += $size;
338 $out .= '<td class="right">'.dol_print_size($size).'</td>'."\n";
339 $out .= '<td class="right">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']), 'dayhour').'</td>'."\n";
340 $out .= "</tr>\n";
341 }
342 $out .= '<tr class="liste_total">';
343 $out .= '<td></td>'."\n";
344 $out .= '<td>'.$langs->trans("Total").'</td>'."\n";
345 $out .= '<td class="center"></td>'."\n";
346 $out .= '<td class="center"></td>'."\n";
347 $out .= '<td class="center"></td>'."\n";
348 $out .= '<td class="right">'.dol_print_size($totalsize).'</td>'."\n";
349 $out .= '<td class="right"></td>'."\n";
350 $out .= "</tr>\n";
351 } else {
352 $out .= '<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
353 }
354 $out .= '</table>';
355 $out .= '</div>';
356
357 $out .= '<br>';
358
359 // Files added
360 $out .= load_fiche_titre($langs->trans("FilesAdded"));
361
362 $totalsize = 0;
363 $out .= '<div class="div-table-responsive-no-min">';
364 $out .= '<table class="noborder">';
365 $out .= '<tr class="liste_titre">';
366 $out .= '<td>#</td>';
367 $out .= '<td>'.$langs->trans("Filename").'</td>';
368 $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
369 $out .= '<td class="center">'.$langs->trans("CurrentChecksum").'</td>';
370 $out .= '<td class="right">'.$langs->trans("Size").'</td>';
371 $out .= '<td class="right">'.$langs->trans("DateModification").'</td>';
372 $out .= '</tr>'."\n";
373 $tmpfilelist3 = dol_sort_array($file_list['added'], 'filename');
374 if (is_array($tmpfilelist3) && count($tmpfilelist3)) {
375 $i = 0;
376 foreach ($tmpfilelist3 as $file) {
377 $i++;
378 $out .= '<tr class="oddeven">';
379 $out .= '<td>'.$i.'</td>'."\n";
380 $out .= '<td>'.dol_escape_htmltag($file['filename']);
381 if (!preg_match('/^win/i', PHP_OS)) {
382 $htmltext = $langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.$file['filename']); // The slash is included int file['filename']
383 $out .= ' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'.$i);
384 }
385 $out .= '</td>'."\n";
386 $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
387 $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n";
388 $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
389 $totalsize += $size;
390 $out .= '<td class="right">'.dol_print_size($size).'</td>'."\n";
391 $out .= '<td class="right nowraponall">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']), 'dayhour').'</td>'."\n";
392 $out .= "</tr>\n";
393 }
394 $out .= '<tr class="liste_total">';
395 $out .= '<td></td>'."\n";
396 $out .= '<td>'.$langs->trans("Total").'</td>'."\n";
397 $out .= '<td class="center"></td>'."\n";
398 $out .= '<td class="center"></td>'."\n";
399 $out .= '<td class="right">'.dol_print_size($totalsize).'</td>'."\n";
400 $out .= '<td class="right"></td>'."\n";
401 $out .= "</tr>\n";
402 } else {
403 $out .= '<tr class="oddeven"><td colspan="6"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
404 }
405 $out .= '</table>';
406 $out .= '</div>';
407 } else {
408 print '<div class="error">';
409 print 'Error: Failed to found <b>dolibarr_htdocs_dir</b> into content of XML file:<br>'.dol_escape_htmltag(dol_trunc($xmlfile, 500));
410 print '</div><br>';
411 $error++;
412 }
413
414
415 // Scan scripts
416 /*
417 if (is_object($xml->dolibarr_script_dir[0]))
418 {
419 $file_list = array();
420 $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
421 }*/
422
423
424 asort($checksumconcat); // Sort list of checksum
425 //var_dump($checksumconcat);
426 $checksumget = md5(implode(',', $checksumconcat));
427 $checksumtoget = trim((string) $xml->dolibarr_htdocs_dir_checksum);
428
429 //var_dump(count($file_list['added']));
430 //var_dump($checksumget);
431 //var_dump($checksumtoget);
432 //var_dump($checksumget == $checksumtoget);
433
434 $resultcomment = '';
435
436 $outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans("Unknown"));
437 if ($checksumget == $checksumtoget) {
438 if (is_array($file_list['added']) && count($file_list['added'])) {
439 $resultcode = 'warning';
440 $resultcomment = 'FileIntegrityIsOkButFilesWereAdded';
441 $outcurrentchecksum = $checksumget.' - <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>';
442 } else {
443 $resultcode = 'ok';
444 $resultcomment = 'Success';
445 $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
446 }
447 } else {
448 $resultcode = 'error';
449 $resultcomment = 'Error';
450 $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
451 }
452
453 // Show warning
454 if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3) && $resultcode == 'ok') {
455 setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
456 } else {
457 if ($resultcode == 'warning') {
458 setEventMessages($langs->trans($resultcomment), null, 'warnings');
459 } else {
460 setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'errors');
461 }
462 }
463
464 print load_fiche_titre($langs->trans("GlobalChecksum"));
465 print $langs->trans("ExpectedChecksum").' = '.$outexpectedchecksum.'<br>';
466 print $langs->trans("CurrentChecksum").' = '.$outcurrentchecksum;
467
468 print '<br>';
469 print '<br>';
470
471 // Output detail
472 print $out;
473}
474
475// End of page
476llxFooter();
477$db->close();
478
479exit($error);
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.
Definition wrapper.php:70
llxFooter()
Footer empty.
Definition document.php:107
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.
Definition files.lib.php:63
dol_print_size($size, $shortvalue=0, $shortunit=0)
Return string with formatted size.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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.
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)
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.