summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/firewall_aliases_edit.php16
-rwxr-xr-xusr/local/www/firewall_aliases_import.php9
-rw-r--r--usr/local/www/firewall_nat_1to1_edit.php7
-rw-r--r--usr/local/www/firewall_nat_edit.php7
-rw-r--r--usr/local/www/firewall_nat_npt_edit.php7
-rw-r--r--usr/local/www/firewall_nat_out_edit.php7
-rw-r--r--usr/local/www/firewall_rules_edit.php7
-rw-r--r--usr/local/www/firewall_schedule_edit.php7
-rw-r--r--usr/local/www/firewall_virtual_ip_edit.php7
-rw-r--r--usr/local/www/index.php8
-rw-r--r--usr/local/www/interfaces.php7
-rw-r--r--usr/local/www/interfaces_bridge_edit.php7
-rw-r--r--usr/local/www/interfaces_gif_edit.php11
-rw-r--r--usr/local/www/interfaces_gre_edit.php11
-rw-r--r--usr/local/www/interfaces_lagg_edit.php7
-rw-r--r--usr/local/www/interfaces_ppps_edit.php46
-rw-r--r--usr/local/www/interfaces_qinq.php2
-rw-r--r--usr/local/www/interfaces_vlan_edit.php7
-rw-r--r--usr/local/www/interfaces_wireless_edit.php7
-rw-r--r--usr/local/www/javascript/NetUtils.js114
-rw-r--r--usr/local/www/load_balancer_monitor_edit.php7
-rw-r--r--usr/local/www/load_balancer_pool_edit.php7
-rw-r--r--usr/local/www/load_balancer_virtual_server_edit.php15
-rw-r--r--usr/local/www/services_captiveportal_vouchers.php7
-rw-r--r--usr/local/www/services_dhcp_edit.php7
-rw-r--r--usr/local/www/services_dhcpv6_edit.php7
-rw-r--r--usr/local/www/services_dnsmasq_domainoverride_edit.php7
-rw-r--r--usr/local/www/services_dnsmasq_edit.php7
-rw-r--r--usr/local/www/services_unbound_acls.php7
-rw-r--r--usr/local/www/services_unbound_domainoverride_edit.php7
-rw-r--r--usr/local/www/services_unbound_host_edit.php7
-rw-r--r--usr/local/www/services_wol_edit.php7
-rw-r--r--usr/local/www/system_advanced_sysctl.php7
-rw-r--r--usr/local/www/system_gateway_groups_edit.php7
-rw-r--r--usr/local/www/system_gateways_edit.php7
-rwxr-xr-xusr/local/www/system_hasync.php7
-rw-r--r--usr/local/www/system_routes_edit.php7
-rw-r--r--usr/local/www/vpn_l2tp_users_edit.php7
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc6
39 files changed, 258 insertions, 183 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php
index d78c500..638d1f1 100755
--- a/usr/local/www/firewall_aliases_edit.php
+++ b/usr/local/www/firewall_aliases_edit.php
@@ -52,7 +52,11 @@ require_once("shaper.inc");
$pgtitle = array(gettext("Firewall"), gettext("Aliases"), gettext("Edit"));
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');
+}
// Keywords not allowed in names
$reserved_keywords = array("all", "pass", "block", "out", "queue", "max", "min", "pptp", "pppoe", "L2TP", "OpenVPN", "IPsec");
@@ -273,6 +277,7 @@ if ($_POST) {
$wrongaliases = "";
$desc_fmt_err_found = false;
$alias_address_count = 0;
+ $input_addresses = array();
// First trim and expand the input data.
// Users can paste strings like "10.1.2.0/24 10.3.0.0/16 9.10.11.0/24" into an address box.
@@ -663,8 +668,8 @@ function update_box_type() {
typesel_change();
add_alias_control(this);
}
- document.getElementById ("addressnetworkport").firstChild.data = "{$url_str}";
- document.getElementById ("onecolumn").firstChild.data = "{$url_str}";
+ document.getElementById ("addressnetworkport").firstChild.data = "{$urltable_str}";
+ document.getElementById ("onecolumn").firstChild.data = "{$urltable_str}";
document.getElementById ("twocolumn").firstChild.data = "{$update_freq_str}";
document.getElementById ("threecolumn").firstChild.data = "";
document.getElementById ("threecolumn").style.display = 'none';
@@ -676,8 +681,8 @@ function update_box_type() {
typesel_change();
add_alias_control(this);
}
- document.getElementById ("addressnetworkport").firstChild.data = "{$url_str}";
- document.getElementById ("onecolumn").firstChild.data = "{$url_str}";
+ document.getElementById ("addressnetworkport").firstChild.data = "{$urltable_ports_str}";
+ document.getElementById ("onecolumn").firstChild.data = "{$urltable_ports_str}";
document.getElementById ("twocolumn").firstChild.data = "{$update_freq_str}";
document.getElementById ("threecolumn").firstChild.data = "";
document.getElementById ("threecolumn").style.display = 'none';
@@ -851,6 +856,7 @@ if (empty($tab)) {
<td width="78%">
<input id="submit" name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
</td>
</tr>
</table>
diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php
index 09a2b79..868f5eb 100755
--- a/usr/local/www/firewall_aliases_import.php
+++ b/usr/local/www/firewall_aliases_import.php
@@ -49,7 +49,11 @@ require("shaper.inc");
$pgtitle = array(gettext("Firewall"), gettext("Aliases"), gettext("Bulk import"));
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php');
+}
// Add all Load balance names to reserved_keywords
if (is_array($config['load_balancer']['lbpool'])) {
@@ -66,7 +70,7 @@ if (!is_array($config['aliases']['alias'])) {
}
$a_aliases = &$config['aliases']['alias'];
-if ($_POST['aliasimport'] <> "") {
+if ($_POST) {
$reqdfields = explode(" ", "name aliasimport");
$reqdfieldsn = array(gettext("Name"), gettext("Aliases"));
@@ -220,6 +224,7 @@ include("head.inc");
<td width="78%">
<input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
</td>
</tr>
</table>
diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php
index 37c25ca..e415015 100644
--- a/usr/local/www/firewall_nat_1to1_edit.php
+++ b/usr/local/www/firewall_nat_1to1_edit.php
@@ -46,7 +46,11 @@ require_once("interfaces.inc");
require_once("filter.inc");
require("shaper.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_nat_1to1.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_nat_1to1.php');
+}
$specialsrcdst = explode(" ", "any pptp pppoe l2tp openvpn");
$ifdisp = get_configured_interface_with_descr();
@@ -564,6 +568,7 @@ if ($input_errors) {
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_1to1[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 7015f65..db8a174 100644
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -46,7 +46,11 @@ require_once("itemid.inc");
require_once("filter.inc");
require("shaper.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_nat.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_nat.php');
+}
$specialsrcdst = explode(" ", "any (self) pptp pppoe l2tp openvpn");
$ifdisp = get_configured_interface_with_descr();
@@ -970,6 +974,7 @@ include("fbegin.inc"); ?>
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_nat[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/firewall_nat_npt_edit.php b/usr/local/www/firewall_nat_npt_edit.php
index e4b5818..addddd2 100644
--- a/usr/local/www/firewall_nat_npt_edit.php
+++ b/usr/local/www/firewall_nat_npt_edit.php
@@ -59,7 +59,11 @@ require_once("interfaces.inc");
require_once("filter.inc");
require("shaper.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_nat_npt.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_nat_npt.php');
+}
$ifdisp = get_configured_interface_with_descr();
foreach ($ifdisp as $kif => $kdescr) {
@@ -294,6 +298,7 @@ include("head.inc");
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_npt[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php
index 6471516..e99cebb 100644
--- a/usr/local/www/firewall_nat_out_edit.php
+++ b/usr/local/www/firewall_nat_out_edit.php
@@ -46,7 +46,11 @@ require("guiconfig.inc");
require_once("filter.inc");
require("shaper.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_nat_out.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_nat_out.php');
+}
if (!is_array($config['nat']['outbound'])) {
$config['nat']['outbound'] = array();
@@ -865,6 +869,7 @@ function poolopts_change() {
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php
if (isset($id) && $a_out[$id]):
?>
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index fa4a8eb..b0af4cc 100644
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -46,7 +46,11 @@ require("guiconfig.inc");
require_once("filter.inc");
require("shaper.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_rules.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_rules.php');
+}
function is_posnumericint($arg) {
// Note that to be safe we do not allow any leading zero - "01", "007"
@@ -1907,6 +1911,7 @@ $has_updated_time = (isset($a_filter[$id]['updated']) && is_array($a_filter[$id]
&nbsp;<br />&nbsp;
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_filter[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<input name="tracker" type="hidden" value="<?=htmlspecialchars($pconfig['tracker']);?>">
diff --git a/usr/local/www/firewall_schedule_edit.php b/usr/local/www/firewall_schedule_edit.php
index c0b46c0..e7c4bca 100644
--- a/usr/local/www/firewall_schedule_edit.php
+++ b/usr/local/www/firewall_schedule_edit.php
@@ -62,7 +62,11 @@ require_once("shaper.inc");
$pgtitle = array(gettext("Firewall"), gettext("Schedules"), gettext("Edit"));
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_schedule.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_schedule.php');
+}
$dayArray = array (gettext('Mon'), gettext('Tues'), gettext('Wed'), gettext('Thur'), gettext('Fri'), gettext('Sat'), gettext('Sun'));
$monthArray = array (gettext('January'), gettext('February'), gettext('March'), gettext('April'), gettext('May'), gettext('June'), gettext('July'), gettext('August'), gettext('September'), gettext('October'), gettext('November'), gettext('December'));
@@ -1131,6 +1135,7 @@ EOD;
<td width="85%">
<input id="submit" name="submit" type="submit" onclick="return checkForRanges();" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_schedules[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php
index 709f10c..6021115 100644
--- a/usr/local/www/firewall_virtual_ip_edit.php
+++ b/usr/local/www/firewall_virtual_ip_edit.php
@@ -55,7 +55,11 @@ require("guiconfig.inc");
require_once("filter.inc");
require("shaper.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_virtual_ip.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_virtual_ip.php');
+}
if (!is_array($config['virtualip']['vip'])) {
$config['virtualip']['vip'] = array();
@@ -538,6 +542,7 @@ function typesel_change() {
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_vip[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index 4de2852..ba39623 100644
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -170,13 +170,15 @@ if (file_exists('/conf/needs_package_sync')) {
## If it is the first time webConfigurator has been
## accessed since initial install show this stuff.
if (file_exists('/conf/trigger_initial_wizard')) {
+ $lang_code = system_get_language_code();
+ $lang_codeset = system_get_language_codeset();
echo <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="<?=system_get_language_code();?>" xml:lang="<?=system_get_language_code();?>">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang_code" xml:lang="$lang_code">
<head>
<title>{$g['product_name']}.localdomain - {$g['product_name']} first time setup</title>
- <meta http-equiv="Content-Type" content="text/html; charset=<?=system_get_language_codeset();?>" />
+ <meta http-equiv="Content-Type" content="text/html; charset=$lang_codeset" />
<link rel="stylesheet" type="text/css" href="/niftycssprintCode.css" media="print" />
<script type="text/javascript">var theme = "{$g['theme']}"</script>
<script type="text/javascript" src="/themes/{$g['theme']}/loader.js"></script>
@@ -223,7 +225,7 @@ if ($fd) {
preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or
preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or
preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches) or
- preg_match("/^aesni.: (.*?),/", $dmesgl, $matches)) {
+ preg_match("/^aesni.: <(.*?)>/", $dmesgl, $matches)) {
$hwcrypto = $matches[1];
break;
}
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 73f23d1..760d386 100644
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -55,7 +55,11 @@ require_once("rrd.inc");
require_once("vpn.inc");
require_once("xmlparse_attr.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces.php');
+}
// Get configured interface list
$ifdescrs = get_configured_interface_with_descr(false, true);
@@ -3696,6 +3700,7 @@ $types6 = array("none" => gettext("None"), "staticv6" => gettext("Static IPv6"),
<br />
<input id="save" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input id="cancel" type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<input name="if" type="hidden" id="if" value="<?=htmlspecialchars($if);?>" />
<?php if ($wancfg['if'] == $a_ppps[$pppid]['if']) : ?>
<input name="ppp_port" type="hidden" value="<?=htmlspecialchars($pconfig['port']);?>" />
diff --git a/usr/local/www/interfaces_bridge_edit.php b/usr/local/www/interfaces_bridge_edit.php
index cef2493..1787ca1 100644
--- a/usr/local/www/interfaces_bridge_edit.php
+++ b/usr/local/www/interfaces_bridge_edit.php
@@ -41,7 +41,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_bridge.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_bridge.php');
+}
if (!is_array($config['bridges']['bridged'])) {
$config['bridges']['bridged'] = array();
@@ -691,6 +695,7 @@ function show_source_port_range() {
<input type="hidden" name="bridgeif" value="<?=htmlspecialchars($pconfig['bridgeif']); ?>" />
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_bridges[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/interfaces_gif_edit.php b/usr/local/www/interfaces_gif_edit.php
index 76a24ed..2870c79 100644
--- a/usr/local/www/interfaces_gif_edit.php
+++ b/usr/local/www/interfaces_gif_edit.php
@@ -41,7 +41,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_gif.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_gif.php');
+}
if (!is_array($config['gifs']['gif'])) {
$config['gifs']['gif'] = array();
@@ -77,8 +81,8 @@ if ($_POST) {
$pconfig = $_POST;
/* input validation */
- $reqdfields = explode(" ", "if tunnel-remote-addr tunnel-remote-net tunnel-local-addr");
- $reqdfieldsn = array(gettext("Parent interface,Local address, Remote tunnel address, Remote tunnel network, Local tunnel address"));
+ $reqdfields = explode(" ", "if remote-addr tunnel-local-addr tunnel-remote-addr tunnel-remote-net");
+ $reqdfieldsn = array(gettext("Parent interface"), gettext("gif remote address"), gettext("gif tunnel local address"), gettext("gif tunnel remote address"), gettext("gif tunnel remote netmask"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -255,6 +259,7 @@ include("head.inc");
<input type="hidden" name="gifif" value="<?=htmlspecialchars($pconfig['gifif']); ?>" />
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_gifs[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/interfaces_gre_edit.php b/usr/local/www/interfaces_gre_edit.php
index 474e57b..a6cde04 100644
--- a/usr/local/www/interfaces_gre_edit.php
+++ b/usr/local/www/interfaces_gre_edit.php
@@ -42,7 +42,11 @@
require("guiconfig.inc");
require_once("functions.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_gre.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_gre.php');
+}
if (!is_array($config['gres']['gre'])) {
$config['gres']['gre'] = array();
@@ -76,8 +80,8 @@ if ($_POST) {
$pconfig = $_POST;
/* input validation */
- $reqdfields = explode(" ", "if tunnel-remote-addr tunnel-remote-net tunnel-local-addr");
- $reqdfieldsn = array(gettext("Parent interface"), gettext("Local address"), gettext("Remote tunnel address"), gettext("Remote tunnel network"), gettext("Local tunnel address"));
+ $reqdfields = explode(" ", "if remote-addr tunnel-local-addr tunnel-remote-addr tunnel-remote-net");
+ $reqdfieldsn = array(gettext("Parent interface"), gettext("Remote tunnel endpoint IP address"), gettext("Local tunnel IP address"), gettext("Remote tunnel IP address"), gettext("Remote tunnel network"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
@@ -245,6 +249,7 @@ include("head.inc");
<input type="hidden" name="greif" value="<?=htmlspecialchars($pconfig['greif']); ?>" />
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_gres[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/interfaces_lagg_edit.php b/usr/local/www/interfaces_lagg_edit.php
index c7894a6..d548160 100644
--- a/usr/local/www/interfaces_lagg_edit.php
+++ b/usr/local/www/interfaces_lagg_edit.php
@@ -41,7 +41,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_lagg.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_lagg.php');
+}
if (!is_array($config['laggs']['lagg'])) {
$config['laggs']['lagg'] = array();
@@ -261,6 +265,7 @@ include("head.inc");
<input type="hidden" name="laggif" value="<?=htmlspecialchars($pconfig['laggif']); ?>" />
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_laggs[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php
index 035f915..2a7eaf9 100644
--- a/usr/local/www/interfaces_ppps_edit.php
+++ b/usr/local/www/interfaces_ppps_edit.php
@@ -46,7 +46,11 @@
require("guiconfig.inc");
require("functions.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_ppps.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_ppps.php');
+}
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
@@ -266,21 +270,23 @@ if ($_POST) {
}
}
- foreach ($_POST['interfaces'] as $iface) {
- if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) {
- $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."), $iface);
- }
- if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) {
- $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."), $iface);
- }
- if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) {
- $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."), $iface);
- }
- if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) {
- $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."), $iface);
- }
- if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) {
- $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."), $iface);
+ if (is_array($_POST['interfaces'])) {
+ foreach ($_POST['interfaces'] as $iface) {
+ if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) {
+ $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."), $iface);
+ }
+ if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) {
+ $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."), $iface);
+ }
+ if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) {
+ $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."), $iface);
+ }
+ if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) {
+ $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."), $iface);
+ }
+ if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) {
+ $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."), $iface);
+ }
}
}
@@ -484,7 +490,12 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
mwexec("/bin/mkdir -p /var/spool/lock");
}
// $serialports = pfSense_get_modem_devices();
- $serialports = glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE);
+ // Match files in /dev starting with "cua" then:
+ // [a-zA-Z] = any single alpha character e.g. like "cuau"
+ // [0-9] = a digit from 0 to 9
+ // stuff in {} = the various possible digit and dot combinations to allow an optional 2nd digit, dot, followed by 1 or 2 optional digits
+ // This supports up to 100 device numbers (0 to 99), e.g. cuau0 cuau1 ... cuau10 cuau11 ... cuau99 and also possibilities like cuau1.1 cuau1.11 cuau11.1 cuau11.11
+ $serialports = glob("/dev/cua[a-zA-Z][0-9]{,.[0-9],.[0-9][0-9],[0-9],[0-9].[0-9],[0-9].[0-9][0-9]}", GLOB_BRACE);
$serport_count = 0;
foreach ($serialports as $port) {
$serport_count++;
@@ -878,6 +889,7 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE"
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<input name="ptpid" type="hidden" value="<?=htmlspecialchars($pconfig['ptpid']);?>" />
<?php if (isset($id) && $a_ppps[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
diff --git a/usr/local/www/interfaces_qinq.php b/usr/local/www/interfaces_qinq.php
index f088862..dac5801 100644
--- a/usr/local/www/interfaces_qinq.php
+++ b/usr/local/www/interfaces_qinq.php
@@ -67,8 +67,6 @@ if ($_GET['act'] == "del") {
/* check if still in use */
if (qinq_inuse($id)) {
$input_errors[] = gettext("This QinQ cannot be deleted because it is still being used as an interface.");
- } elseif (empty($a_qinqs[$id]['vlanif']) || !does_interface_exist($a_qinqs[$id]['vlanif'])) {
- $input_errors[] = gettext("QinQ interface does not exist");
} else {
$qinq =& $a_qinqs[$id];
diff --git a/usr/local/www/interfaces_vlan_edit.php b/usr/local/www/interfaces_vlan_edit.php
index 05940ad..dd9f1a7 100644
--- a/usr/local/www/interfaces_vlan_edit.php
+++ b/usr/local/www/interfaces_vlan_edit.php
@@ -42,7 +42,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_vlan.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_vlan.php');
+}
if (!is_array($config['vlans']['vlan'])) {
$config['vlans']['vlan'] = array();
@@ -219,6 +223,7 @@ include("head.inc");
<input type="hidden" name="vlanif" value="<?=htmlspecialchars($pconfig['vlanif']); ?>" />
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_vlans[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/interfaces_wireless_edit.php b/usr/local/www/interfaces_wireless_edit.php
index ab206f0..6ccce5c 100644
--- a/usr/local/www/interfaces_wireless_edit.php
+++ b/usr/local/www/interfaces_wireless_edit.php
@@ -41,7 +41,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_wireless.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_wireless.php');
+}
if (!is_array($config['wireless'])) {
$config['wireless'] = array();
@@ -213,6 +217,7 @@ include("head.inc");
<input type="hidden" name="cloneif" value="<?=htmlspecialchars($pconfig['cloneif']); ?>" />
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_clones[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/javascript/NetUtils.js b/usr/local/www/javascript/NetUtils.js
deleted file mode 100644
index b1c9ffb..0000000
--- a/usr/local/www/javascript/NetUtils.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- NetUtils.js
- part of pfSense (https://www.pfsense.org)
- Various helper functions for IPv6 support.
-
- Copyright (C) 2007 Simon Cornelius P. Umacob <simoncpu@gmail.com>
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-function NetUtils_changeIPVersionMask(field, version) {
- switch(version){
- case 'IPv4':
- NetUtils_clearOptions(document.getElementById(field));
- NetUtils_loadMaskIPv4(document.getElementById(field), 32);
-
- break;
- case 'IPv6':
- NetUtils_clearOptions(document.getElementById(field));
- NetUtils_loadMaskIPv6(document.getElementById(field), 64);
-
- break;
- case 'IPv4_net':
- NetUtils_clearOptions(document.getElementById(field));
- NetUtils_loadMaskIPv4(document.getElementById(field), 32, 1, 31);
-
- break;
- case 'IPv6_net':
- NetUtils_clearOptions(document.getElementById(field));
- NetUtils_loadMaskIPv6(document.getElementById(field), 64, 1, 63);
-
- break;
- }
-}
-
-function NetUtils_clearOptions(obj) {
- var len = obj.length;
-
- for (var i = 0; i < len; i++) {
- obj[0] = null;
- }
-}
-
-function NetUtils_loadMaskIPv4(obj, sel, min, max) {
- var min,
- max,
- j = 0;
-
- min = min == undefined ? 1 : min;
- max = max == undefined ? 32 : max;
-
- for (var i = max; i >= min; i--) {
- obj[j] = new Option(i, i);
- if (sel == i) {
- obj[j].selected = true;
- }
- j++;
- }
-}
-
-function NetUtils_loadMaskIPv6(obj, sel, min, max) {
- var min,
- max,
- j = 0;
-
- min = min == undefined ? 1 : min;
- max = max == undefined ? 64 : max;
-
- if ((max % 4) != 0) {
- obj[j++] = new Option(max, max);
-
- /**
- * NOTE: This solution is a kludge.
- * If you have a better way, don't hesitate
- * to change this. Please send patches. :)
- */
- for (var i = 1; i <= 3; i++) {
- if (((max - i) % 4) == 0) {
- max = max - i;
- break;
- }
- }
- }
-
- for (var i = max; i >= min; i -= 4) {
- obj[j] = new Option(i, i);
- if (sel == i) {
- obj[j].selected = true;
- }
- j++;
- }
-}
-
diff --git a/usr/local/www/load_balancer_monitor_edit.php b/usr/local/www/load_balancer_monitor_edit.php
index 45a5dab..532136b 100644
--- a/usr/local/www/load_balancer_monitor_edit.php
+++ b/usr/local/www/load_balancer_monitor_edit.php
@@ -42,7 +42,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_monitor.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_monitor.php');
+}
if (!is_array($config['load_balancer']['monitor_type'])) {
$config['load_balancer']['monitor_type'] = array();
@@ -372,6 +376,7 @@ function updateType(t) {
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_monitor[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php
index 91aef71..cf5c72f 100644
--- a/usr/local/www/load_balancer_pool_edit.php
+++ b/usr/local/www/load_balancer_pool_edit.php
@@ -44,7 +44,11 @@ require("guiconfig.inc");
require_once("filter.inc");
require_once("util.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_pool.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_pool.php');
+}
if (!is_array($config['load_balancer']['lbpool'])) {
$config['load_balancer']['lbpool'] = array();
@@ -350,6 +354,7 @@ function clearcombo() {
<br />
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="AllServers('serversSelect', true); AllServers('serversDisabledSelect', true);" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_pool[$id] && $_GET['act'] != 'dup'): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/load_balancer_virtual_server_edit.php b/usr/local/www/load_balancer_virtual_server_edit.php
index 5326b99..39bc6c9 100644
--- a/usr/local/www/load_balancer_virtual_server_edit.php
+++ b/usr/local/www/load_balancer_virtual_server_edit.php
@@ -43,7 +43,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_virtual_server.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/load_balancer_virtual_server.php');
+}
if (!is_array($config['load_balancer']['virtual_server'])) {
$config['load_balancer']['virtual_server'] = array();
@@ -61,7 +65,7 @@ if (isset($id) && $a_vs[$id]) {
$pconfig = $a_vs[$id];
} else {
// Sane defaults
- $pconfig['mode'] = 'redirect';
+ $pconfig['mode'] = 'redirect_mode';
}
$changedesc = gettext("Load Balancer: Virtual Server:") . " ";
@@ -73,14 +77,14 @@ if ($_POST) {
/* input validation */
switch ($pconfig['mode']) {
- case "redirect": {
+ case "redirect_mode": {
$reqdfields = explode(" ", "ipaddr name mode");
$reqdfieldsn = array(gettext("IP Address"), gettext("Name"), gettext("Mode"));
break;
}
- case "relay": {
+ case "relay_mode": {
$reqdfields = explode(" ", "ipaddr name mode relay_protocol");
- $reqdfieldsn = array(gettext("IP Address"), gettext("Name"), gettext("Relay Protocol"));
+ $reqdfieldsn = array(gettext("IP Address"), gettext("Name"), gettext("Mode"), gettext("Relay Protocol"));
break;
}
}
@@ -296,6 +300,7 @@ include("head.inc");
<td align="left" valign="bottom" width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Submit"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_vs[$id] && $_GET['act'] != 'dup'): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php
index decea80..0bc7dae 100644
--- a/usr/local/www/services_captiveportal_vouchers.php
+++ b/usr/local/www/services_captiveportal_vouchers.php
@@ -50,7 +50,11 @@ require("shaper.inc");
require("captiveportal.inc");
require_once("voucher.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_captiveportal_vouchers.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_captiveportal_vouchers.php');
+}
$cpzone = $_GET['zone'];
if (isset($_POST['zone'])) {
@@ -683,6 +687,7 @@ function enable_change(enable_change) {
<input type="hidden" name="exponent" id="exponent" value="<?=$pconfig['exponent'];?>" />
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true); before_save();" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
</td>
</tr>
<tr>
diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php
index 4cdb2e0..1fc947b 100644
--- a/usr/local/www/services_dhcp_edit.php
+++ b/usr/local/www/services_dhcp_edit.php
@@ -60,7 +60,11 @@ if (!$g['services_dhcp_server_enable']) {
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcp.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcp.php');
+}
$if = $_GET['if'];
if ($_POST['if']) {
@@ -607,6 +611,7 @@ include("head.inc");
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_maps[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/services_dhcpv6_edit.php b/usr/local/www/services_dhcpv6_edit.php
index e581f20..2034049 100644
--- a/usr/local/www/services_dhcpv6_edit.php
+++ b/usr/local/www/services_dhcpv6_edit.php
@@ -54,7 +54,11 @@ function staticmaps_sort($ifgui) {
require_once('globals.inc');
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcpv6.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dhcpv6.php');
+}
if (!$g['services_dhcp_server_enable']) {
header("Location: /");
@@ -267,6 +271,7 @@ include("head.inc");
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_maps[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/services_dnsmasq_domainoverride_edit.php b/usr/local/www/services_dnsmasq_domainoverride_edit.php
index b992019..ca66b49 100644
--- a/usr/local/www/services_dnsmasq_domainoverride_edit.php
+++ b/usr/local/www/services_dnsmasq_domainoverride_edit.php
@@ -41,7 +41,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dnsmasq.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dnsmasq.php');
+}
if (!is_array($config['dnsmasq']['domainoverrides'])) {
$config['dnsmasq']['domainoverrides'] = array();
@@ -180,6 +184,7 @@ include("head.inc");
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_domainOverrides[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/services_dnsmasq_edit.php b/usr/local/www/services_dnsmasq_edit.php
index 879675f..4b4c1c4 100644
--- a/usr/local/www/services_dnsmasq_edit.php
+++ b/usr/local/www/services_dnsmasq_edit.php
@@ -56,7 +56,11 @@ function hosts_sort() {
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dnsmasq.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_dnsmasq.php');
+}
if (!is_array($config['dnsmasq']['hosts'])) {
$config['dnsmasq']['hosts'] = array();
@@ -328,6 +332,7 @@ include("head.inc");
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_hosts[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/services_unbound_acls.php b/usr/local/www/services_unbound_acls.php
index 092d641..3a51b3e 100644
--- a/usr/local/www/services_unbound_acls.php
+++ b/usr/local/www/services_unbound_acls.php
@@ -33,7 +33,11 @@
require("guiconfig.inc");
require("unbound.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_unbound_acls.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_unbound_acls.php');
+}
if (!is_array($config['unbound']['acls'])) {
$config['unbound']['acls'] = array();
@@ -323,6 +327,7 @@ include("head.inc");
&nbsp;<br />&nbsp;
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
</td>
</tr>
</table>
diff --git a/usr/local/www/services_unbound_domainoverride_edit.php b/usr/local/www/services_unbound_domainoverride_edit.php
index 05b5812..28a8424 100644
--- a/usr/local/www/services_unbound_domainoverride_edit.php
+++ b/usr/local/www/services_unbound_domainoverride_edit.php
@@ -43,7 +43,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_unbound.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_unbound.php');
+}
if (!is_array($config['unbound']['domainoverrides'])) {
$config['unbound']['domainoverrides'] = array();
@@ -166,6 +170,7 @@ include("head.inc");
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_domainOverrides[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/services_unbound_host_edit.php b/usr/local/www/services_unbound_host_edit.php
index 522feb3..6b365f2 100644
--- a/usr/local/www/services_unbound_host_edit.php
+++ b/usr/local/www/services_unbound_host_edit.php
@@ -42,7 +42,11 @@
##|*MATCH=services_unbound_host_edit.php*
##|-PRIV
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_unbound.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_unbound.php');
+}
function hostcmp($a, $b) {
return strcasecmp($a['host'], $b['host']);
@@ -320,6 +324,7 @@ include("head.inc");
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_hosts[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/services_wol_edit.php b/usr/local/www/services_wol_edit.php
index 66481bf..031ba83 100644
--- a/usr/local/www/services_wol_edit.php
+++ b/usr/local/www/services_wol_edit.php
@@ -52,7 +52,11 @@ function wol_sort() {
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_wol.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/services_wol.php');
+}
if (!is_array($config['wol']['wolentry'])) {
$config['wol']['wolentry'] = array();
@@ -163,6 +167,7 @@ include("head.inc");
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_wol[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/system_advanced_sysctl.php b/usr/local/www/system_advanced_sysctl.php
index be12322..1992cc1 100644
--- a/usr/local/www/system_advanced_sysctl.php
+++ b/usr/local/www/system_advanced_sysctl.php
@@ -45,7 +45,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_advanced_sysctl.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_advanced_sysctl.php');
+}
if (!is_array($config['sysctl'])) {
$config['sysctl'] = array();
@@ -283,6 +287,7 @@ include("head.inc");
<td width="78%">
<input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_tunable[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/system_gateway_groups_edit.php b/usr/local/www/system_gateway_groups_edit.php
index 81b6dfa..c5fcc3b 100644
--- a/usr/local/www/system_gateway_groups_edit.php
+++ b/usr/local/www/system_gateway_groups_edit.php
@@ -44,7 +44,11 @@ require("guiconfig.inc");
require_once("ipsec.inc");
require_once("vpn.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_gateway_groups.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_gateway_groups.php');
+}
if (!is_array($config['gateways']['gateway_group'])) {
$config['gateways']['gateway_group'] = array();
@@ -361,6 +365,7 @@ jQuery(function ($) {
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_gateway_groups[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 3d0bc78..af5e7cb 100644
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -43,7 +43,11 @@
require("guiconfig.inc");
require("pkg-utils.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_gateways.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_gateways.php');
+}
$a_gateways = return_gateways_array(true, false, true);
$a_gateways_arr = array();
@@ -927,6 +931,7 @@ function enable_change() {
<td width="78%">
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" onclick="enable_change()" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_gateways[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/system_hasync.php b/usr/local/www/system_hasync.php
index 1ce81e6..8ebde1f 100755
--- a/usr/local/www/system_hasync.php
+++ b/usr/local/www/system_hasync.php
@@ -42,7 +42,11 @@
require("guiconfig.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_hasync.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_hasync.php');
+}
if (!is_array($config['hasync'])) {
$config['hasync'] = array();
@@ -347,6 +351,7 @@ include("head.inc");
<input name="id" type="hidden" value="0" />
<input name="Submit" type="submit" class="formbtn" value="Save" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
</td>
</tr>
</table>
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php
index 5d57622..a64580b 100644
--- a/usr/local/www/system_routes_edit.php
+++ b/usr/local/www/system_routes_edit.php
@@ -45,7 +45,11 @@ require_once("filter.inc");
require_once("util.inc");
require_once("gwlb.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_routes.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/system_routes.php');
+}
if (!is_array($config['staticroutes']['route'])) {
$config['staticroutes']['route'] = array();
@@ -358,6 +362,7 @@ include("head.inc");
<?php if (isset($id) && $a_routes[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
</td>
</tr>
</table>
diff --git a/usr/local/www/vpn_l2tp_users_edit.php b/usr/local/www/vpn_l2tp_users_edit.php
index e132606..6cedc02 100644
--- a/usr/local/www/vpn_l2tp_users_edit.php
+++ b/usr/local/www/vpn_l2tp_users_edit.php
@@ -56,7 +56,11 @@ function l2tp_users_sort() {
require("guiconfig.inc");
require_once("vpn.inc");
-$referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/vpn_l2tp_users.php');
+if (isset($_POST['referer'])) {
+ $referer = $_POST['referer'];
+} else {
+ $referer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/vpn_l2tp_users.php');
+}
if (!is_array($config['l2tp']['user'])) {
$config['l2tp']['user'] = array();
@@ -193,6 +197,7 @@ include("head.inc");
<td width="78%">
<input id="submit" name="Submit" type="submit" class="formbtn" value="<?=gettext('Save');?>" />
<input type="button" class="formbtn" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=$referer;?>'" />
+ <input name="referer" type="hidden" value="<?=$referer;?>" />
<?php if (isset($id) && $a_secret[$id]): ?>
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
<?php endif; ?>
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
index 5bb3ca5..3f68869 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -607,6 +607,12 @@ function step3_stepsubmitphpaction() {
$config['ezshaper']['step3']['address'] = $_POST['upstream_sip_server'];
if ($_POST['enable'] == 'on')
$config['ezshaper']['step3']['enable'] = 'on';
+ if (!empty($_POST['provider'])) {
+ $VoIPproviders = array("Generic", "VoicePulse", "Asterisk", "Panasonic");
+ if (in_array($_POST['provider'], $VoIPproviders)) {
+ $config['ezshaper']['step3']['provider'] = $_POST['provider'];
+ }
+ }
for ($i = 0; $i < $localint; $i++) {
$config['ezshaper']['step3']["local{$i}download"] = $_POST["local{$i}download"];
$config['ezshaper']['step3']["local{$i}downloadspeed"] = $_POST["local{$i}downloadspeed"];
OpenPOWER on IntegriCloud