Skip to content
Snippets Groups Projects
Commit 586b2232 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Work on remote integrity checker

parent e92184a7
No related branches found
No related tags found
No related merge requests found
...@@ -42,6 +42,8 @@ llxHeader(); ...@@ -42,6 +42,8 @@ llxHeader();
print load_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup'); print load_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup');
print $langs->trans("FileCheckDesc").'<br><br>';
// Version // Version
$var = true; $var = true;
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
...@@ -72,11 +74,62 @@ $file_list = array('missing' => array(), 'updated' => array()); ...@@ -72,11 +74,62 @@ $file_list = array('missing' => array(), 'updated' => array());
// File to analyze // File to analyze
//$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml'; //$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist-'.DOL_VERSION.'.xml';
$xmlfile = DOL_DOCUMENT_ROOT.'/install/filelist.xml'; $xmlshortfile = '/install/filelist-'.DOL_VERSION.'.xml';
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
$enableremotecheck = False;
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
if (file_exists($xmlfile))
{
print '<input type="checkbox" name="local" checked> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
}
else
{
print '<input type="checkbox" name="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.' <span class="warning">('.$langs->trans("NotAvailable").')</span><br>';
}
if ($enableremotecheck)
{
print '<input type="checkbox" name="remote"> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>';
}
else
{
print '<input type="checkbox" name="remote" disabled> '.$langs->trans("RemoteSignature").' = '.$xmlremote.' <span class="warning">('.$langs->trans("FeatureNotYetAvailable").')</span><br>';
}
print '<input type="submit" name="check" class="button" value="'.$langs->trans("Check").'">';
print '</form>';
print '<br>';
if (GETPOST('local'))
{
if (file_exists($xmlfile)) if (file_exists($xmlfile))
{ {
$xml = simplexml_load_file($xmlfile); $xml = simplexml_load_file($xmlfile);
}
else
{
print $langs->trans('XmlNotFound') . ': ' . $xmlfile;
$error++;
}
}
if (GETPOST('remote'))
{
// TODO
//$xmlfile = ;
if (1 == 1)
{
//$xml = simplexml_load_file($xmlfile);
}
else
{
print $langs->trans('XmlNotFound') . ': ' . $xmlfile;
$error++;
}
}
if ($xml) if ($xml)
{ {
if (is_object($xml->dolibarr_htdocs_dir[0])) if (is_object($xml->dolibarr_htdocs_dir[0]))
...@@ -146,17 +199,9 @@ if (file_exists($xmlfile)) ...@@ -146,17 +199,9 @@ if (file_exists($xmlfile))
$error++; $error++;
} }
} }
else
{
print 'Error: Failed to parse XML for input file '.$xmlfile;
$error++;
}
}
else
{
print $langs->trans('XmlNotFound') . ': ' . $xmlfile;
$error++;
}
llxFooter(); llxFooter();
......
/filelist.xml /filelist*.xml
...@@ -9,6 +9,10 @@ VersionDevelopment=Development ...@@ -9,6 +9,10 @@ VersionDevelopment=Development
VersionUnknown=Unknown VersionUnknown=Unknown
VersionRecommanded=Recommended VersionRecommanded=Recommended
FileCheck=Files Integrity FileCheck=Files Integrity
FileCheckDesc=This tool allows you to check the integrity of files of your application, comparing each files with the official ones. You can use this tool to detect if some files were modified by a hacker for example.
MakeIntegrityAnalysisFrom=Make integrity analysis of application files from
LocalSignature=Embedded local signature (less reliable)
RemoteSignature=Remote distant signature (more reliable)
FilesMissing=Missing Files FilesMissing=Missing Files
FilesUpdated=Updated Files FilesUpdated=Updated Files
FileCheckDolibarr=Check Dolibarr Files Integrity FileCheckDolibarr=Check Dolibarr Files Integrity
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment