summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/interfaces.inc12
-rwxr-xr-xusr/local/www/interfaces.php15
2 files changed, 21 insertions, 6 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 388b47d..34cbac2 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1843,11 +1843,13 @@ function interface_sync_wireless_clones(&$ifcfg, $sync_changes = false) {
}
// Read or write settings at shared area
- foreach ($shared_settings as $setting) {
- if ($sync_changes) {
- $config['wireless']['interfaces'][$baseif][$setting] = $ifcfg['wireless'][$setting];
- } else if (isset($config['wireless']['interfaces'][$baseif][$setting])) {
- $ifcfg['wireless'][$setting] = $config['wireless']['interfaces'][$baseif][$setting];
+ if (isset($config['wireless']['interfaces'][$baseif])) {
+ foreach ($shared_settings as $setting) {
+ if ($sync_changes) {
+ $config['wireless']['interfaces'][$baseif][$setting] = $ifcfg['wireless'][$setting];
+ } else if (isset($config['wireless']['interfaces'][$baseif][$setting])) {
+ $ifcfg['wireless'][$setting] = $config['wireless']['interfaces'][$baseif][$setting];
+ }
}
}
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index ca8a000..8822262 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -228,6 +228,7 @@ if (isset($wancfg['wireless'])) {
$wl_regdomains_attr = &$wl_regdomain_xml_attr['regulatory-domains']['rd'];
$wl_countries = &$wl_regdomain_xml['country-codes']['country'];
$wl_countries_attr = &$wl_regdomain_xml_attr['country-codes']['country'];
+ $pconfig['persistcommonwireless'] = isset($config['wireless']['interfaces'][$wlanbaseif]);
$pconfig['standard'] = $wancfg['wireless']['standard'];
$pconfig['mode'] = $wancfg['wireless']['mode'];
$pconfig['protmode'] = $wancfg['wireless']['protmode'];
@@ -666,7 +667,7 @@ if ($_POST) {
} // end if($_POST)
function handle_wireless_post() {
- global $_POST, $config, $g, $wancfg, $if, $wl_countries_attr;
+ global $_POST, $config, $g, $wancfg, $if, $wl_countries_attr, $wlanbaseif;
if (!is_array($wancfg['wireless']))
$wancfg['wireless'] = array();
$wancfg['wireless']['standard'] = $_POST['standard'];
@@ -702,6 +703,11 @@ function handle_wireless_post() {
$wancfg['wireless']['auth_server_addr'] = $_POST['auth_server_addr'];
$wancfg['wireless']['auth_server_port'] = $_POST['auth_server_port'];
$wancfg['wireless']['auth_server_shared_secret'] = $_POST['auth_server_shared_secret'];
+ if ($_POST['persistcommonwireless'] == "yes") {
+ if (!is_array($config['wireless']['interfaces'][$wlanbaseif]))
+ $config['wireless']['interfaces'][$wlanbaseif] = array();
+ } else if (isset($config['wireless']['interfaces'][$wlanbaseif]))
+ unset($config['wireless']['interfaces'][$wlanbaseif]);
if ($_POST['hidessid_enable'] == "yes")
$wancfg['wireless']['hidessid']['enable'] = true;
else if (isset($wancfg['wireless']['hidessid']['enable']))
@@ -1477,6 +1483,13 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "ppp" =
<td colspan="2" valign="top" class="listtopic">Common wireless configuration - Settings apply to all wireless networks on <?=$wlanbaseif;?>.</td>
</tr>
<tr>
+ <td valign="top" class="vncell">Persist common settings</td>
+ <td class="vtable">
+ <input name="persistcommonwireless" type="checkbox" value="yes" class="formfld" id="persistcommonwireless" <? if ($pconfig['persistcommonwireless']) echo "checked";?>>
+ <br/>Enabling this preserves the common wireless configuration through interface deletions and reassignments.
+ </td>
+ </tr>
+ <tr>
<td valign="top" class="vncellreq">Standard</td>
<td class="vtable">
<select name="standard" class="formselect" id="standard">
OpenPOWER on IntegriCloud