"" and $field['type'] <> "submit") { $fieldname = $field['name']; $unset_fields = ""; $fieldname = ereg_replace(" ", "", $fieldname); $fieldname = strtolower($fieldname); // update field with posted values. if($field['unsetfield'] <> "") $unset_fields = "yes"; if($field['arraynum'] <> "") $arraynum = $field['arraynum']; if($field['bindstofield']) update_config_field( $field['bindstofield'], $_POST[$fieldname], $unset_fields, $arraynum, $field['type']); } } // run custom php code embedded in xml config. if($pkg['step'][$stepid]['stepsubmitphpaction'] <> "") { eval($pkg['step'][$stepid]['stepsubmitphpaction']); } write_config(); $stepid++; if($stepid > $totalsteps) $stepid = $totalsteps; } $title = $pkg['step'][$stepid]['title']; $description = $pkg['step'][$stepid]['description']; function update_config_field($field, $updatetext, $unset, $arraynum, $field_type) { global $config; $field_split = split("->",$field); foreach ($field_split as $f) $field_conv .= "['" . $f . "']"; if($field_conv == "") return; if($field_type == "checkbox" and $updatetext <> "on") { /* item is a checkbox, it should have the value "on" if it was checked */ $text = "unset(\$config" . $field_conv . ");"; eval($text); return; } if($field_type == "interfaces_selection") { $text = "unset(\$config" . $field_conv . ");"; eval($text); $text = "\$config" . $field_conv . " = \"" . $updatetext . "\";"; eval($text); return; } if($unset <> "") { $text = "unset(\$config" . $field_conv . ");"; eval($text); $text = "\$config" . $field_conv . "[" . $arraynum . "] = \"" . $updatetext . "\";"; eval($text); } else { if($arraynum <> "") { $text = "\$config" . $field_conv . "[" . $arraynum . "] = \"" . $updatetext . "\";"; } else { $text = "\$config" . $field_conv . " = \"" . $updatetext . "\";"; } eval($text); } } if($pkg['step'][$stepid]['stepbeforeformdisplay'] <> "") { // handle before form display event. // good for modifying posted values, etc. eval($pkg['step'][$stepid]['stepbeforeformdisplay']); } $pgtitle = array($title); include("head.inc"); ?> \n"; else echo ""; ?> "") { ?>
 
"; ?>

"; ?> "") { foreach ($pkg['step'][$stepid]['fields']['field'] as $field) { $value = $field['value']; $name = $field['name']; $name = ereg_replace(" ", "", $name); $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); if ($field['type'] == "checkbox") { $toeval = "if(isset(\$config" . $field_conv . $arraynum . ")) \$value = \" CHECKED\";"; eval($toeval); } } if(!$field['combinefieldsend']) echo ""; if ($field['type'] == "input") { if ($field['displayname']) { echo "\n"; } else if(!$field['dontdisplayname']) { echo "\n"; } if(!$field['dontcombinecells']) echo "\n"; } else if(!$field['dontdisplayname']) { echo "\n"; $inputaliases[] = $name; } if(!$field['dontcombinecells']) echo ""; echo "\n"; } if(!$field['dontcombinecells']) echo "\n"; } else if(!$field['dontdisplayname']) { echo "\n"; } if($field['size']) $size = " size='" . $field['size'] . "' "; if($field['multiple'] == "yes") $multiple = "MULTIPLE "; if(!$field['dontcombinecells']) echo "\n"; } else if(!$field['dontdisplayname']) { echo ""; } if(!$field['dontcombinecells']) echo "
 
 
" . fixup_string($title) . "
\n"; echo $field['displayname']; echo ":\n"; echo fixup_string($field['name']); echo ":\n"; echo "\n"; } else if ($field['type'] == "inputalias") { if ($field['displayname']) { echo "\n"; echo $field['displayname']; echo ":\n"; echo fixup_string($field['name']); echo ":\n"; echo "\n"; } else if($field['type'] == "interfaces_selection") { $size = ""; $multiple = ""; $name = strtolower($name); echo "\n"; echo fixup_string($field['displayname'] ? $field['displayname'] : $field['name']) . ":\n"; echo "\n"; if($field['size'] <> "") $size = "size=\"{$field['size']}\""; if($field['multiple'] <> "" and $field['multiple'] <> "0") { $multiple = "multiple=\"multiple\""; $name .= "[]"; } echo "\n"; } else if ($field['type'] == "password") { if(!$field['dontdisplayname']) { echo "\n"; echo fixup_string($field['name']); echo ":"; echo "\n"; } else if ($field['type'] == "select") { if ($field['displayname']) { echo "\n"; echo $field['displayname']; echo ":\n"; echo fixup_string($field['name']); echo ":\n"; $onchange = ""; foreach ($field['options']['option'] as $opt) { if($opt['enablefields'] <> "") { $onchange = "onchange=\"enableitems(this.selectedIndex);\" "; } } echo "\n"; } else if ($field['type'] == "textarea") { if ($field['displayname']) { echo "\n"; echo $field['displayname']; echo ":\n"; echo fixup_string($field['name']); echo ":"; echo "