summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/firewall_rules.php8
-rwxr-xr-xusr/local/www/services_captiveportal_hostname_edit.php15
-rwxr-xr-xusr/local/www/xmlrpc.php10
3 files changed, 16 insertions, 17 deletions
diff --git a/usr/local/www/firewall_rules.php b/usr/local/www/firewall_rules.php
index 600348d..7eb96d6 100755
--- a/usr/local/www/firewall_rules.php
+++ b/usr/local/www/firewall_rules.php
@@ -162,9 +162,11 @@ if ($config['pptpd']['mode'] == "server")
if(have_ruleint_access("pptp"))
$iflist['pptp'] = "PPTP VPN";
-foreach ($config['pppoes']['pppoe'] as $pppoes)
- if (($pppoes['mode'] == 'server') && have_ruleint_access("pppoe"))
- $iflist['pppoe'] = "PPPoE Server";
+if (is_array($config['pppoes']['pppoe'])) {
+ foreach ($config['pppoes']['pppoe'] as $pppoes)
+ if (($pppoes['mode'] == 'server') && have_ruleint_access("pppoe"))
+ $iflist['pppoe'] = "PPPoE Server";
+}
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
diff --git a/usr/local/www/services_captiveportal_hostname_edit.php b/usr/local/www/services_captiveportal_hostname_edit.php
index b6e580a..a199341 100755
--- a/usr/local/www/services_captiveportal_hostname_edit.php
+++ b/usr/local/www/services_captiveportal_hostname_edit.php
@@ -133,19 +133,8 @@ if ($_POST) {
write_config();
- if (isset($config['captiveportal']['enable']) && is_module_loaded("ipfw.ko")) {
- $rules = "";
- $hostname = gethostbyname($oldip);
- if($hostname)
- for ($i = 3; $i < 10; $i++)
- $rules .= "table {$i} delete {$hostname}\n";
- $hostname = gethostbyname($ip);
- if(is_ipaddr($hostname))
- $rules .= captiveportal_allowedip_configure_entry($hostname);
- file_put_contents("{$g['tmp_path']}/allowedhostname_tmp{$id}", $rules);
- mwexec("/sbin/ipfw -q {$g['tmp_path']}/allowedhostname_tmp{$id}");
- @unlink("{$g['tmp_path']}/allowedhostname_tmp{$id}");
- }
+ if (isset($config['captiveportal']['enable']) && is_module_loaded("ipfw.ko"))
+ captiveportal_init_rules();
header("Location: services_captiveportal_hostname.php");
exit;
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index ea0166b..ebb3a24 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -171,7 +171,7 @@ function restore_config_section_xmlrpc($raw_params) {
// Then add ipalias and proxyarp types already defined on the backup
if (is_array($vipbackup)) {
foreach ($vipbackup as $vip) {
- if (($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp'))
+ if ((($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp')) && substr($vip['interface'], 0, 3) != "vip")
array_unshift($config['virtualip']['vip'], $vip);
}
}
@@ -226,8 +226,16 @@ function merge_config_section_xmlrpc($raw_params) {
foreach ($config['virtualip']['vip'] as $vip)
interface_vip_bring_down($vip);
}
+ $vipbackup = $config['virtualip']['vip'];
}
$config = array_merge_recursive_unique($config, $params[0]);
+ // Then add ipalias and proxyarp types already defined on the backup
+ if (is_array($vipbackup)) {
+ foreach ($vipbackup as $vip) {
+ if ((($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp')) && substr($vip['interface'], 0, 3) != "vip")
+ array_unshift($config['virtualip']['vip'], $vip);
+ }
+ }
$mergedkeys = implode(",", array_keys($params[0]));
write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client.");
interfaces_vips_configure();
OpenPOWER on IntegriCloud