summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErik Fonnesbeck <efonnes@gmail.com>2010-03-02 23:17:46 -0700
committerErik Fonnesbeck <efonnes@gmail.com>2010-03-02 23:17:46 -0700
commit651fff4fffd5fe5232f49e1d82ce6b1bbfc44d6b (patch)
treea65a6912ecf953bed931ab486193457491fe7225 /usr
parent597330aa2149f57d456f38704aea417a86af543c (diff)
downloadpfsense-651fff4fffd5fe5232f49e1d82ce6b1bbfc44d6b.zip
pfsense-651fff4fffd5fe5232f49e1d82ce6b1bbfc44d6b.tar.gz
Add more descriptive mode names to the error messages.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/guiconfig.inc3
-rwxr-xr-xusr/local/www/interfaces.php4
-rw-r--r--usr/local/www/interfaces_wireless.php9
-rw-r--r--usr/local/www/interfaces_wireless_edit.php2
4 files changed, 7 insertions, 11 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index b7966d4..b38b0e0 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -213,6 +213,9 @@ $medias = array("auto" => "autoselect", "100full" => "100BASE-TX full-duplex",
"100half" => "100BASE-TX half-duplex", "10full" => "10BASE-T full-duplex",
"10half" => "10BASE-T half-duplex");
+$wlan_modes = array("bss" => "Infrastructure (BSS)", "adhoc" => "Ad-hoc (IBSS)",
+ "hostap" => "Access Point");
+
/* platforms that support firmware updating */
$fwupplatforms = array('pfSense', 'net45xx', 'net48xx', 'generic-pc', 'embedded', 'wrap', 'nanobsd');
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 34919a0..5827234 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -782,7 +782,7 @@ function handle_wireless_post() {
}
function check_wireless_mode() {
- global $_POST, $config, $g, $wancfg, $if, $wlanif, $wlanbaseif, $old_wireless_mode, $input_errors;
+ global $_POST, $config, $g, $wlan_modes, $wancfg, $if, $wlanif, $wlanbaseif, $old_wireless_mode, $input_errors;
if ($wancfg['wireless']['mode'] == $_POST['mode'])
return;
@@ -801,7 +801,7 @@ function check_wireless_mode() {
$old_wireless_mode = $wancfg['wireless']['mode'];
$wancfg['wireless']['mode'] = $_POST['mode'];
if (!interface_wireless_clone("{$wlanif}_", $wancfg)) {
- $input_errors[] = "Unable to change mode to {$wancfg['wireless']['mode']}. You may already have the maximum number of wireless clones supported in this mode.";
+ $input_errors[] = "Unable to change mode to {$wlan_modes[$wancfg['wireless']['mode']]}. You may already have the maximum number of wireless clones supported in this mode.";
} else {
mwexec("/sbin/ifconfig {$wlanif}_ destroy");
}
diff --git a/usr/local/www/interfaces_wireless.php b/usr/local/www/interfaces_wireless.php
index 442b85b..f833fba 100644
--- a/usr/local/www/interfaces_wireless.php
+++ b/usr/local/www/interfaces_wireless.php
@@ -115,14 +115,7 @@ include("head.inc");
<?=htmlspecialchars($clone['cloneif']);?>
</td>
<td class="listr">
- <?php
- if ($clone['mode'] == 'bss')
- echo "Infrastructure (BSS)";
- else if ($clone['mode'] == 'adhoc')
- echo "Ad-hoc (IBSS)";
- else if ($clone['mode'] == 'hostap')
- echo "Access Point";
- ?>
+ <?= $wlan_modes[$clone['mode']]; ?>
</td>
<td class="listbg">
<?=htmlspecialchars($clone['descr']);?>&nbsp;
diff --git a/usr/local/www/interfaces_wireless_edit.php b/usr/local/www/interfaces_wireless_edit.php
index c3a25f1..6f65e0f 100644
--- a/usr/local/www/interfaces_wireless_edit.php
+++ b/usr/local/www/interfaces_wireless_edit.php
@@ -120,7 +120,7 @@ if ($_POST) {
}
if (!$input_errors) {
if (!interface_wireless_clone($clone['cloneif'], $clone)) {
- $input_errors[] = "Error creating interface with mode {$clone['mode']}. The {$clone['if']} interface may not support creating more clones with the selected mode.";
+ $input_errors[] = "Error creating interface with mode {$wlan_modes[$clone['mode']]}. The {$clone['if']} interface may not support creating more clones with the selected mode.";
} else {
if (isset($id) && $a_clones[$id]) {
if ($clone['if'] != $a_clones[$id]['if'])
OpenPOWER on IntegriCloud