Fix filecheck tool.
This commit is contained in:
parent
82052450a6
commit
374a6d7783
@ -75,9 +75,9 @@ $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';
|
||||||
$xmlshortfile = '/install/filelist-'.DOL_VERSION.'.xml';
|
$xmlshortfile = GETPOST('xmlshortfile')?GETPOST('xmlshortfile'):'/install/filelist-'.DOL_VERSION.'.xml';
|
||||||
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
|
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
|
||||||
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
$xmlremote = GETPOST('xmlremote')?GETPOST('xmlremote'):'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
||||||
|
|
||||||
|
|
||||||
// Test if remote test is ok
|
// Test if remote test is ok
|
||||||
@ -87,21 +87,27 @@ if (preg_match('/beta|alpha/i', DOL_VERSION)) $enableremotecheck=False;
|
|||||||
|
|
||||||
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
print $langs->trans("MakeIntegrityAnalysisFrom").':<br>';
|
||||||
|
print '<!-- for a local check target=local&xmlshortfile=... -->'."\n";
|
||||||
if (dol_is_file($xmlfile))
|
if (dol_is_file($xmlfile))
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
|
print '<input type="radio" name="target" value="local"'.((! GETPOST('target') || GETPOST('target') == 'local') ? 'checked="checked"':'').'"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.'<br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile.' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span><br>';
|
print '<input type="radio" name="target" value="local"> '.$langs->trans("LocalSignature").' = '.$xmlshortfile;
|
||||||
|
if (! GETPOST('xmlshortfile')) print ' <span class="warning">('.$langs->trans("AvailableOnlyOnPackagedVersions").')</span>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
print '<!-- for a remote target=remote&xmlremote=... -->'."\n";
|
||||||
if ($enableremotecheck)
|
if ($enableremotecheck)
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>';
|
print '<input type="radio" name="target" value="remote"'.(GETPOST('target') == 'remote' ? 'checked="checked"':'').'> '.$langs->trans("RemoteSignature").' = '.$xmlremote.'<br>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote.' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span><br>';
|
print '<input type="radio" name="target" value="remote" disabled="disabled"> '.$langs->trans("RemoteSignature").' = '.$xmlremote;
|
||||||
|
if (! GETPOST('xmlremote')) print ' <span class="warning">('.$langs->trans("FeatureAvailableOnlyOnStable").')</span>';
|
||||||
|
print '<br>';
|
||||||
}
|
}
|
||||||
print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
|
print '<br><div class="center"><input type="submit" name="check" class="button" value="'.$langs->trans("Check").'"></div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -128,7 +134,8 @@ if (GETPOST('target') == 'remote')
|
|||||||
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
||||||
{
|
{
|
||||||
$xmlfile = $xmlarray['content'];
|
$xmlfile = $xmlarray['content'];
|
||||||
$xml = simplexml_load_file($xmlfile);
|
//print "eee".$xmlfile."eee";
|
||||||
|
$xml = simplexml_load_string($xmlfile);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user