mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
unbound: general: include statistics toggle for general page migration
This commit is contained in:
parent
643cb5d157
commit
46cef8a72d
@ -108,5 +108,6 @@ class M1_0_6 extends BaseModelMigration
|
||||
{
|
||||
$config = Config::getInstance()->object();
|
||||
unset($config->unbound->acls);
|
||||
unset($config->unbound);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,6 +12,10 @@
|
||||
<default>53</default>
|
||||
<Required>Y</Required>
|
||||
</port>
|
||||
<stats type="BooleanField">
|
||||
<default>0</default>
|
||||
<Required>N</Required>
|
||||
</stats>
|
||||
<active_interface type=".\UnboundInterfaceField">
|
||||
<Required>N</Required>
|
||||
<Multiple>Y</Multiple>
|
||||
|
||||
@ -36,12 +36,12 @@ require_once("system.inc");
|
||||
require_once("plugins.inc.d/unbound.inc");
|
||||
|
||||
$rrdcfg = &config_read_array('rrd');
|
||||
$unboundcfg = &config_read_array('unbound');
|
||||
$unboundcfg = &config_read_array('OPNsense', 'unboundplus', 'general');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$pconfig = [];
|
||||
$pconfig['rrdenable'] = isset($rrdcfg['enable']);
|
||||
$pconfig['unboundenable'] = isset($unboundcfg['stats']);
|
||||
$pconfig['unboundenable'] = !empty($unboundcfg['stats']);
|
||||
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$pconfig = $_POST;
|
||||
$configure_unbound = false;
|
||||
@ -60,7 +60,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
configd_run('netflow aggregate repair', true);
|
||||
} elseif (!empty($pconfig['action']) && $pconfig['action'] == "SaveDNS") {
|
||||
$configure_unbound = true;
|
||||
$unboundcfg['stats'] = !empty($pconfig['unboundenable']);
|
||||
$unboundcfg['stats'] = !empty($pconfig['unboundenable']) ? '1' : '0';
|
||||
$savemsg = get_std_save_message();
|
||||
write_config();
|
||||
} elseif (!empty($pconfig['action']) && $pconfig['action'] == "ResetDNS") {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user