Commit 79aa798a authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) rework services_unbound_advanced.php

(cherry picked from commit 84d262f1)
parent 6cb2b73a
...@@ -71,57 +71,38 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -71,57 +71,38 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
} }
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
} if (!empty($_POST['apply'])) {
services_unbound_configure();
if ($_POST) {
if ($_POST['apply']) {
$retval = services_unbound_configure();
$savemsg = get_std_save_message();
if ($retval == 0)
clear_subsystem_dirty('unbound'); clear_subsystem_dirty('unbound');
header("Location: services_unbound_advanced.php");
exit;
} else { } else {
$pconfig = $_POST; $pconfig = $_POST;
$config['unbound']['hideidentity'] = !empty($pconfig['hideidentity']);
if (isset($_POST['hideidentity'])) $config['unbound']['hideversion'] = !empty($pconfig['hideversion']);
$config['unbound']['hideidentity'] = true; $config['unbound']['prefetch'] = !empty($pconfig['prefetch']);
else $config['unbound']['prefetchkey'] = !empty($pconfig['prefetchkey']);
unset($config['unbound']['hideidentity']); $config['unbound']['dnssecstripped'] = !empty($pconfig['dnssecstripped']);
if (isset($_POST['hideversion'])) $config['unbound']['msgcachesize'] = $pconfig['msgcachesize'];
$config['unbound']['hideversion'] = true; $config['unbound']['outgoing_num_tcp'] = $pconfig['outgoing_num_tcp'];
else $config['unbound']['incoming_num_tcp'] = $pconfig['incoming_num_tcp'];
unset($config['unbound']['hideversion']); $config['unbound']['edns_buffer_size'] = $pconfig['edns_buffer_size'];
if (isset($_POST['prefetch'])) $config['unbound']['num_queries_per_thread'] = $pconfig['num_queries_per_thread'];
$config['unbound']['prefetch'] = true; $config['unbound']['jostle_timeout'] = $pconfig['jostle_timeout'];
else $config['unbound']['cache_max_ttl'] = $pconfig['cache_max_ttl'];
unset($config['unbound']['prefetch']); $config['unbound']['cache_min_ttl'] = $pconfig['cache_min_ttl'];
if (isset($_POST['prefetchkey'])) $config['unbound']['infra_host_ttl'] = $pconfig['infra_host_ttl'];
$config['unbound']['prefetchkey'] = true; $config['unbound']['infra_cache_numhosts'] = $pconfig['infra_cache_numhosts'];
else $config['unbound']['unwanted_reply_threshold'] = $pconfig['unwanted_reply_threshold'];
unset($config['unbound']['prefetchkey']); $config['unbound']['log_verbosity'] = $pconfig['log_verbosity'];
if (isset($_POST['dnssecstripped']))
$config['unbound']['dnssecstripped'] = true;
else
unset($config['unbound']['dnssecstripped']);
$config['unbound']['msgcachesize'] = $_POST['msgcachesize'];
$config['unbound']['outgoing_num_tcp'] = $_POST['outgoing_num_tcp'];
$config['unbound']['incoming_num_tcp'] = $_POST['incoming_num_tcp'];
$config['unbound']['edns_buffer_size'] = $_POST['edns_buffer_size'];
$config['unbound']['num_queries_per_thread'] = $_POST['num_queries_per_thread'];
$config['unbound']['jostle_timeout'] = $_POST['jostle_timeout'];
$config['unbound']['cache_max_ttl'] = $_POST['cache_max_ttl'];
$config['unbound']['cache_min_ttl'] = $_POST['cache_min_ttl'];
$config['unbound']['infra_host_ttl'] = $_POST['infra_host_ttl'];
$config['unbound']['infra_cache_numhosts'] = $_POST['infra_cache_numhosts'];
$config['unbound']['unwanted_reply_threshold'] = $_POST['unwanted_reply_threshold'];
$config['unbound']['log_verbosity'] = $_POST['log_verbosity'];
write_config("DNS Resolver configured."); write_config("DNS Resolver configured.");
mark_subsystem_dirty('unbound'); mark_subsystem_dirty('unbound');
} }
} }
$service_hook = 'unbound';
$service_hook = 'unbound';
legacy_html_escape_form_data($pconfig);
include_once("head.inc"); include_once("head.inc");
?> ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment