summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2004-12-23 23:06:26 +0000
committerScott Ullrich <sullrich@pfsense.org>2004-12-23 23:06:26 +0000
commitb1919dd0079116313382a006b9a98db3f0a7ebdf (patch)
tree1e4e88427214e018e39e54563954a402ab37e2cf /usr
parent748f4e8a0f9a26d1c853b4aae2e53a3999370663 (diff)
downloadpfsense-b1919dd0079116313382a006b9a98db3f0a7ebdf.zip
pfsense-b1919dd0079116313382a006b9a98db3f0a7ebdf.tar.gz
Correctly restore SelectedType selection on wizard load and correctly save out the selected type setting.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/wizard.php18
-rw-r--r--usr/local/www/wizards/setup_wizard.xml17
2 files changed, 21 insertions, 14 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index c67f13b..6a24413 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -153,15 +153,15 @@ if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") {
$name = strtolower($name);
if($field['bindstofield'] <> "") {
- $arraynum = "";
- $field_conv = "";
- $field_split = split("->", $field['bindstofield']);
- // arraynum is used in cases where there is an array of the same field
- // name such as dnsserver (2 of them)
- if($field['arraynum'] <> "") $arraynum = "[" . $field['arraynum'] . "]";
- foreach ($field_split as $f) $field_conv .= "['" . $f . "']";
- $toeval = "\$value = \$config" . $field_conv . $arraynum . ";";
- eval($toeval);
+ $arraynum = "";
+ $field_conv = "";
+ $field_split = split("->", $field['bindstofield']);
+ // arraynum is used in cases where there is an array of the same field
+ // name such as dnsserver (2 of them)
+ if($field['arraynum'] <> "") $arraynum = "[" . $field['arraynum'] . "]";
+ foreach ($field_split as $f) $field_conv .= "['" . $f . "']";
+ $toeval = "\$value = \$config" . $field_conv . $arraynum . ";";
+ eval($toeval);
}
if(!$field['combinefieldsend'])
diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml
index 875fe2b..f8f02b5 100644
--- a/usr/local/www/wizards/setup_wizard.xml
+++ b/usr/local/www/wizards/setup_wizard.xml
@@ -1742,6 +1742,7 @@
} else {
selectedItem = 0;
}
+ document.forms[0].selectedtype.selectedIndex = selectedItem;
enableitems(selectedItem);
</javascriptafterformdisplay>
<fields>
@@ -2195,11 +2196,7 @@
<value>32</value>
</option>
</options>
- <stepsubmitbeforesave>
- if(!$_POST['selectedtype'] == "Static") {
- $_POST['ipaddress'] = $_POST['selectedtype'];
- }
- </stepsubmitbeforesave>
+
</field>
<field>
<name>PPTP Remote IP Address</name>
@@ -2266,6 +2263,16 @@
<type>submit</type>
</field>
</fields>
+ <stepsubmitbeforesave>
+ echo " IN STEP SUBMIT BEFORE SAVE!" ;
+ echo " " . $_POST['selectedtype'];
+ if($_POST['selectedtype'] == "Static") { } else {
+ echo $_POST['selectedtype'] . " ";
+ $_POST['ipaddress'] = $_POST['selectedtype'];
+ $config['interfaces']['wan']['ipaddr'] = $_POST['selectedtype'];
+ write_config();
+ }
+ </stepsubmitbeforesave>
</step>
<step>
<id>5</id>
OpenPOWER on IntegriCloud