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