summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2004-12-18 21:08:26 +0000
committerScott Ullrich <sullrich@pfsense.org>2004-12-18 21:08:26 +0000
commita8df0181a7c5fdeac31c60847efc0594a041405c (patch)
tree79d82f179ee10772b1181fdbe3e71258fb9aeecb /usr
parent788ff7cb05fffb5ed3152aa0dcc8aad8cc8fcb57 (diff)
downloadpfsense-a8df0181a7c5fdeac31c60847efc0594a041405c.zip
pfsense-a8df0181a7c5fdeac31c60847efc0594a041405c.tar.gz
Add arraynum flag which is used when there is an array of values.
Example would be: <dnsserver>X.X.X.X</dnsserver> <dnsserver>Y.Y.Y.Y</dnsserver>
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/wizard.php10
-rw-r--r--usr/local/www/wizards/setup_wizard.xml2
2 files changed, 12 insertions, 0 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index ef35c0c..5e4c99c 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -134,6 +134,16 @@ function update_config_field($field, $updatetext, $unset) {
$name = ereg_replace(" ", "", $name);
$name = strtolower($name);
+ if($field['bindstofield'] <> "") {
+ $arraynum = "";
+ $field_conv = "";
+ $field_split = split("->", $field['bindstofield']);
+ if($field['arraynum'] <> "") $arraynum = "[" . $field['arraynum'] . "]";
+ foreach ($field_split as $f) $field_conv .= "['" . $f . "']";
+ $toeval = "\$value = \$config" . $field_conv . $arraynum . ";";
+ eval($toeval);
+ }
+
if ($field['type'] == "input") {
echo "<tr><td align='right'>";
echo $field['name'];
diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml
index 1eca410..ac827d9 100644
--- a/usr/local/www/wizards/setup_wizard.xml
+++ b/usr/local/www/wizards/setup_wizard.xml
@@ -23,11 +23,13 @@
<bindstofield>system->dnsserver</bindstofield>
<!-- we must unset the fields because this is an array. -->
<unsetfield>yes</unsetfield>
+ <arraynum>0</arraynum>
</field>
<field>
<name>Secondary DNS Server</name>
<type>input</type>
<bindstofield>system->dnsserver</bindstofield>
+ <arraynum>1</arraynum>
</field>
<field>
<name>Next</name>
OpenPOWER on IntegriCloud