diff options
author | Renato Botelho <renato.botelho@bluepex.com> | 2010-08-03 11:06:39 -0300 |
---|---|---|
committer | Renato Botelho <renato.botelho@bluepex.com> | 2010-08-03 11:06:39 -0300 |
commit | 4256d115c9328d3498451e7777f5724fed5f071b (patch) | |
tree | 0939bc82557d26824bec04c198ced8a036c8ac09 /usr/local/www/interfaces.php | |
parent | f6a2c6ab840b6b98c74e68e3f0a31eaa46267ba0 (diff) | |
parent | 073a2697dd86a8dece8dafa28b71084a547ba31e (diff) | |
download | pfsense-4256d115c9328d3498451e7777f5724fed5f071b.zip pfsense-4256d115c9328d3498451e7777f5724fed5f071b.tar.gz |
Merge remote branch 'mainline/master' into 3_interfaces
Conflicts:
usr/local/www/diag_nanobsd.php
usr/local/www/diag_packet_capture.php
usr/local/www/interfaces.php
Diffstat (limited to 'usr/local/www/interfaces.php')
-rwxr-xr-x | usr/local/www/interfaces.php | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 7df2c3f..888aa02 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -71,7 +71,7 @@ if (!is_array($config['ppps']['ppp'])) $a_ppps = &$config['ppps']['ppp']; function remove_bad_chars($string) { - return preg_replace('/[^a-z|_|0-9]/i','',$string); + return preg_replace('/[^a-z_0-9]/i','',$string); } if (!is_array($config['gateways']['gateway_item'])) @@ -215,6 +215,8 @@ $pconfig['mtu'] = $wancfg['mtu']; /* Wireless interface? */ if (isset($wancfg['wireless'])) { + /* Sync first to be sure it displays the actual settings that will be used */ + interface_sync_wireless_clones($wancfg, false); /* Get wireless modes */ $wlanif = get_real_interface($if); if (!does_interface_exist($wlanif)) @@ -228,6 +230,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 +669,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 +705,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'])) @@ -1453,13 +1461,13 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" <td width="22%" valign="top" class="vncell"><?=gettext("Advanced"); ?></td> <?php if (isset($pconfig['pppid'])): ?> <td width="78%" class="vtable"> - <a href="/interfaces_ppps_edit.php?id=<?=htmlspecialchars($pconfig['pppid']);?>" class="navlnk"><?=gettext("Click here"); ?> </a> - <?=gettext("for additional PPtP and L2tP configuration options. Save first if you made changes"); ?>. + <a href="/interfaces_ppps_edit.php?id=<?=htmlspecialchars($pconfig['pppid']);?>" class="navlnk"><?=gettext("Click here");?></a> + <?=gettext("for additional PPTP and L2TP configuration options. Save first if you made changes");?>. </td> <? else: ?> <td width="78%" class="vtable"> - <a href="/interfaces_ppps_edit.php" class="navlnk"><?=gettext("Click here"); ?> </a> - <?=gettext("for advanced PPtP and L2tP configuration options"); ?>. + <a href="/interfaces_ppps_edit.php" class="navlnk"><?=gettext("Click here");?></a> + <?=gettext("for advanced PPTP and L2TP configuration options");?>. </td> <? endif; ?> </tr> @@ -1477,6 +1485,13 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" <td colspan="2" valign="top" class="listtopic"><?=gettext("Common wireless configuration - Settings apply to all wireless networks on"); ?> <?=$wlanbaseif;?>.</td> </tr> <tr> + <td valign="top" class="vncell"><?=gettext("Persist common settings");?></td> + <td class="vtable"> + <input name="persistcommonwireless" type="checkbox" value="yes" class="formfld" id="persistcommonwireless" <? if ($pconfig['persistcommonwireless']) echo "checked";?>> + <br/><?=gettext("Enabling this preserves the common wireless configuration through interface deletions and reassignments");?>. + </td> + </tr> + <tr> <td valign="top" class="vncellreq"><?=gettext("Standard"); ?></td> <td class="vtable"> <select name="standard" class="formselect" id="standard"> @@ -1615,7 +1630,7 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" <td colspan="2" valign="top" height="16"></td> </tr> <tr> - <td colspan="2" valign="top" class="listtopic"><?=gettext("Wireless configuration"); ?></td> + <td colspan="2" valign="top" class="listtopic"><?=gettext("Network-specific wireless configuration");?></td> </tr> <tr> <td valign="top" class="vncellreq"><?=gettext("Mode"); ?></td> @@ -1979,10 +1994,7 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" } } <?php - if ($if == "wan" || $if == "lan") - echo "\$('allcfg').show();\n"; - else - echo "show_allcfg(document.iform.enable);"; + echo "show_allcfg(document.iform.enable);"; echo "updateType('{$pconfig['type']}');\n"; ?> </script> |