dolibarr 22.0.5
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-2025 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';
38require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
39require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
41
42
43$langs->load("admin");
44
45if (!$user->admin) {
47}
48
49$error = 0;
50
51
52/*
53 * View
54 */
55
56@set_time_limit(300);
57
58llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-system_filecheck');
59
60print load_fiche_titre($langs->trans("FileCheckDolibarr"), '', 'title_setup');
61
62print '<div class="opacitymedium justify">'.$langs->trans("FileCheckDesc").'</div><br><br>';
63
64// Version
65print '<div class="div-table-responsive-no-min">';
66print '<table class="noborder centpercent">';
67print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td></td></tr>'."\n";
68print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.getDolGlobalString('MAIN_VERSION_LAST_INSTALL').'</td></tr>'."\n";
69print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastUpgrade").'</td><td>'.getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'</td></tr>'."\n";
70print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionProgram").'</td><td>'.DOL_VERSION;
71// If current version differs from last upgrade
72if (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
73 // Compare version with last install database version (upgrades never occurred)
74 if (in_array(versioncompare(versiondolibarrarray(), preg_split('/[\-\.]/', getDolGlobalString('MAIN_VERSION_LAST_INSTALL'))), array(-2, -1, 1, 2))) {
75 print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_INSTALL')));
76 }
77} else {
78 // Compare version with last upgrade database version
79 if (in_array(versioncompare(versiondolibarrarray(), preg_split('/[\-\.]/', getDolGlobalString('MAIN_VERSION_LAST_UPGRADE'))), array(-2, -1, 1, 2))) {
80 print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')));
81 }
82}
83print '</td></tr>'."\n";
84print '</table>';
85print '</div>';
86print '<br>';
87
88
89// Modified or missing files
90$file_list = array('missing' => array(), 'updated' => array());
91
92// Local file to compare to
93$xmlshortfile = dol_sanitizeFileName(GETPOST('xmlshortfile', 'alpha') ? GETPOST('xmlshortfile', 'alpha') : 'filelist-'.DOL_VERSION.getDolGlobalString('MAIN_FILECHECK_LOCAL_SUFFIX').'.xml'.getDolGlobalString('MAIN_FILECHECK_LOCAL_EXT'));
94
95$xmlfile = DOL_DOCUMENT_ROOT.'/install/'.$xmlshortfile;
96if (!preg_match('/\.zip$/i', $xmlfile) && dol_is_file($xmlfile.'.zip')) {
97 $xmlfile .= '.zip';
98}
99
100// Remote file to compare to
101$xmlremote = GETPOST('xmlremote', 'alphanohtml');
102if (empty($xmlremote) && getDolGlobalString('MAIN_FILECHECK_URL')) {
103 $xmlremote = getDolGlobalString('MAIN_FILECHECK_URL');
104}
105$param = 'MAIN_FILECHECK_URL_'.DOL_VERSION;
106if (empty($xmlremote) && getDolGlobalString($param)) {
107 $xmlremote = getDolGlobalString($param);
108}
109if (empty($xmlremote)) {
110 $xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
111}
112if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) {
113 $langs->load("errors");
114 setEventMessages($langs->trans("ErrorURLMustStartWithHttp", $xmlremote), null, 'errors');
115 $error++;
116} elseif ($xmlremote && !preg_match('/\.xml$/', $xmlremote)) {
117 $langs->load("errors");
118 setEventMessages($langs->trans("ErrorURLMustEndWith", $xmlremote, '.xml'), null, 'errors');
119 $error++;
120}
121
122// Test if remote test is ok
123$enableremotecheck = true;
124if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || getDolGlobalString('MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE')) {
125 $enableremotecheck = false;
126}
127$enableremotecheck = true;
128
129print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
130print '<input type="hidden" name="token" value="'.newToken().'">';
131print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
132
133print '<div class="divsection">';
134print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
135if (dol_is_file($xmlfile)) {
136 print '<input type="radio" name="target" id="checkboxlocal" value="local"'.((!GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"' : '').'"> <label for="checkboxlocal">'.$langs->trans("LocalSignature").'</label> = ';
137 print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'" spellcheck="false">';
138 print '<br>';
139} else {
140 print '<input type="radio" name="target" id="checkboxlocal" value="local"> <label for="checkboxlocal">'.$langs->trans("LocalSignature").' = ';
141 print '<input name="xmlshortfile" class="flat minwidth400" value="'.dol_escape_htmltag($xmlshortfile).'" spellcheck="false">';
142 print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span></label>';
143 print '<br>';
144}
145
146print '<br>';
147
148print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
149if ($enableremotecheck) {
150 print '<input type="radio" name="target" id="checkboxremote" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"' : '').'> <label for="checkboxremote">'.$langs->trans("RemoteSignature").'</label> = ';
151 print '<input name="xmlremote" class="flat minwidth500" value="'.dol_escape_htmltag($xmlremote).'" spellcheck="false"><br>';
152} else {
153 print '<input type="radio" name="target" id="checkboxremote" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.dol_escape_htmltag($xmlremote);
154 if (!GETPOST('xmlremote')) {
155 print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
156 }
157 print '<br>';
158}
159print '</div>';
160
161print '<div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
162print '</form>';
163print '<br>';
164print '<br>';
165
166if (GETPOST('target') == 'local') {
167 if (dol_is_file($xmlfile)) {
168 // If file is a zip file (.../filelist-x.y.z.xml.zip), we uncompress it before
169 if (preg_match('/\.zip$/i', $xmlfile)) {
170 dol_mkdir($conf->admin->dir_temp);
171 $xmlfilenew = preg_replace('/\.zip$/i', '', $xmlfile);
172 $result = dol_uncompress($xmlfile, $conf->admin->dir_temp);
173 if (empty($result['error'])) {
174 $xmlfile = $conf->admin->dir_temp.'/'.basename($xmlfilenew);
175 } else {
176 print $langs->trans('FailedToUncompressFile').': '.$xmlfile;
177 $error++;
178 }
179 }
180 $xml = simplexml_load_file($xmlfile);
181 if ($xml === false) {
182 print '<div class="warning">'.$langs->trans('XmlCorrupted').': '.$xmlfile.'</span>';
183 $error++;
184 }
185 } else {
186 print '<div class="warning">'.$langs->trans('XmlNotFound').': '.$xmlfile.'</span>';
187 $error++;
188 }
189}
190if (GETPOST('target') == 'remote') {
191 $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.
192
193 // Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
194 if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != 400 && $xmlarray['http_code'] != 404) {
195 $xmlfile = $xmlarray['content'];
196 //print "xmlfilestart".$xmlfile."xmlfileend";
197 if (LIBXML_VERSION < 20900) {
198 // Avoid load of external entities (security problem).
199 // Required only if LIBXML_VERSION < 20900
200 // @phan-suppress-next-line PhanDeprecatedFunctionInternal
201 libxml_disable_entity_loader(true);
202 }
203
204 $xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
205 } else {
206 $errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
207 setEventMessages($errormsg, null, 'errors');
208 $error++;
209 }
210}
211
212
213if (empty($error) && !empty($xml)) {
214 $checksumconcat = array();
215 $file_list = array();
216 $out = '';
217
218 // Forced constants
219 if (is_object($xml->dolibarr_constants[0])) {
220 $out .= load_fiche_titre($langs->trans("ForcedConstants"));
221
222 $out .= '<div class="div-table-responsive-no-min">';
223 $out .= '<table class="noborder">';
224 $out .= '<tr class="liste_titre">';
225 $out .= '<td>#</td>';
226 $out .= '<td>'.$langs->trans("Constant").'</td>';
227 $out .= '<td class="center">'.$langs->trans("ExpectedValue").'</td>';
228 $out .= '<td class="center">'.$langs->trans("Value").'</td>';
229 $out .= '</tr>'."\n";
230
231 $i = 0;
232 foreach ($xml->dolibarr_constants[0]->constant as $constant) { // $constant is a simpleXMLElement
233 $constname = $constant['name'];
234 $constvalue = (string) $constant;
235 $constvalue = (empty($constvalue) ? '0' : $constvalue);
236 // Value found
237 $value = '';
238 if ($constname && getDolGlobalString($constname) != '') {
239 $value = getDolGlobalString($constname);
240 }
241 $valueforchecksum = (empty($value) ? '0' : $value);
242
243 $checksumconcat[] = $valueforchecksum;
244
245 $i++;
246 $out .= '<tr class="oddeven">';
247 $out .= '<td>'.$i.'</td>'."\n";
248 $out .= '<td>'.dol_escape_htmltag($constname).'</td>'."\n";
249 $out .= '<td class="center">'.dol_escape_htmltag($constvalue).'</td>'."\n";
250 $out .= '<td class="center">'.dol_escape_htmltag($valueforchecksum).'</td>'."\n";
251 $out .= "</tr>\n";
252 }
253
254 if ($i == 0) {
255 $out .= '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
256 }
257 $out .= '</table>';
258 $out .= '</div>';
259
260 $out .= '<br>';
261 }
262
263 // Scan htdocs
264 if (is_object($xml->dolibarr_htdocs_dir[0])) {
265 //var_dump($xml->dolibarr_htdocs_dir[0]['includecustom']);exit;
266 $includecustom = (empty($xml->dolibarr_htdocs_dir[0]['includecustom']) ? 0 : $xml->dolibarr_htdocs_dir[0]['includecustom']);
267
268 // Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php)
269 $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)$';
270 $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
271 $scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
272
273 // Fill file_list with files in signature, new files, modified files
274 $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
275 '@phan-var-force array{insignature:string[],missing?:array<array{filename:string,expectedmd5:string,expectedsize:string}>,updated:array<array{filename:string,expectedmd5:string,expectedsize:string,md5:string}>} $file_list';
276 // Complete with list of new files
277 foreach ($scanfiles as $keyfile => $valfile) {
278 $tmprelativefilename = preg_replace('/^'.preg_quote(DOL_DOCUMENT_ROOT, '/').'/', '', $valfile['fullname']);
279 if (!in_array($tmprelativefilename, $file_list['insignature'])) {
280 $md5newfile = @md5_file($valfile['fullname']); // Can fails if we don't have permission to open/read file
281 $file_list['added'][] = array('filename' => $tmprelativefilename, 'md5' => $md5newfile);
282 }
283 }
284
285 // Files missing
286 $out .= load_fiche_titre($langs->trans("FilesMissing"));
287
288 $out .= '<div class="div-table-responsive-no-min">';
289 $out .= '<table class="noborder">';
290 $out .= '<tr class="liste_titre">';
291 $out .= '<td>#</td>';
292 $out .= '<td>'.$langs->trans("Filename").'</td>';
293 $out .= '<td class="right">'.$langs->trans("ExpectedSize").'</td>';
294 $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
295 $out .= '</tr>'."\n";
296 $tmpfilelist = dol_sort_array($file_list['missing'], 'filename');
297 if (is_array($tmpfilelist) && count($tmpfilelist)) {
298 $i = 0;
299 foreach ($tmpfilelist as $file) {
300 $i++;
301 $out .= '<tr class="oddeven">';
302 $out .= '<td>'.$i.'</td>'."\n";
303 $out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n";
304 $out .= '<td class="right">';
305 if (!empty($file['expectedsize'])) {
306 $out .= dol_print_size((int) $file['expectedsize']);
307 }
308 $out .= '</td>'."\n";
309 $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
310 $out .= "</tr>\n";
311 }
312 } else {
313 $out .= '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
314 }
315 $out .= '</table>';
316 $out .= '</div>';
317
318 $out .= '<br>';
319
320 // Files modified
321 $out .= load_fiche_titre($langs->trans("FilesModified"));
322
323 $totalsize = 0;
324 $out .= '<div class="div-table-responsive-no-min">';
325 $out .= '<table class="noborder">';
326 $out .= '<tr class="liste_titre">';
327 $out .= '<td>#</td>';
328 $out .= '<td>'.$langs->trans("Filename").'</td>';
329 $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
330 $out .= '<td class="center">'.$langs->trans("CurrentChecksum").'</td>';
331 $out .= '<td class="right">'.$langs->trans("ExpectedSize").'</td>';
332 $out .= '<td class="right">'.$langs->trans("CurrentSize").'</td>';
333 $out .= '<td class="right">'.$langs->trans("DateModification").'</td>';
334 $out .= '</tr>'."\n";
335 $tmpfilelist2 = dol_sort_array($file_list['updated'], 'filename');
336 if (is_array($tmpfilelist2) && count($tmpfilelist2)) {
337 $i = 0;
338 foreach ($tmpfilelist2 as $file) {
339 $i++;
340 $out .= '<tr class="oddeven">';
341 $out .= '<td>'.$i.'</td>'."\n";
342 $out .= '<td>'.dol_escape_htmltag($file['filename']).'</td>'."\n";
343 $out .= '<td class="center">'.dol_escape_htmltag($file['expectedmd5']).'</td>'."\n";
344 $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n";
345 $out .= '<td class="right">';
346 if ($file['expectedsize']) {
347 $out .= dol_print_size((int) $file['expectedsize']);
348 }
349 $out .= '</td>'."\n";
350 $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
351 $totalsize += $size;
352 $out .= '<td class="right">'.dol_print_size($size).'</td>'."\n";
353 $out .= '<td class="right">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']), 'dayhour').'</td>'."\n";
354 $out .= "</tr>\n";
355 }
356 $out .= '<tr class="liste_total">';
357 $out .= '<td></td>'."\n";
358 $out .= '<td>'.$langs->trans("Total").'</td>'."\n";
359 $out .= '<td class="center"></td>'."\n";
360 $out .= '<td class="center"></td>'."\n";
361 $out .= '<td class="center"></td>'."\n";
362 $out .= '<td class="right">'.dol_print_size($totalsize).'</td>'."\n";
363 $out .= '<td class="right"></td>'."\n";
364 $out .= "</tr>\n";
365 } else {
366 $out .= '<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
367 }
368 $out .= '</table>';
369 $out .= '</div>';
370
371 $out .= '<br>';
372
373 // Files added
374 $out .= load_fiche_titre($langs->trans("FilesAdded"));
375
376 $totalsize = 0;
377 $out .= '<div class="div-table-responsive-no-min">';
378 $out .= '<table class="noborder">';
379 $out .= '<tr class="liste_titre">';
380 $out .= '<td>#</td>';
381 $out .= '<td>'.$langs->trans("Filename").'</td>';
382 $out .= '<td class="center">'.$langs->trans("ExpectedChecksum").'</td>';
383 $out .= '<td class="center">'.$langs->trans("CurrentChecksum").'</td>';
384 $out .= '<td class="right">'.$langs->trans("Size").'</td>';
385 $out .= '<td class="right">'.$langs->trans("DateModification").'</td>';
386 $out .= '</tr>'."\n";
387 $tmpfilelist3 = dol_sort_array($file_list['added'], 'filename');
388 if (is_array($tmpfilelist3) && count($tmpfilelist3)) {
389 $i = 0;
390 foreach ($tmpfilelist3 as $file) {
391 $i++;
392 $out .= '<tr class="oddeven">';
393 $out .= '<td>'.$i.'</td>'."\n";
394 $out .= '<td>'.dol_escape_htmltag($file['filename']);
395 if (!preg_match('/^win/i', PHP_OS)) {
396 $htmltext = $langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.$file['filename']); // The slash is included int file['filename']
397 $out .= ' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm'.$i);
398 }
399 $out .= '</td>'."\n";
400 $out .= '<td class="center">'.dol_escape_htmltag((string) $file['expectedmd5']).'</td>'."\n"; // @phan-suppress-current-line PhanTypeInvalidDimOffset
401 $out .= '<td class="center">'.dol_escape_htmltag($file['md5']).'</td>'."\n";
402 $size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
403 $totalsize += $size;
404 $out .= '<td class="right">'.dol_print_size($size).'</td>'."\n";
405 $out .= '<td class="right nowraponall">'.dol_print_date(dol_filemtime(DOL_DOCUMENT_ROOT.'/'.$file['filename']), 'dayhour').'</td>'."\n";
406 $out .= "</tr>\n";
407 }
408 $out .= '<tr class="liste_total">';
409 $out .= '<td></td>'."\n";
410 $out .= '<td>'.$langs->trans("Total").'</td>'."\n";
411 $out .= '<td class="center"></td>'."\n";
412 $out .= '<td class="center"></td>'."\n";
413 $out .= '<td class="right">'.dol_print_size($totalsize).'</td>'."\n";
414 $out .= '<td class="right"></td>'."\n";
415 $out .= "</tr>\n";
416 } else {
417 $out .= '<tr class="oddeven"><td colspan="6"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
418 }
419 $out .= '</table>';
420 $out .= '</div>';
421 } else {
422 print '<div class="error">';
423 print 'Error: Failed to found <b>dolibarr_htdocs_dir</b> into content of XML file:<br>'.dol_escape_htmltag(dol_trunc($xmlfile, 500));
424 print '</div><br>';
425 $error++;
426 }
427
428
429 // Scan scripts
430 /*
431 if (is_object($xml->dolibarr_script_dir[0]))
432 {
433 $file_list = array();
434 $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
435 '@phan-var-force array{insignature:string[],missing?:array<array{filename:string,expectedmd5:string,expectedsize:string}>,updated:array<array{filename:string,expectedmd5:string,expectedsize:string,md5:string}>} $file_list';
436 }*/
437
438
439 asort($checksumconcat); // Sort list of checksum
440 //var_dump($checksumconcat);
441 $checksumget = md5(implode(',', $checksumconcat));
442 $checksumtoget = trim((string) $xml->dolibarr_htdocs_dir_checksum);
443
444 //var_dump(count($file_list['added']));
445 //var_dump($checksumget);
446 //var_dump($checksumtoget);
447 //var_dump($checksumget == $checksumtoget);
448
449 $resultcomment = '';
450
451 $outexpectedchecksum = ($checksumtoget ? $checksumtoget : $langs->trans("Unknown"));
452 if ($checksumget == $checksumtoget) {
453 if (is_array($file_list['added']) && count($file_list['added'])) {
454 $resultcode = 'warning';
455 $resultcomment = 'FileIntegrityIsOkButFilesWereAdded';
456 $outcurrentchecksum = $checksumget.' - <span class="'.$resultcode.'">'.$langs->trans($resultcomment).'</span>';
457 } else {
458 $resultcode = 'ok';
459 $resultcomment = 'Success';
460 $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
461 }
462 } else {
463 $resultcode = 'error';
464 $resultcomment = 'Error';
465 $outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
466 }
467
468 // Show warning
469 if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3) && $resultcode == 'ok') {
470 setEventMessages($langs->trans("FileIntegrityIsStrictlyConformedWithReference"), null, 'mesgs');
471 } else {
472 if ($resultcode == 'warning') {
473 setEventMessages($langs->trans($resultcomment), null, 'warnings');
474 } else {
475 setEventMessages($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), null, 'errors');
476 }
477 }
478
479 print load_fiche_titre($langs->trans("GlobalChecksum"));
480 print $langs->trans("ExpectedChecksum").' = '.$outexpectedchecksum.'<br>';
481 print $langs->trans("CurrentChecksum").' = '.$outcurrentchecksum;
482
483 print '<br>';
484 print '<br>';
485
486 // Output detail
487 print $out;
488}
489
490// End of page
491llxFooter();
492$db->close();
493
494exit($error);
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,...
Definition admin.lib.php:71
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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:73
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_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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0)
Clean a string to use it as a file name.
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, $timeoutconnect=0, $timeoutresponse=0)
Function to get a content from an URL (use proxy if proxy defined).
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.