summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/local/www')
-rw-r--r--src/usr/local/www/diag_dns.php1
-rw-r--r--src/usr/local/www/firewall_aliases_edit.php34
-rw-r--r--src/usr/local/www/firewall_nat_edit.php15
-rw-r--r--src/usr/local/www/firewall_nat_out_edit.php12
-rw-r--r--src/usr/local/www/firewall_rules_edit.php40
-rw-r--r--src/usr/local/www/guiconfig.inc14
-rwxr-xr-xsrc/usr/local/www/interfaces.php5
-rw-r--r--src/usr/local/www/pkg.php20
-rw-r--r--src/usr/local/www/pkg_edit.php18
-rw-r--r--src/usr/local/www/services_checkip.php7
-rw-r--r--src/usr/local/www/services_unbound.php21
-rw-r--r--src/usr/local/www/services_unbound_domainoverride_edit.php17
-rw-r--r--src/usr/local/www/services_unbound_host_edit.php27
-rw-r--r--src/usr/local/www/status_logs_settings.php2
-rw-r--r--src/usr/local/www/system.php5
-rw-r--r--src/usr/local/www/system_advanced_firewall.php2
-rw-r--r--src/usr/local/www/system_certmanager.php156
-rw-r--r--src/usr/local/www/system_routes.php2
-rw-r--r--src/usr/local/www/system_routes_edit.php2
-rw-r--r--src/usr/local/www/system_update_settings.php2
-rw-r--r--src/usr/local/www/system_user_settings.php8
-rw-r--r--src/usr/local/www/system_usermanager.php8
-rw-r--r--src/usr/local/www/vpn_ipsec.php6
-rw-r--r--src/usr/local/www/vpn_ipsec_mobile.php2
-rw-r--r--src/usr/local/www/vpn_ipsec_phase1.php2
-rw-r--r--src/usr/local/www/vpn_ipsec_phase2.php2
-rw-r--r--src/usr/local/www/vpn_ipsec_settings.php2
-rw-r--r--src/usr/local/www/widgets/widgets/gateways.widget.php4
-rw-r--r--src/usr/local/www/widgets/widgets/gmirror_status.widget.php3
-rw-r--r--src/usr/local/www/widgets/widgets/interfaces.widget.php40
-rw-r--r--src/usr/local/www/wizard.php2
-rw-r--r--src/usr/local/www/wizards/openvpn_wizard.inc6
-rw-r--r--src/usr/local/www/wizards/setup_wizard.xml6
-rw-r--r--src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc6
-rw-r--r--src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc5
35 files changed, 416 insertions, 88 deletions
diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php
index de1b8bb..e66fe2f 100644
--- a/src/usr/local/www/diag_dns.php
+++ b/src/usr/local/www/diag_dns.php
@@ -117,6 +117,7 @@ if (isset($_POST['create_alias']) && (is_hostname($host) || is_ipaddr($host))) {
} else {
$a_aliases[] = $newalias;
}
+ write_config(gettext("Created an alias from Diagnostics - DNS Lookup page."));
write_config();
$createdalias = true;
}
diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php
index fc4b8b0..4761d9f 100644
--- a/src/usr/local/www/firewall_aliases_edit.php
+++ b/src/usr/local/www/firewall_aliases_edit.php
@@ -611,6 +611,26 @@ $pattern_str = array(
'urltable_ports' => '.*' // Alias Name or URL
);
+$title_str = array(
+ 'network' => 'An IPv4 network address like 1.2.3.0, an IPv6 network address like 1:2a:3b:ffff::0, IP address range, FQDN or an alias',
+ 'host' => 'An IPv4 address like 1.2.3.4, an IPv6 address like 1:2a:3b:ffff::1, IP address range, FQDN or an alias',
+ 'port' => 'A port number, port number range or an alias',
+ 'url' => 'URL',
+ 'url_ports' => 'URL',
+ 'urltable' => 'URL',
+ 'urltable_ports' => 'URL'
+);
+
+$placeholder_str = array(
+ 'network' => 'Address',
+ 'host' => 'Address',
+ 'port' => 'Port',
+ 'url' => 'URL',
+ 'url_ports' => 'URL',
+ 'urltable' => 'URL',
+ 'urltable_ports' => 'URL'
+);
+
$types = array(
'host' => gettext("Host(s)"),
'network' => gettext("Network(s)"),
@@ -715,7 +735,7 @@ while ($counter < count($addresses)) {
$group->add(new Form_IpAddress(
'address' . $counter,
- $tab == 'port' ? 'Port':'Address',
+ 'Address',
$address,
'ALIASV4V6'
))->addMask('address_subnet' . $counter, $address_subnet)->setWidth(4)->setPattern($pattern_str[$tab]);
@@ -787,9 +807,15 @@ events.push(function() {
// Set the input field pattern by tab type
var patternstr = <?=json_encode($pattern_str);?>;
- for (i = 0; i < <?=$counter;?>; i++) {
- $('#address' + i).prop('pattern', patternstr[tab]);
- }
+ var titlestr = <?=json_encode($title_str);?>;
+ var placeholderstr = <?=json_encode($placeholder_str);?>;
+ $("[id^='address']").each(function () {
+ if (/^address[0-9]+$/.test(this.id)) {
+ $('#' + this.id).prop('pattern', patternstr[tab]);
+ $('#' + this.id).prop('title', titlestr[tab]);
+ $('#' + this.id).prop('placeholder', placeholderstr[tab]);
+ }
+ });
// Hide and disable rows other than the first
hideRowsAfter(1, (tab == 'urltable') || (tab == 'urltable_ports'));
diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php
index 96869b5..83440ba 100644
--- a/src/usr/local/www/firewall_nat_edit.php
+++ b/src/usr/local/www/firewall_nat_edit.php
@@ -584,14 +584,16 @@ function build_dsttype_list() {
$list[$ifent . 'ip'] = $ifdesc . ' address';
}
}
-
+
+ //Temporary array so we can sort IPs
+ $templist = array();
if (is_array($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $sn) {
if (is_ipaddrv6($sn['subnet'])) {
continue;
}
if (($sn['mode'] == "proxyarp" || $sn['mode'] == "other") && $sn['type'] == "network") {
- $list[$sn['subnet'] . '/' . $sn['subnet_bits']] = 'Subnet: ' . $sn['subnet'] . '/' . $sn['subnet_bits'] . ' (' . $sn['descr'] . ')';
+ $templist[$sn['subnet'] . '/' . $sn['subnet_bits']] = 'Subnet: ' . $sn['subnet'] . '/' . $sn['subnet_bits'] . ' (' . $sn['descr'] . ')';
if (isset($sn['noexpand'])) {
continue;
}
@@ -602,13 +604,18 @@ function build_dsttype_list() {
for ($i = 0; $i <= $len; $i++) {
$snip = long2ip32($start+$i);
- $list[$snip] = $snip . ' (' . $sn['descr'] . ')';
+ $templist[$snip] = $snip . ' (' . $sn['descr'] . ')';
}
} else {
- $list[$sn['subnet']] = $sn['subnet'] . ' (' . $sn['descr'] . ')';
+ $templist[$sn['subnet']] = $sn['subnet'] . ' (' . $sn['descr'] . ')';
}
}
}
+
+ //Sort temp IP array and append onto main array
+ asort($templist);
+ $list = array_merge($list, $templist);
+ unset($templist);
return($list);
}
diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php
index 92f9060..721eb9e 100644
--- a/src/usr/local/www/firewall_nat_out_edit.php
+++ b/src/usr/local/www/firewall_nat_out_edit.php
@@ -406,10 +406,12 @@ function build_target_list() {
$list[""] = gettext('Interface Address');
+ //Temporary array so we can sort IPs
+ $templist = array();
if (is_array($config['virtualip']['vip'])) {
foreach ($config['virtualip']['vip'] as $sn) {
if (($sn['mode'] == "proxyarp" || $sn['mode'] == "other") && $sn['type'] == "network") {
- $list['S' . $sn['subnet'] . '/' . $sn['subnet_bits']] = gettext('Subnet: ') . $sn['subnet'] . '/' . $sn['subnet_bits'] . ' (' . $sn['descr'] . ')';
+ $templist['S' . $sn['subnet'] . '/' . $sn['subnet_bits']] = gettext('Subnet: ') . $sn['subnet'] . '/' . $sn['subnet_bits'] . ' (' . $sn['descr'] . ')';
if (isset($sn['noexpand'])) {
continue;
}
@@ -419,13 +421,17 @@ function build_target_list() {
for ($i = 0; $i <= $len; $i++) {
$snip = long2ip32($start+$i);
- $list['I' . $snip] = $snip . ' (' . $sn['descr'] . ')';
+ $templist['I' . $snip] = $snip . ' (' . $sn['descr'] . ')';
}
} else {
- $list['I' . $sn['subnet']] = $sn['subnet'] . ' (' . $sn['descr'] . ')';
+ $templist['I' . $sn['subnet']] = $sn['subnet'] . ' (' . $sn['descr'] . ')';
}
}
}
+ asort($templist);
+ //Append sorted IP array onto main array
+ $list = array_merge($list, $templist);
+ unset($templist);
foreach ($a_aliases as $alias) {
if ($alias['type'] != "host") {
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index 171cab6..1c11768 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -295,6 +295,7 @@ if (isset($id) && $a_filter[$id]) {
if ($_REQUEST['if']) {
$pconfig['interface'] = $_REQUEST['if'];
}
+ $pconfig['ipprotocol'] = "inet"; // other things depend on this, set a sensible default
$pconfig['type'] = "pass";
$pconfig['proto'] = "tcp"; // for new blank rules, default=tcp, also ensures ports fields are visible
$pconfig['src'] = "any";
@@ -319,6 +320,19 @@ if ($_POST['save']) {
if (!array_key_exists($_POST['ipprotocol'], $icmplookup)) {
$input_errors[] = gettext("The IP protocol is not recognized.");
+ unset($_POST['ipprotocol']);
+ }
+
+ // add validation + input error for $_POST['interface']
+
+ $valid = ($_POST['interface'] == "FloatingRules" || isset($_POST['floating'])) ? ['pass','block','reject', 'match'] : ['pass','block','reject'];
+ if (!(is_string($_POST['type']) && in_array($_POST['type'], $valid))) {
+ $input_errors[] = gettext("A valid rule type is not selected.");
+ unset($_POST['type']);
+ }
+
+ if (isset($_POST['tracker']) && !is_numericint($_POST['tracker'])) {
+ unset($_POST['tracker']); // silently unset hidden input if invalid
}
if (isset($a_filter[$id]['associated-rule-id'])) {
@@ -328,7 +342,7 @@ if ($_POST['save']) {
}
}
- if (($_POST['ipprotocol'] <> "") && ($_POST['gateway'] <> "")) {
+ if (isset($_POST['ipprotocol']) && $_POST['gateway'] <> '') {
if (is_array($config['gateways']['gateway_group'])) {
foreach ($config['gateways']['gateway_group'] as $gw_group) {
if ($gw_group['name'] == $_POST['gateway'] && $_POST['ipprotocol'] != $a_gatewaygroups[$_POST['gateway']]['ipprotocol']) {
@@ -423,6 +437,11 @@ if ($_POST['save']) {
$pconfig = $_POST;
+ if (!isset($pconfig['ipprotocol'])) {
+ // other things depend on this, so ensure a valid value if none provided
+ $pconfig['ipprotocol'] = "inet";
+ }
+
if (($_POST['proto'] == "icmp") && count($_POST['icmptype'])) {
$pconfig['icmptype'] = implode(',', $_POST['icmptype']);
} else {
@@ -554,14 +573,14 @@ if ($_POST['save']) {
}
}
if ((is_ipaddrv6($_POST['src']) || is_ipaddrv6($_POST['dst'])) && ($_POST['ipprotocol'] == "inet")) {
- $input_errors[] = gettext("IPv6 addresses cannot be used in IPv4 rules.");
+ $input_errors[] = gettext("IPv6 addresses cannot be used in IPv4 rules (except within an alias).");
}
if ((is_ipaddrv4($_POST['src']) || is_ipaddrv4($_POST['dst'])) && ($_POST['ipprotocol'] == "inet6")) {
- $input_errors[] = gettext("IPv4 addresses can not be used in IPv6 rules.");
+ $input_errors[] = gettext("IPv4 addresses can not be used in IPv6 rules (except within an alias).");
}
if ((is_ipaddr($_POST['src']) || is_ipaddr($_POST['dst'])) && ($_POST['ipprotocol'] == "inet46")) {
- $input_errors[] = gettext("IPv4 and IPv6 addresses can not be used in rules that apply to both IPv4 and IPv6.");
+ $input_errors[] = gettext("IPv4 and IPv6 addresses can not be used in rules that apply to both IPv4 and IPv6 (except within an alias).");
}
if ($_POST['srcbeginport'] > $_POST['srcendport']) {
@@ -593,8 +612,8 @@ if ($_POST['save']) {
} elseif (!isset($t) || count($t) == 0) {
// not specified or none selected
unset($_POST['icmptype']);
- } else {
- // check data
+ } elseif (isset($_POST['ipprotocol'])) {
+ // check data; if ipprotocol invalid then safe to skip this (we can't determine valid icmptypes, but input error already raised for ipprotocol)
$bad_types = array();
if ((count($t) == 1 && !isset($t['any'])) || count($t) > 1) {
// Only need to check valid if just one selected != "any", or >1 selected
@@ -642,7 +661,7 @@ if ($_POST['save']) {
$input_errors[] = gettext("Please select a gateway, normally the interface selected gateway, so the limiters work correctly");
}
}
- if (!empty($_POST['ruleid']) && !ctype_digit($_POST['ruleid'])) {
+ if (!empty($_POST['ruleid']) && !is_numericint($_POST['ruleid'])) {
$input_errors[] = gettext('ID must be an integer');
}
@@ -755,13 +774,12 @@ if ($_POST['save']) {
$filterent['tracker'] = empty($_POST['tracker']) ? (int)microtime(true) : $_POST['tracker'];
$filterent['type'] = $_POST['type'];
+
if (isset($_POST['interface'])) {
$filterent['interface'] = $_POST['interface'];
- }
+ } // FIXME: can $_POST['interface'] be unset at this point, if so then what?
- if (isset($_POST['ipprotocol'])) {
- $filterent['ipprotocol'] = $_POST['ipprotocol'];
- }
+ $filterent['ipprotocol'] = $_POST['ipprotocol'];
if ($_POST['tcpflags_any']) {
$filterent['tcpflags_any'] = true;
diff --git a/src/usr/local/www/guiconfig.inc b/src/usr/local/www/guiconfig.inc
index 433b3b6..43321d9 100644
--- a/src/usr/local/www/guiconfig.inc
+++ b/src/usr/local/www/guiconfig.inc
@@ -1110,7 +1110,7 @@ function add_package_tabs($tabgroup, &$tab_array) {
}
function alias_info_popup($alias_id) {
- global $config;
+ global $config, $user_settings;
if (!is_array($config['aliases']['alias'][$alias_id])) {
return;
@@ -1120,7 +1120,13 @@ function alias_info_popup($alias_id) {
$alias = $config['aliases']['alias'][$alias_id];
$content = "";
- if ($alias['url']) {
+ if ($user_settings['webgui']['disablealiaspopupdetail']) {
+ if (strlen($alias['descr']) >= $maxlength) {
+ $alias['descr'] = substr($alias['descr'], 0, $maxlength) . '&hellip;';
+ }
+
+ $content .= $alias['descr'];
+ } else if ($alias['url']) {
// TODO: Change it when pf supports tables with ports
if ($alias['type'] == "urltable") {
exec("/sbin/pfctl -t {$alias['name']} -T show | wc -l", $total_entries);
@@ -1164,10 +1170,6 @@ function alias_info_popup($alias_id) {
$content .= "<table>\n";
}
- if (strlen($alias['descr']) >= $maxlength) {
- $alias['descr'] = substr($alias['descr'], 0, $maxlength) . '&hellip;';
- }
-
return $content;
}
diff --git a/src/usr/local/www/interfaces.php b/src/usr/local/www/interfaces.php
index e00856d..fd9965b 100755
--- a/src/usr/local/www/interfaces.php
+++ b/src/usr/local/www/interfaces.php
@@ -987,10 +987,7 @@ if ($_POST['apply']) {
kill_dhclient_process($wancfg['if']);
}
if ($wancfg['ipaddrv6'] == "dhcp6") {
- $pid = find_dhcp6c_process($wancfg['if']);
- if ($pid) {
- posix_kill($pid, SIGTERM);
- }
+ kill_dhcp6client_process($wancfg['if'],true);
}
}
$ppp = array();
diff --git a/src/usr/local/www/pkg.php b/src/usr/local/www/pkg.php
index 55f5559..305f28b 100644
--- a/src/usr/local/www/pkg.php
+++ b/src/usr/local/www/pkg.php
@@ -93,24 +93,24 @@ $evaledvar = $config['installedpackages'][xml_safe_fieldname($pkg['name'])]['con
if ($_REQUEST['act'] == "update") {
if (is_array($config['installedpackages'][$pkg['name']]) && $pkg['name'] != "" && $_REQUEST['ids'] !="") {
- #get current values
+ // get current values
$current_values=$config['installedpackages'][$pkg['name']]['config'];
- #get updated ids
+ // get updated ids
parse_str($_REQUEST['ids'], $update_list);
- #sort ids to know what to change
- #useful to do not lose data when using sorting and paging
+ // sort ids to know what to change
+ // useful to do not lose data when using sorting and paging
$sort_list=$update_list['ids'];
sort($sort_list);
- #apply updates
+ // apply updates
foreach ($update_list['ids'] as $key=> $value) {
$config['installedpackages'][$pkg['name']]['config'][$sort_list[$key]]=$current_values[$update_list['ids'][$key]];
}
- #save current config
- write_config();
- #sync package
+ // save current config
+ write_config(gettext("Package configuration changes saved from package settings page."));
+ // sync package
eval ("{$pkg['custom_php_resync_config_command']}");
}
- #function called via jquery, no need to continue after save changes.
+ // function called via jquery, no need to continue after save changes.
exit;
}
if ($_REQUEST['act'] == "del") {
@@ -129,7 +129,7 @@ if ($_REQUEST['act'] == "del") {
if ($a_pkg[$_REQUEST['id']]) {
unset($a_pkg[$_REQUEST['id']]);
- write_config();
+ write_config(gettext("Package configuration item deleted from package settings page."));
if ($pkg['custom_delete_php_command'] != "") {
if ($pkg['custom_php_command_before_form'] != "") {
eval($pkg['custom_php_command_before_form']);
diff --git a/src/usr/local/www/pkg_edit.php b/src/usr/local/www/pkg_edit.php
index 559645b..f2603e5 100644
--- a/src/usr/local/www/pkg_edit.php
+++ b/src/usr/local/www/pkg_edit.php
@@ -33,6 +33,7 @@ require_once("functions.inc");
require_once("filter.inc");
require_once("shaper.inc");
require_once("pkg-utils.inc");
+require_once("util.inc");
/* dummy stubs needed by some code that was MFC'd */
function pfSenseHeader($location) {
@@ -159,7 +160,6 @@ if ($_POST) {
}
}
- // donotsave is enabled. lets simply exit.
if (empty($pkg['donotsave'])) {
// store values in xml configuration file.
@@ -175,11 +175,24 @@ if ($_POST) {
foreach ($_POST as $key => $value) {
$matches = array();
if (preg_match("/^{$rowhelperfield['fieldname']}(\d+)$/", $key, $matches)) {
- $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']] = $value;
+ if ($rowhelperfield['type'] == "textarea") {
+ $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']] = unixnewlines($value);
+ } else {
+ $pkgarr[$rowhelpername][$matches[1]][$rowhelperfield['fieldname']] = $value;
+ }
}
}
}
break;
+ case "textarea":
+ $fieldname = $fields['fieldname'];
+ $fieldvalue = unixnewlines(trim($_POST[$fieldname]));
+ if ($fields['encoding'] == 'base64') {
+ $fieldvalue = base64_encode($fieldvalue);
+ }
+ if ($fieldname) {
+ $pkgarr[$fieldname] = $fieldvalue;
+ }
default:
$fieldname = $fields['fieldname'];
if ($fieldname == "interface_array") {
@@ -243,6 +256,7 @@ if ($_POST) {
$get_from_post = true;
}
} elseif (!$input_errors) {
+ // donotsave is enabled. lets simply exit.
exit;
}
}
diff --git a/src/usr/local/www/services_checkip.php b/src/usr/local/www/services_checkip.php
index 2b5f778..55c9a06 100644
--- a/src/usr/local/www/services_checkip.php
+++ b/src/usr/local/www/services_checkip.php
@@ -37,26 +37,31 @@ $a_checkipservice = &$config['checkipservices']['checkipservice'];
$dirty = false;
if ($_POST['act'] == "del") {
unset($a_checkipservice[$_POST['id']]);
+ $wc_msg = gettext('Deleted a check IP service.');
$dirty = true;
} else if ($_POST['act'] == "toggle") {
if ($a_checkipservice[$_POST['id']]) {
if (isset($a_checkipservice[$_POST['id']]['enable'])) {
unset($a_checkipservice[$_POST['id']]['enable']);
+ $wc_msg = gettext('Disabled a check IP service.');
} else {
$a_checkipservice[$_POST['id']]['enable'] = true;
+ $wc_msg = gettext('Enabled a check IP service.');
}
$dirty = true;
} else if ($_POST['id'] == count($a_checkipservice)) {
if (isset($config['checkipservices']['disable_factory_default'])) {
unset($config['checkipservices']['disable_factory_default']);
+ $wc_msg = gettext('Enabled the default check IP service.');
} else {
$config['checkipservices']['disable_factory_default'] = true;
+ $wc_msg = gettext('Disabled the default check IP service.');
}
$dirty = true;
}
}
if ($dirty) {
- write_config();
+ write_config($wc_msg);
header("Location: services_checkip.php");
exit;
diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php
index 3f767c9..74ef389 100644
--- a/src/usr/local/www/services_unbound.php
+++ b/src/usr/local/www/services_unbound.php
@@ -441,8 +441,8 @@ events.push(function() {
<thead>
<tr>
<th><?=gettext("Host")?></th>
- <th><?=gettext("Domain")?></th>
- <th><?=gettext("IP")?></th>
+ <th><?=gettext("Parent domain of host")?></th>
+ <th><?=gettext("IP to return for host")?></th>
<th><?=gettext("Description")?></th>
<th><?=gettext("Actions")?></th>
</tr>
@@ -504,6 +504,14 @@ endforeach;
</div>
</div>
+<span class="help-block">
+ Enter any individual hosts for which the resolver's standard DNS lookup process should be overridden and a specific
+ IPv4 or IPv6 address should automatically be returned by the resolver. Standard and also non-standard names and parent domains
+ can be entered, such as 'test', 'mycompany.localdomain', '1.168.192.in-addr.arpa', or 'somesite.com'. Any lookup attempt for
+ the host will automatically return the given IP address, and the usual lookup server for the domain will not be queried for
+ the host's records.
+</span>
+
<nav class="action-buttons">
<a href="services_unbound_host_edit.php" class="btn btn-sm btn-success">
<i class="fa fa-plus icon-embed-btn"></i>
@@ -518,7 +526,7 @@ endforeach;
<thead>
<tr>
<th><?=gettext("Domain")?></th>
- <th><?=gettext("IP")?></th>
+ <th><?=gettext("Lookup Server IP Address")?></th>
<th><?=gettext("Description")?></th>
<th><?=gettext("Actions")?></th>
</tr>
@@ -553,6 +561,13 @@ endforeach;
</div>
</div>
+<span class="help-block">
+ Enter any domains for which the resolver's standard DNS lookup process should be overridden and a different (non-standard)
+ lookup server should be queried instead. Non-standard, 'invalid' and local domains, and subdomains, can also be entered,
+ such as 'test', 'mycompany.localdomain', '1.168.192.in-addr.arpa', or 'somesite.com'. The IP address is treated as the
+ authoritative lookup server for the domain (including all of its subdomains), and other lookup servers will not be queried.
+</span>
+
<nav class="action-buttons">
<a href="services_unbound_domainoverride_edit.php" class="btn btn-sm btn-success">
<i class="fa fa-plus icon-embed-btn"></i>
diff --git a/src/usr/local/www/services_unbound_domainoverride_edit.php b/src/usr/local/www/services_unbound_domainoverride_edit.php
index 17f2fee..f37f366 100644
--- a/src/usr/local/www/services_unbound_domainoverride_edit.php
+++ b/src/usr/local/www/services_unbound_domainoverride_edit.php
@@ -114,20 +114,20 @@ if ($input_errors) {
$form = new Form();
-$section = new Form_Section('Domain Override');
+$section = new Form_Section('Domains to Override with Custom Lookup Servers');
$section->addInput(new Form_Input(
'domain',
'*Domain',
'text',
$pconfig['domain']
-))->setHelp('Domain to override (NOTE: this does not have to be a valid TLD!) e.g.: test or mycompany.localdomain or 1.168.192.in-addr.arpa');
+))->setHelp('Domain whose lookups will be directed to a user-specified DNS lookup server.');
$section->addInput(new Form_IpAddress(
'ip',
'*IP Address',
$pconfig['ip']
-))->setHelp('IP address of the authoritative DNS server for this domain. e.g.: 192.168.100.100%1$s' .
+))->setHelp('IPv4 or IPv6 address of the authoritative DNS server for this domain. e.g.: 192.168.100.100%1$s' .
'To use a non-default port for communication, append an \'@\' with the port number.', '<br />')->setPattern('[a-zA-Z0-9@.:]+');
$section->addInput(new Form_Input(
@@ -146,6 +146,17 @@ if (isset($id) && $a_domainOverrides[$id]) {
));
}
+$section->addInput(new Form_StaticText(
+ '',
+ '<span class="help-block">' .
+ gettext("This page is used to specify domains for which the resolver's standard DNS lookup process will be overridden, " .
+ "and the resolver will query a different (non-standard) lookup server instead. It is possible to enter 'non-standard', 'invalid' " .
+ "and 'local' domains such as 'test', 'mycompany.localdomain', or '1.168.192.in-addr.arpa', as well as usual publicly resolvable " .
+ "domains such as 'org', 'info', or 'google.co.uk'. The IP address entered will be treated as the IP address of an authoritative " .
+ "lookup server for the domain (including all of its subdomains), and other lookup servers will not be queried.") .
+ '</span>'
+));
+
$form->add($section);
print $form;
diff --git a/src/usr/local/www/services_unbound_host_edit.php b/src/usr/local/www/services_unbound_host_edit.php
index c374631..a5fcd3d 100644
--- a/src/usr/local/www/services_unbound_host_edit.php
+++ b/src/usr/local/www/services_unbound_host_edit.php
@@ -192,21 +192,21 @@ $section->addInput(new Form_Input(
'text',
$pconfig['host']
))->setHelp('Name of the host, without the domain part%1$s' .
- 'e.g.: "myhost"', '<br />');
+ 'e.g. enter "myhost" if the full domain name is "myhost.example.com"', '<br />');
$section->addInput(new Form_Input(
'domain',
'*Domain',
'text',
$pconfig['domain']
-))->setHelp('Domain of the host%1$s' .
- 'e.g.: "example.com"', '<br />');
+))->setHelp('Parent domain of the host%1$s' .
+ 'e.g. enter "example.com" for "myhost.example.com"', '<br />');
$section->addInput(new Form_IpAddress(
'ip',
'*IP Address',
$pconfig['ip']
-))->setHelp('IP address of the host%1$s' .
+))->setHelp('IPv4 or IPv6 address to be returned for the host%1$s' .
'e.g.: 192.168.100.100 or fd00:abcd::1', '<br />');
$section->addInput(new Form_Input(
@@ -225,6 +225,18 @@ if (isset($id) && $a_hosts[$id]) {
));
}
+$section->addInput(new Form_StaticText(
+ '',
+ '<span class="help-block">' .
+ gettext("This page is used to override the usual lookup process for a specific host. A host is defined by its name " .
+ "and parent domain (e.g., 'somesite.google.com' is entered as host='somesite' and parent domain='google.com'). Any " .
+ "attempt to lookup that host will automatically return the given IP address, and any usual external lookup server for " .
+ "the domain will not be queried. Both the name and parent domain can contain 'non-standard', 'invalid' and 'local' " .
+ "domains such as 'test', 'mycompany.localdomain', or '1.168.192.in-addr.arpa', as well as usual publicly resolvable names ".
+ "such as 'www' or 'google.co.uk'.") .
+ '</span>'
+));
+
$form->add($section);
$section = new Form_Section('Additional Names for this Host');
@@ -281,6 +293,13 @@ $form->addGlobal(new Form_Button(
'fa-plus'
))->removeClass('btn-primary')->addClass('btn-success addbtn');
+$section->addInput(new Form_StaticText(
+ '',
+ '<span class="help-block">'.
+ gettext("If the host can be accessed using multiple names, then enter any other names for the host which should also be overridden.") .
+ '</span>'
+));
+
$form->add($section);
print($form);
diff --git a/src/usr/local/www/status_logs_settings.php b/src/usr/local/www/status_logs_settings.php
index d431353..2ad1c5b 100644
--- a/src/usr/local/www/status_logs_settings.php
+++ b/src/usr/local/www/status_logs_settings.php
@@ -160,7 +160,7 @@ if ($_POST['resetlogs'] == gettext("Reset Log Files")) {
unset($config['syslog']['remoteserver3']);
}
- write_config();
+ write_config(gettext("Changed system logging options."));
$changes_applied = true;
$retval = 0;
diff --git a/src/usr/local/www/system.php b/src/usr/local/www/system.php
index d76a5de..5766499 100644
--- a/src/usr/local/www/system.php
+++ b/src/usr/local/www/system.php
@@ -63,6 +63,7 @@ $pconfig['webguicss'] = $config['system']['webgui']['webguicss'];
$pconfig['webguifixedmenu'] = $config['system']['webgui']['webguifixedmenu'];
$pconfig['dashboardcolumns'] = $config['system']['webgui']['dashboardcolumns'];
$pconfig['webguileftcolumnhyper'] = isset($config['system']['webgui']['webguileftcolumnhyper']);
+$pconfig['disablealiaspopupdetail'] = isset($config['system']['webgui']['disablealiaspopupdetail']);
$pconfig['dashboardavailablewidgetspanel'] = isset($config['system']['webgui']['dashboardavailablewidgetspanel']);
$pconfig['systemlogsfilterpanel'] = isset($config['system']['webgui']['systemlogsfilterpanel']);
$pconfig['systemlogsmanagelogpanel'] = isset($config['system']['webgui']['systemlogsmanagelogpanel']);
@@ -274,6 +275,9 @@ if ($_POST) {
unset($config['system']['webgui']['webguileftcolumnhyper']);
$config['system']['webgui']['webguileftcolumnhyper'] = $_POST['webguileftcolumnhyper'] ? true : false;
+ unset($config['system']['webgui']['disablealiaspopupdetail']);
+ $config['system']['webgui']['disablealiaspopupdetail'] = $_POST['disablealiaspopupdetail'] ? true : false;
+
unset($config['system']['webgui']['dashboardavailablewidgetspanel']);
$config['system']['webgui']['dashboardavailablewidgetspanel'] = $_POST['dashboardavailablewidgetspanel'] ? true : false;
@@ -580,6 +584,7 @@ gen_associatedpanels_fields(
$pconfig['statusmonitoringsettingspanel']);
gen_requirestatefilter_field($section, $pconfig['requirestatefilter']);
gen_webguileftcolumnhyper_field($section, $pconfig['webguileftcolumnhyper']);
+gen_disablealiaspopupdetail_field($section, $pconfig['disablealiaspopupdetail']);
$section->addInput(new Form_Checkbox(
'loginshowhost',
diff --git a/src/usr/local/www/system_advanced_firewall.php b/src/usr/local/www/system_advanced_firewall.php
index 27a5e23..3f7742f 100644
--- a/src/usr/local/www/system_advanced_firewall.php
+++ b/src/usr/local/www/system_advanced_firewall.php
@@ -348,7 +348,7 @@ if ($_POST) {
$config['system']['bogons']['interval'] = $_POST['bogonsinterval'];
}
- write_config();
+ write_config(gettext("Changed Advanced Firewall/NAT settings."));
// Kill filterdns when value changes, filter_configure() will restart it
if (($old_aliasesresolveinterval != $config['system']['aliasesresolveinterval']) &&
diff --git a/src/usr/local/www/system_certmanager.php b/src/usr/local/www/system_certmanager.php
index 777d416..7b5ea66 100644
--- a/src/usr/local/www/system_certmanager.php
+++ b/src/usr/local/www/system_certmanager.php
@@ -34,6 +34,7 @@ $cert_methods = array(
"import" => gettext("Import an existing Certificate"),
"internal" => gettext("Create an internal Certificate"),
"external" => gettext("Create a Certificate Signing Request"),
+ "sign" => gettext("Sign a Certificate Signing Request")
);
$cert_keylens = array("512", "1024", "2048", "3072", "4096", "7680", "8192", "15360", "16384");
@@ -81,7 +82,6 @@ foreach ($a_ca as $ca) {
$act = $_REQUEST['act'];
-
if ($_POST['act'] == "del") {
if (!isset($a_cert[$id])) {
@@ -96,7 +96,6 @@ if ($_POST['act'] == "del") {
exit;
}
-
if ($act == "new") {
$pconfig['method'] = $_POST['method'];
$pconfig['keylen'] = "2048";
@@ -172,6 +171,7 @@ if ($act == "p12") {
$args['friendly_name'] = $a_cert[$id]['descr'];
$ca = lookup_ca($a_cert[$id]['caref']);
+
if ($ca) {
$args['extracerts'] = openssl_x509_read(base64_decode($ca['crt']));
}
@@ -212,6 +212,24 @@ if ($_POST['save']) {
$pconfig = $_POST;
/* input validation */
+ if ($pconfig['method'] == "sign") {
+ $reqdfields = explode(" ",
+ "descr catosignwith");
+ $reqdfieldsn = array(
+ gettext("Descriptive name"),
+ gettext("CA to sign with"));
+
+ if (($_POST['csrtosign'] === "new") && (!strstr($_POST['csrpaste'], "BEGIN CERTIFICATE REQUEST") || !strstr($_POST['csrpaste'], "END CERTIFICATE REQUEST"))) {
+ $input_errors[] = gettext("This signing request does not appear to be valid.");
+ }
+
+ if ( (($_POST['csrtosign'] === "new") && (strlen($_POST['keypaste']) > 0)) && (!strstr($_POST['keypaste'], "BEGIN PRIVATE KEY") || !strstr($_POST['keypaste'], "END PRIVATE KEY"))) {
+ $input_errors[] = gettext("This private does not appear to be valid.");
+ $input_errors[] = gettext("Key data field should be blank, or a valid x509 private key");
+ }
+
+ }
+
if ($pconfig['method'] == "import") {
$reqdfields = explode(" ",
"descr cert key");
@@ -222,6 +240,7 @@ if ($_POST['save']) {
if ($_POST['cert'] && (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))) {
$input_errors[] = gettext("This certificate does not appear to be valid.");
}
+
if (cert_get_modulus($_POST['cert'], false) != prv_get_modulus($_POST['key'], false)) {
$input_errors[] = gettext("The submitted private key does not match the submitted certificate data.");
}
@@ -267,6 +286,7 @@ if ($_POST['save']) {
$altnames = array();
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
+
if ($pconfig['method'] != "import" && $pconfig['method'] != "existing") {
/* subjectAltNames */
foreach ($_POST as $key => $value) {
@@ -362,6 +382,48 @@ if ($_POST['save']) {
if ($cert && $a_user) {
$a_user[$userid]['cert'][] = $cert['refid'];
}
+ } else if ($pconfig['method'] == "sign") { // Sign a CSR
+ $csrid = lookup_cert($pconfig['csrtosign']);
+ $caid = lookup_ca($pconfig['catosignwith']);
+
+ // Read the CSR from $config, or if a new one, from the textarea
+ if ($pconfig['csrtosign'] === "new") {
+ $csr = $pconfig['csrpaste'];
+ } else {
+ $csr = base64_decode($csrid['csr']);
+ }
+
+ $old_err_level = error_reporting(0);
+
+ // Gather the information required for signed cert
+ $ca = base64_decode($caid['crt']);
+ $key = base64_decode($caid['prv']);
+ $duration = $pconfig['duration'];
+ $caref = $pconfig['catosignwith'];
+ $type = (cert_get_purpose($csrid)['server'] === "Yes") ? "server":"user";
+
+ // Sign the new cert and export it in x509 format
+ openssl_x509_export(openssl_csr_sign($csr, $ca, $key, $duration, ['x509_extensions' => 'v3_req']), $n509);
+
+ // Gather the details required to save the new cert
+ $newcert = array();
+ $newcert['refid'] = uniqid();
+ $newcert['caref'] = $caref;
+ $newcert['descr'] = $pconfig['descr'];
+ $newcert['type'] = $type;
+ $newcert['crt'] = base64_encode($n509);
+
+ if ($pconfig['csrtosign'] === "new") {
+ $newcert['prv'] = base64_encode($pconfig['keypaste']);
+ } else {
+ $newcert['prv'] = $csrid['prv'];
+ }
+
+ // Add it to the config file
+ $config['cert'][] = $newcert;
+
+ error_reporting($old_err_level);
+
} else {
$cert = array();
$cert['refid'] = uniqid();
@@ -435,6 +497,7 @@ if ($_POST['save']) {
}
}
}
+
error_reporting($old_err_level);
if (isset($id) && $a_cert[$id]) {
@@ -569,7 +632,7 @@ if ($act == "new" || (($_POST['save'] == gettext("Save")) && $input_errors)) {
));
}
- $section = new Form_Section('Add a New Certificate');
+ $section = new Form_Section('Add/Sign a New Certificate');
if (!isset($id)) {
$section->addInput(new Form_Select(
@@ -588,6 +651,73 @@ if ($act == "new" || (($_POST['save'] == gettext("Save")) && $input_errors)) {
))->addClass('toggle-existing');
$form->add($section);
+
+ // Return an array containing the IDs od all CAs
+ function list_cas() {
+ global $a_ca;
+ $allCas = array();
+
+ foreach ($a_ca as $ca) {
+ if ($ca['prv']) {
+ $allCas[$ca['refid']] = $ca['descr'];
+ }
+ }
+
+ return $allCas;
+ }
+
+ // Return an array containing the IDs od all CSRs
+ function list_csrs() {
+ global $config;
+ $allCsrs = array();
+
+ foreach ($config['cert'] as $cert) {
+ if ($cert['csr']) {
+ $allCsrs[$cert['refid']] = $cert['descr'];
+ }
+ }
+
+ return ['new' => gettext('New CSR (Paste below)')] + $allCsrs;
+ }
+
+ $section = new Form_Section('Sign CSR');
+ $section->addClass('toggle-sign collapse');
+
+ $section->AddInput(new Form_Select(
+ 'catosignwith',
+ '*CA to sign with',
+ $pconfig['catosignwith'],
+ list_cas()
+ ));
+
+ $section->AddInput(new Form_Select(
+ 'csrtosign',
+ '*CSR to sign',
+ isset($pconfig['csrtosign']) ? $pconfig['csrtosign'] : 'new',
+ list_csrs()
+ ));
+
+ $section->addInput(new Form_Input(
+ 'duration',
+ '*Certificate duration (days)',
+ 'number',
+ $pconfig['duration'] ? $pconfig['duration']:'3650'
+ ));
+
+ $section->addInput(new Form_Textarea(
+ 'csrpaste',
+ 'CSR data',
+ $pconfig['csrpaste']
+ ))->setHelp('Paste a Certificate Signing Request in X.509 PEM format here.');
+
+ $section->addInput(new Form_Textarea(
+ 'keypaste',
+ 'Key data',
+ $pconfig['keypaste']
+ ))->setHelp('Optionally paste a private key here. The key will be associated with the newly signed certificate in pfSense');
+
+ $form->add($section);
+
$section = new Form_Section('Import Certificate');
$section->addClass('toggle-import collapse');
@@ -1062,7 +1192,9 @@ foreach ($a_cert as $i => $cert):
<td>
<?php if (!$cert['csr']): ?>
<a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="fa fa-certificate" title="<?=gettext("Export Certificate")?>"></a>
- <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
+ <?php if ($cert['prv']): ?>
+ <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
+ <?php endif?>
<a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="fa fa-archive" title="<?=gettext("Export P12")?>"></a>
<?php else: ?>
<a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="fa fa-pencil" title="<?=gettext("Update CSR")?>"></a>
@@ -1086,7 +1218,7 @@ foreach ($a_cert as $i => $cert):
<nav class="action-buttons">
<a href="?act=new" class="btn btn-success btn-sm">
<i class="fa fa-plus icon-embed-btn"></i>
- <?=gettext("Add")?>
+ <?=gettext("Add/Sign")?>
</a>
</nav>
<?php
@@ -1113,7 +1245,6 @@ events.push(function() {
}
$subject = cert_get_subject_array($ca['crt']);
-
?>
case "<?=$ca['refid'];?>":
$('#dn_country').val("<?=$subject[0]['v'];?>");
@@ -1129,15 +1260,28 @@ events.push(function() {
}
}
+ function set_csr_ro() {
+ var newcsr = ($('#csrtosign').val() == "new");
+
+ $('#csrpaste').attr('readonly', !newcsr);
+ $('#keypaste').attr('readonly', !newcsr);
+ setRequired('csrpaste', newcsr);
+ }
+
// ---------- Click checkbox handlers ---------------------------------------------------------
$('#caref').on('change', function() {
internalca_change();
});
+ $('#csrtosign').change(function () {
+ set_csr_ro();
+ });
+
// ---------- On initial page load ------------------------------------------------------------
internalca_change();
+ set_csr_ro();
// Suppress "Delete row" button if there are fewer than two rows
checkLastRow();
diff --git a/src/usr/local/www/system_routes.php b/src/usr/local/www/system_routes.php
index c04cca3..872d6a8 100644
--- a/src/usr/local/www/system_routes.php
+++ b/src/usr/local/www/system_routes.php
@@ -200,7 +200,7 @@ if($_POST['save']) {
$a_routes = $a_routes_new;
}
- if (write_config()) {
+ if (write_config(gettext("Saved static routes configuration."))) {
mark_subsystem_dirty('staticroutes');
}
header("Location: system_routes.php");
diff --git a/src/usr/local/www/system_routes_edit.php b/src/usr/local/www/system_routes_edit.php
index 45b26c1..b94523f 100644
--- a/src/usr/local/www/system_routes_edit.php
+++ b/src/usr/local/www/system_routes_edit.php
@@ -209,7 +209,7 @@ if ($_POST['save']) {
mark_subsystem_dirty('staticroutes');
- write_config();
+ write_config(gettext("Saved static route configuration."));
header("Location: system_routes.php");
exit;
diff --git a/src/usr/local/www/system_update_settings.php b/src/usr/local/www/system_update_settings.php
index 6984ca3..2d1549b 100644
--- a/src/usr/local/www/system_update_settings.php
+++ b/src/usr/local/www/system_update_settings.php
@@ -96,7 +96,7 @@ if ($_POST) {
unset($config['system']['gitsync']['dryrun']);
}
- write_config();
+ write_config(gettext("Saved system update settings."));
$savemsg = gettext("Changes have been saved successfully");
}
diff --git a/src/usr/local/www/system_user_settings.php b/src/usr/local/www/system_user_settings.php
index 7cf5c17..03d8355 100644
--- a/src/usr/local/www/system_user_settings.php
+++ b/src/usr/local/www/system_user_settings.php
@@ -47,6 +47,7 @@ if (isset($id) && $a_user[$id]) {
$pconfig['systemlogsmanagelogpanel'] = isset($a_user[$id]['systemlogsmanagelogpanel']);
$pconfig['statusmonitoringsettingspanel'] = isset($a_user[$id]['statusmonitoringsettingspanel']);
$pconfig['webguileftcolumnhyper'] = isset($a_user[$id]['webguileftcolumnhyper']);
+ $pconfig['disablealiaspopupdetail'] = isset($a_user[$id]['disablealiaspopupdetail']);
$pconfig['pagenamefirst'] = isset($a_user[$id]['pagenamefirst']);
} else {
echo gettext("The settings cannot be managed for a non-local user.");
@@ -118,6 +119,13 @@ if (isset($_POST['save'])) {
unset($userent['webguileftcolumnhyper']);
}
+ if ($_POST['disablealiaspopupdetail']) {
+ $pconfig['disablealiaspopupdetail'] = $userent['disablealiaspopupdetail'] = true;
+ } else {
+ $pconfig['disablealiaspopupdetail'] = false;
+ unset($userent['disablealiaspopupdetail']);
+ }
+
if ($_POST['pagenamefirst']) {
$pconfig['pagenamefirst'] = $userent['pagenamefirst'] = true;
} else {
diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php
index 305f2d3..abf9d82 100644
--- a/src/usr/local/www/system_usermanager.php
+++ b/src/usr/local/www/system_usermanager.php
@@ -68,6 +68,7 @@ if (isset($id) && $a_user[$id]) {
$pconfig['systemlogsmanagelogpanel'] = isset($a_user[$id]['systemlogsmanagelogpanel']);
$pconfig['statusmonitoringsettingspanel'] = isset($a_user[$id]['statusmonitoringsettingspanel']);
$pconfig['webguileftcolumnhyper'] = isset($a_user[$id]['webguileftcolumnhyper']);
+ $pconfig['disablealiaspopupdetail'] = isset($a_user[$id]['disablealiaspopupdetail']);
$pconfig['pagenamefirst'] = isset($a_user[$id]['pagenamefirst']);
$pconfig['groups'] = local_user_get_groups($a_user[$id]);
$pconfig['utype'] = $a_user[$id]['scope'];
@@ -359,6 +360,12 @@ if ($_POST['save']) {
unset($userent['webguileftcolumnhyper']);
}
+ if ($_POST['disablealiaspopupdetail']) {
+ $userent['disablealiaspopupdetail'] = true;
+ } else {
+ unset($userent['disablealiaspopupdetail']);
+ }
+
if ($_POST['pagenamefirst']) {
$userent['pagenamefirst'] = true;
} else {
@@ -974,6 +981,7 @@ events.push(function() {
hideCheckbox('systemlogsmanagelogpanel', !adv);
hideCheckbox('statusmonitoringsettingspanel', !adv);
hideCheckbox('webguileftcolumnhyper', !adv);
+ hideCheckbox('disablealiaspopupdetail', !adv);
hideCheckbox('pagenamefirst', !adv);
}
diff --git a/src/usr/local/www/vpn_ipsec.php b/src/usr/local/www/vpn_ipsec.php
index 22ef39d..27ff7ce 100644
--- a/src/usr/local/www/vpn_ipsec.php
+++ b/src/usr/local/www/vpn_ipsec.php
@@ -65,7 +65,7 @@ if ($_POST['apply']) {
foreach ($_POST['p1entry'] as $p1entrydel) {
unset($a_phase1[$p1entrydel]);
}
- if (write_config()) {
+ if (write_config(gettext("Deleted selected IPsec Phase 1 entries."))) {
mark_subsystem_dirty('ipsec');
}
}
@@ -75,7 +75,7 @@ if ($_POST['apply']) {
foreach ($_POST['p2entry'] as $p2entrydel) {
unset($a_phase2[$p2entrydel]);
}
- if (write_config()) {
+ if (write_config(gettext("Deleted selected IPsec Phase 2 entries."))) {
mark_subsystem_dirty('ipsec');
}
}
@@ -209,7 +209,7 @@ if ($_POST['apply']) {
}
if ($save === 1) {
- if (write_config()) {
+ if (write_config(gettext("Saved configuration changes for IPsec tunnels."))) {
mark_subsystem_dirty('ipsec');
}
}
diff --git a/src/usr/local/www/vpn_ipsec_mobile.php b/src/usr/local/www/vpn_ipsec_mobile.php
index 32f9de3..992ab68 100644
--- a/src/usr/local/www/vpn_ipsec_mobile.php
+++ b/src/usr/local/www/vpn_ipsec_mobile.php
@@ -294,7 +294,7 @@ if ($_POST['save']) {
$a_client = $client;
- write_config();
+ write_config(gettext("Saved IPsec Mobile Clients configuration."));
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec_mobile.php");
diff --git a/src/usr/local/www/vpn_ipsec_phase1.php b/src/usr/local/www/vpn_ipsec_phase1.php
index 6988f73..44b6a30 100644
--- a/src/usr/local/www/vpn_ipsec_phase1.php
+++ b/src/usr/local/www/vpn_ipsec_phase1.php
@@ -508,7 +508,7 @@ if ($_POST['save']) {
$a_phase1[] = $ph1ent;
}
- write_config();
+ write_config(gettext("Saved IPsec tunnel Phase 1 configuration."));
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec.php");
diff --git a/src/usr/local/www/vpn_ipsec_phase2.php b/src/usr/local/www/vpn_ipsec_phase2.php
index dd62ede..061e178 100644
--- a/src/usr/local/www/vpn_ipsec_phase2.php
+++ b/src/usr/local/www/vpn_ipsec_phase2.php
@@ -392,7 +392,7 @@ if ($_POST['save']) {
$a_phase2[] = $ph2ent;
}
- write_config();
+ write_config(gettext("Saved IPsec tunnel Phase 2 configuration."));
mark_subsystem_dirty('ipsec');
header("Location: vpn_ipsec.php");
diff --git a/src/usr/local/www/vpn_ipsec_settings.php b/src/usr/local/www/vpn_ipsec_settings.php
index 199fc6a..325936d 100644
--- a/src/usr/local/www/vpn_ipsec_settings.php
+++ b/src/usr/local/www/vpn_ipsec_settings.php
@@ -163,7 +163,7 @@ if ($_POST['save']) {
}
}
- write_config();
+ write_config(gettext("Saved IPsec advanced settings."));
$changes_applied = true;
$retval = 0;
diff --git a/src/usr/local/www/widgets/widgets/gateways.widget.php b/src/usr/local/www/widgets/widgets/gateways.widget.php
index d414a5e..355dd4a 100644
--- a/src/usr/local/www/widgets/widgets/gateways.widget.php
+++ b/src/usr/local/www/widgets/widgets/gateways.widget.php
@@ -310,8 +310,8 @@ function compose_table_body_contents() {
$bgcolor = "info"; // lightblue
}
- $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['delay']) : gettext("Pending")) . "</td>\n";
- $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['stddev']) : gettext("Pending")) . "</td>\n";
+ $rtnstr .= "<td>" . ($gateways_status[$gname] ? ($gateways_status[$gname]['delay'] ? htmlspecialchars(number_format((float)rtrim($gateways_status[$gname]['delay'], "ms"), 1)) . "ms" : '') : gettext("Pending")) . "</td>\n";
+ $rtnstr .= "<td>" . ($gateways_status[$gname] ? ($gateways_status[$gname]['stddev'] ? htmlspecialchars(number_format((float)rtrim($gateways_status[$gname]['stddev'], "ms"), 1)) . "ms" : '') : gettext("Pending")) . "</td>\n";
$rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['loss']) : gettext("Pending")) . "</td>\n";
$rtnstr .= '<td class="bg-' . $bgcolor . '">' . $online . "</td>\n";
$rtnstr .= "</tr>\n";
diff --git a/src/usr/local/www/widgets/widgets/gmirror_status.widget.php b/src/usr/local/www/widgets/widgets/gmirror_status.widget.php
index 046e9f3..97ee92e 100644
--- a/src/usr/local/www/widgets/widgets/gmirror_status.widget.php
+++ b/src/usr/local/www/widgets/widgets/gmirror_status.widget.php
@@ -46,6 +46,9 @@ function gmirrorStatusUpdateFromServer() {
},
success: function(data){
$('#gmirror_status').html(data);
+ },
+ error: function(){
+ $('#gmirror_status').html("<div class=\"alert alert-danger\"><?=gettext('Unable to retrieve status'); ?></div>");
}
});
}
diff --git a/src/usr/local/www/widgets/widgets/interfaces.widget.php b/src/usr/local/www/widgets/widgets/interfaces.widget.php
index 69a2869..92a517a 100644
--- a/src/usr/local/www/widgets/widgets/interfaces.widget.php
+++ b/src/usr/local/www/widgets/widgets/interfaces.widget.php
@@ -28,6 +28,8 @@ require_once("functions.inc");
require_once("/usr/local/www/widgets/include/interfaces.inc");
$ifdescrs = get_configured_interface_with_descr();
+// Update once per minute by default, instead of every 10 seconds
+$widgetperiod = isset($config['widgets']['period']) ? $config['widgets']['period'] * 1000 * 6 : 60000;
if ($_POST) {
@@ -49,9 +51,10 @@ if ($_POST) {
?>
-<div class="table-responsive">
+<div class="table-responsive" id="ifaces_status">
<table class="table table-striped table-hover table-condensed">
<tbody>
+
<?php
$skipinterfaces = explode(",", $user_settings['widgets']['interfaces']['iffilter']);
@@ -104,7 +107,7 @@ foreach ($ifdescrs as $ifdescr => $ifname):
<?php endif; ?>
</td>
<td>
- <?php if ($ifinfo['pppoelink'] == "up" || $ifinfo['pptplink'] == "up" || $ifinfo['l2tplink'] == "up"):?>
+ <?php if ($ifinfo['pppoelink'] == "up" || $ifinfo['pptplink'] == "up" || $ifinfo['l2tplink'] == "up"):?>
<?=sprintf(gettext("Uptime: %s"), htmlspecialchars($ifinfo['ppp_uptime']));?>
<?php else: ?>
<?=htmlspecialchars($ifinfo['media']);?>
@@ -125,9 +128,8 @@ foreach ($ifdescrs as $ifdescr => $ifname):
<?php endif; ?>
</td>
</tr>
-<?php
-endforeach;
-?>
+<?php endforeach; ?>
+
</tbody>
</table>
</div>
@@ -135,7 +137,7 @@ endforeach;
</div><div id="widget-<?=$widgetname?>_panel-footer" class="panel-footer collapse">
<form action="/widgets/widgets/interfaces.widget.php" method="post" class="form-horizontal">
- <div class="panel panel-default col-sm-10">
+ <div class="panel panel-default col-sm-10">
<div class="panel-body">
<div class="table responsive">
<table class="table table-striped table-hover table-condensed">
@@ -185,3 +187,29 @@ endforeach;
});
//]]>
</script>
+
+<script type="text/javascript">
+//<![CDATA[
+function getstatus_ifaces() {
+ $.ajax({
+ type: 'get',
+ url: '/widgets/widgets/interfaces.widget.php',
+ dataType: 'html',
+ dataFilter: function(raw){
+ // We reload the entire widget, strip this block of javascript from it
+ return raw.replace(/<script>([\s\S]*)<\/script>/gi, '');
+ },
+ success: function(data){
+ $('#ifaces_status').html(data);
+ },
+ error: function(){
+ $('#ifaces_status').html("<div class=\"alert alert-danger\"><?=gettext('Unable to retrieve status'); ?></div>");
+ }
+ });
+}
+
+ events.push(function(){
+ setInterval('getstatus_ifaces()', "<?=$widgetperiod?>");
+ });
+//]]>
+</script>
diff --git a/src/usr/local/www/wizard.php b/src/usr/local/www/wizard.php
index 3bc72da..2a6807b 100644
--- a/src/usr/local/www/wizard.php
+++ b/src/usr/local/www/wizard.php
@@ -116,7 +116,7 @@ if ($_POST && !$input_errors) {
eval($pkg['step'][$stepid]['stepsubmitphpaction']);
}
if (!$input_errors) {
- write_config();
+ write_config(gettext("Configuration changed via the pfSense wizard subsystem."));
}
$stepid++;
diff --git a/src/usr/local/www/wizards/openvpn_wizard.inc b/src/usr/local/www/wizards/openvpn_wizard.inc
index 259d279..a46f27d 100644
--- a/src/usr/local/www/wizards/openvpn_wizard.inc
+++ b/src/usr/local/www/wizards/openvpn_wizard.inc
@@ -19,7 +19,11 @@
* limitations under the License.
*/
+require_once("auth.inc");
+require_once("certs.inc");
+require_once("config.inc");
require_once("openvpn.inc");
+require_once("util.inc");
function has_special_chars($text) {
return preg_match('/[^A-Za-z0-9 _-]/', $text);
@@ -662,7 +666,7 @@ function step12_submitphpaction() {
$config['openvpn']['openvpn-server'][] = $server;
openvpn_resync('server', $server);
- write_config();
+ write_config(gettext("OpenVPN configuration saved via OpenVPN Remote Access Server setup wizard."));
header("Location: vpn_openvpn_server.php");
exit;
}
diff --git a/src/usr/local/www/wizards/setup_wizard.xml b/src/usr/local/www/wizards/setup_wizard.xml
index ba6382a..ba9148c 100644
--- a/src/usr/local/www/wizards/setup_wizard.xml
+++ b/src/usr/local/www/wizards/setup_wizard.xml
@@ -556,7 +556,7 @@
} else {
$_POST['ipaddress'] = $_POST['selectedtype'];
$config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
- write_config();
+ write_config(gettext("WAN interface configuration saved via pfSense setup wizard."));
}
if (!$config['interfaces']['lan']) {
header("Location: /wizard.php?xml=setup_wizard.xml&stepid=6&next=Next");
@@ -684,7 +684,7 @@
$admin_user =& getUserEntryByUID(0);
local_user_set_password($admin_user, $_POST['adminpassword']);
local_user_set($admin_user);
- write_config();
+ write_config(gettext("Admin WebGUI password saved via pfSense setup wizard."));
} else {
print_info_box("Passwords do not match! Please press back in the browser window and correct.");
die;
@@ -747,7 +747,7 @@
}
}
unset($config['wizardtemp']);
- write_config();
+ write_config(gettext("Configuration saved on completion of the pfSense setup wizard."));
reload_all();
mwexec_bg("/etc/rc.update_bogons.sh now");
]]>
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
index 6bd7a05..f1b4a1a 100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
@@ -19,6 +19,10 @@
* limitations under the License.
*/
+require_once("config.inc");
+require_once("interfaces.inc");
+require_once("util.inc");
+
function step1_stepbeforeformdisplay() {
global $stepid, $savemsg, $pkg;
@@ -1635,7 +1639,7 @@ function apply_all_chosen_items() {
}
}
}
- write_config();
+ write_config(gettext("Shaper configuration saved via pfSense traffic shaper wizard."));
}
function wizard_get_bandwidthtype_scale($type = "b") {
diff --git a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
index e14bc18..6c03ecd 100644
--- a/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/src/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -19,6 +19,9 @@
* limitations under the License.
*/
+require_once("config.inc");
+require_once("interfaces.inc");
+require_once("util.inc");
function step1_stepbeforeformdisplay() {
global $stepid, $savemsg, $pkg;
@@ -1727,7 +1730,7 @@ function apply_all_chosen_items() {
}
}
}
- write_config();
+ write_config(gettext("Shaper configuration saved via pfSense traffic shaper wizard."));
}
function wizard_get_bandwidthtype_scale($type = "b") {
OpenPOWER on IntegriCloud