diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2010-03-16 20:50:59 -0600 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2010-03-16 20:59:06 -0600 |
commit | 2843a3ec5d4a160646e496f3922266415151902a (patch) | |
tree | 2016d8ddea473176fe96ff2c83c1612110ee6bc0 /usr | |
parent | 2f27dffda9dbab1294334c7dc05244efa41e0d41 (diff) | |
download | pfsense-2843a3ec5d4a160646e496f3922266415151902a.zip pfsense-2843a3ec5d4a160646e496f3922266415151902a.tar.gz |
Add optional support for reading attributes to xmlparse.inc and move regdomain.xml parsing from regdomain.inc to xmlparse.inc.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/interfaces.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 959f448..9fd5d5c 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -52,7 +52,6 @@ require("filter.inc"); require("shaper.inc"); require("rrd.inc"); require("vpn.inc"); -require('regdomain.inc'); if ($_REQUEST['if']) { $if = $_REQUEST['if']; @@ -219,7 +218,11 @@ if (isset($wancfg['wireless'])) { interface_wireless_clone($wlanif, $wancfg); $wlanbaseif = interface_get_wireless_base($wancfg['if']); $wl_modes = get_wireless_modes($if); - $wl_regdomains = parse_xml_regdomain(); + $wl_regdomain_xml = parse_xml_regdomain($wl_regdomain_xml_attr); + $wl_regdomains = &$wl_regdomain_xml['regulatory-domains']['rd']; + $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['standard'] = $wancfg['wireless']['standard']; $pconfig['mode'] = $wancfg['wireless']['mode']; $pconfig['protmode'] = $wancfg['wireless']['protmode']; @@ -699,7 +702,7 @@ function handle_pppoe_reset() { } function handle_wireless_post() { - global $_POST, $config, $g, $wancfg, $if, $wl_regdomains; + global $_POST, $config, $g, $wancfg, $if, $wl_countries_attr; if (!is_array($wancfg['wireless'])) $wancfg['wireless'] = array(); $wancfg['wireless']['standard'] = $_POST['standard']; @@ -714,9 +717,9 @@ function handle_wireless_post() { $wancfg['wireless']['regcountry'] = $_POST['regcountry']; $wancfg['wireless']['reglocation'] = $_POST['reglocation']; if (!empty($wancfg['wireless']['regdomain']) && !empty($wancfg['wireless']['regcountry'])) { - foreach($wl_regdomains['country-codes']['country'] as $wl_country) { - if ($wancfg['wireless']['regcountry'] == $wl_country['attributes']['ID']) { - $wancfg['wireless']['regdomain'] = $wl_country['rd'][0]['attributes']['REF']; + foreach($wl_countries_attr as $wl_country) { + if ($wancfg['wireless']['regcountry'] == $wl_country['ID']) { + $wancfg['wireless']['regdomain'] = $wl_country['rd'][0]['REF']; break; } } @@ -1388,12 +1391,12 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" <select name="regdomain" class="formselect" id="regdomain"> <option <? if (empty($pconfig['regdomain'])) echo "selected"; ?> value="">Default</option> <?php - foreach($wl_regdomains['regulatory-domains']['rd'] as $wl_regdomain) { + foreach($wl_regdomains as $wl_regdomain_key => $wl_regdomain) { echo "<option "; - if ($pconfig['regdomain'] == $wl_regdomain['attributes']['ID']) { + if ($pconfig['regdomain'] == $wl_regdomains_attr[$wl_regdomain_key]['ID']) { echo "selected "; } - echo "value=\"{$wl_regdomain['attributes']['ID']}\">{$wl_regdomain['name']}</option>\n"; + echo "value=\"{$wl_regdomains_attr[$wl_regdomain_key]['ID']}\">{$wl_regdomain['name']}</option>\n"; } ?> </select> @@ -1402,12 +1405,12 @@ $types = array("none" => "None", "static" => "Static", "dhcp" => "DHCP", "pppoe" <select name="regcountry" class="formselect" id="regcountry"> <option <? if (empty($pconfig['regcountry'])) echo "selected"; ?> value="">Default</option> <?php - foreach($wl_regdomains['country-codes']['country'] as $wl_country) { + foreach($wl_countries as $wl_country_key => $wl_country) { echo "<option "; - if ($pconfig['regcountry'] == $wl_country['attributes']['ID']) { + if ($pconfig['regcountry'] == $wl_countries_attr[$wl_country_key]['ID']) { echo "selected "; } - echo "value=\"{$wl_country['attributes']['ID']}\">{$wl_country['name']} -- ({$wl_country['attributes']['ID']}, " . strtoupper($wl_country['rd'][0]['attributes']['REF']) . ")</option>\n"; + echo "value=\"{$wl_countries_attr[$wl_country_key]['ID']}\">{$wl_country['name']} -- ({$wl_countries_attr[$wl_country_key]['ID']}, " . strtoupper($wl_countries_attr[$wl_country_key]['rd'][0]['REF']) . ")</option>\n"; } ?> </select> |