mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
config: more related to previous
This commit is contained in:
parent
4594fa6dc6
commit
9779e7ac56
@ -153,12 +153,6 @@ function write_config($desc = '', $backup = true)
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($config['version'])) {
|
||||
// Examine config.xml, if for some strange reason the content is unexpected : exit directly.
|
||||
log_error('WARNING: Corrupt config!');
|
||||
return -1;
|
||||
}
|
||||
|
||||
plugins_interfaces();
|
||||
|
||||
$cnf = OPNsense\Core\Config::getInstance();
|
||||
|
||||
@ -105,13 +105,10 @@ function merge_config_attributes(&$cnf_source, &$cnf_dest)
|
||||
*/
|
||||
function firmware_version_xmlrpc()
|
||||
{
|
||||
global $config;
|
||||
|
||||
return array(
|
||||
'firmware' => array('version' => file_get_contents('/usr/local/opnsense/version/opnsense')),
|
||||
'kernel' => array('version' => file_get_contents('/usr/local/opnsense/version/kernel')),
|
||||
'base' => array('version' => file_get_contents('/usr/local/opnsense/version/base')),
|
||||
'config_version' => $config['version'],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -77,8 +77,6 @@ function get_vip_config_section()
|
||||
*/
|
||||
function carp_check_version($url, $username, $password, $method = 'opnsense.firmware_version')
|
||||
{
|
||||
global $config;
|
||||
|
||||
$client = new SimpleXMLRPC_Client($url,240);
|
||||
$client->setCredentials($username, $password);
|
||||
if ($client->query($method)) {
|
||||
@ -100,14 +98,7 @@ function carp_check_version($url, $username, $password, $method = 'opnsense.firm
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isset($remote_version['config_version']) ||
|
||||
$remote_version['config_version'] < $config['version']) {
|
||||
update_filter_reload_status("The other member is on older configuration version. Sync will not be done to prevent problems!");
|
||||
log_error("The other member is on older configuration version. Sync will not be done to prevent problems!");
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -284,7 +284,6 @@ $( document ).ready(function() {
|
||||
<tr>
|
||||
<th colspan="2"><?=gettext("Diff");?></th>
|
||||
<th><?=gettext("Date");?></th>
|
||||
<th><?=gettext("Version");?></th>
|
||||
<th><?=gettext("Size");?></th>
|
||||
<th><?=gettext("Configuration Change");?></th>
|
||||
<th> </th>
|
||||
@ -297,7 +296,6 @@ $( document ).ready(function() {
|
||||
<input type="radio" name="newtime" value="current" <?= !isset($newcheck) || $newcheck == 'current' ? 'checked="checked"' : '' ?>/>
|
||||
</td>
|
||||
<td> <?=date(gettext("n/j/y H:i:s"), $config['revision']['time']) ?></td>
|
||||
<td> <?=$config['version'] ?></td>
|
||||
<td> <?=format_bytes(filesize("/conf/config.xml")) ?></td>
|
||||
<td> <?="{$config['revision']['username']}: {$config['revision']['description']}" ?></td>
|
||||
<td><b><?=gettext("Current");?></b></td>
|
||||
@ -315,10 +313,9 @@ $( document ).ready(function() {
|
||||
<input type="radio" name="newtime" value="<?=$version['time'];?>" <?= isset($newcheck) && $newcheck == $version['time'] ? 'checked="checked"' : ''?>/>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td> <?= date(gettext("n/j/y H:i:s"), $version['time']) ?></td>
|
||||
<td> <?= $version['version'] ?></td>
|
||||
<td> <?= format_bytes($version['filesize']) ?></td>
|
||||
<td> <?= "{$version['username']}: {$version['description']}" ?></td>
|
||||
<td><?= date(gettext("n/j/y H:i:s"), $version['time']) ?></td>
|
||||
<td><?= format_bytes($version['filesize']) ?></td>
|
||||
<td><?= "{$version['username']}: {$version['description']}" ?></td>
|
||||
<td>
|
||||
<a data-id="<?=$version['time'];?>" href="#" class="act_revert btn btn-default btn-xs" data-toggle="tooltip" title="<?=gettext("Revert to this configuration");?>">
|
||||
<span class="glyphicon glyphicon-log-in"></span>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user