From 3eab27426aa39497d87a9fb768fd860f924e10be Mon Sep 17 00:00:00 2001 From: Daniel Stefan Haischt Date: Sat, 15 Jul 2006 22:16:04 +0000 Subject: - initial version of the DSPAM package --- packages/dspam/www/dspam-settings-overr.php | 197 ++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 packages/dspam/www/dspam-settings-overr.php (limited to 'packages/dspam/www/dspam-settings-overr.php') diff --git a/packages/dspam/www/dspam-settings-overr.php b/packages/dspam/www/dspam-settings-overr.php new file mode 100644 index 00000000..d938b313 --- /dev/null +++ b/packages/dspam/www/dspam-settings-overr.php @@ -0,0 +1,197 @@ + + foo + foo desc + + + bar + bar desc + +*/ + +if (!is_array($config['installedpackages']['dspam']['config'][0]['override'])) { + $config['installedpackages']['dspam']['config'][0]['override'] = array(); +} + +$t_overr = &$config['installedpackages']['dspam']['config'][0]['override']; + +/* ID is only set if the user wants to edit an existing entry */ +$id = $_GET['id']; +$sectionid = $_GET['sectionid']; +if (isset($_POST['id'])) + $id = $_POST['id']; +if (isset($_POST['sectionid'])) + $sectionid = $_POST['sectionid']; + +if (isset($id) && $t_overr[$id]) { + $pconfig['value'] = $t_overr[$id]['value']; + $pconfig['descr'] = $t_overr[$id]['descr']; +} else { + $pconfig['value'] = $_GET['ovalue']; + $pconfig['descr'] = $_GET['descr']; +} + +if ($_POST) { + + unset($input_errors); + $pconfig = $_POST; + + /* input validation */ + $reqdfields = explode(" ", "ovalue"); + $reqdfieldsn = explode(",", "DSPAM Override Value"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + /* check for overlaps */ + foreach ($t_overr as $over) { + if (isset($id) && ($t_overr[$id]) && ($t_overr[$id] === $over)) { + continue; + } + if ($over['value'] == $_POST['ovalue']) { + $input_errors[] = gettext("This override value exists."); + break; + } + } + + /* if this is an AJAX caller then handle via JSON */ + if(isAjax() && is_array($input_errors)) { + input_errors2Ajax($input_errors); + exit; + } + + if (!$input_errors) { + $over = array(); + $over['value'] = $_POST['ovalue']; + $over['descr'] = $_POST['descr']; + + if (isset($id) && $t_overr[$id]) + $t_overr[$id] = $over; + else + $t_overr[] = $over; + + write_config(); + + $retval = 0; + config_lock(); + $retval = dspam_configure(); + config_unlock(); + + $savemsg = get_std_save_message($retval); + + isset($sectionid) ? $header = "dspam-settings.php?sectionid={$sectionid}" : $header = "dspam-settings.php"; + pfSenseHeader($header); + exit; + } +} + +/* if ajax is calling, give them an update message */ +if(isAjax()) + print_info_box_np($savemsg); + +include("head.inc"); +/* put your custom HTML head content here */ +/* using some of the $pfSenseHead function calls */ +echo $pfSenseHead->getHTML(); + +?> + + + + +
+
+ + + + + + + + + + + + + +
+ +
+ +
  + "> " onclick="history.back()"> + + + + + + +
+
+ +getHTML(); +?> + + + + + + + + +
Access denied for:
+ + + + -- cgit v1.2.3