diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2004-12-17 20:14:25 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2004-12-17 20:14:25 +0000 |
commit | da7bf505b55330a2bd3d987a8a96ab3e56c55ea0 (patch) | |
tree | 518ddea8ccebfff2730907219fc55b5a762757a0 /usr | |
parent | 052492815fb5ddc17afa8fc188263e4a93b422ae (diff) | |
download | pfsense-da7bf505b55330a2bd3d987a8a96ab3e56c55ea0.zip pfsense-da7bf505b55330a2bd3d987a8a96ab3e56c55ea0.tar.gz |
Forced commit.
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/pkg_edit.php | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index 8ed44d0..a407672 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -47,7 +47,7 @@ if($xml == "") { print_info_box_np("ERROR: Could not open " . $xml . "."); die; } else { - $pkg = parse_xml_config_pkg("/usr/local/pkg/" . $xml, "packagegui"); + $pkg = parse_xml_config_pkg("/usr/local/pkg/" . $xml, "pfSenseWizard"); } $package_name = $pkg['menu']['name']; @@ -55,6 +55,20 @@ $section = $pkg['menu']['section']; $config_path = $pkg['configpath']; $title = $section . ": Edit " . $package_name; +$id = $_GET['id']; +if (isset($_POST['id'])) + $id = $_POST['id']; + +$a_pkg = &$config['installedpackages']['package']; + +if (isset($id) && $a_pkg[$id]) { + foreach ($pkg['fields'] as $fields) { + $fieldname = $pconfig['$fields']['fieldname']; + $fieldvalue = $_POST[$fieldname]; + $pconfig[$fieldname] = $fieldvalue; + } +} + if ($_POST) { if($_POST['act'] == "del") { if($pkg['custom_delete_php_command']) { @@ -70,6 +84,25 @@ if ($_POST) { } } +// store values in xml configration file. +if (!$input_errors) { + $pkgarr = array(); + + if (isset($id) && $a_pkg[$id]) + $a_pkg[$id] = $pkgarr; + else + $a_pkg[] = $pkgarr; + + foreach ($pkg['fields'] as $fields) { + $pkgarr[$fields['fieldname']] = $fields['fieldname']; + $pkgarr[$fields['fieldvalue']] = $_POST[$fields['fieldname']]; + } + + $config['installedpackages']['package']['config'][] = $filterent; + + write_config(); +} + ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> |