From 55eddd7accf2c5f9b0f52b22a010c4c4b7c130d1 Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Fri, 6 Feb 2009 19:18:00 -0600 Subject: mv packages to config dir to match web layout --- config/dspam/www/dspam-settings-tuser.php | 195 ++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 config/dspam/www/dspam-settings-tuser.php (limited to 'config/dspam/www/dspam-settings-tuser.php') diff --git a/config/dspam/www/dspam-settings-tuser.php b/config/dspam/www/dspam-settings-tuser.php new file mode 100644 index 00000000..57e9ec71 --- /dev/null +++ b/config/dspam/www/dspam-settings-tuser.php @@ -0,0 +1,195 @@ + + foo + + + bar + +*/ + +if (!is_array($config['installedpackages']['dspam']['config'][0]['tuser'])) { + $config['installedpackages']['dspam']['config'][0]['tuser'] = array(); +} + +$t_users = &$config['installedpackages']['dspam']['config'][0]['tuser']; + +/* 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_users[$id]) { + $pconfig['name'] = $t_users[$id]['name']; + $pconfig['descr'] = $t_users[$id]['descr']; +} else { + $pconfig['name'] = $_GET['uuname']; + $pconfig['descr'] = $_GET['descr']; +} + +if ($_POST) { + + unset($input_errors); + $pconfig = $_POST; + + /* input validation */ + $reqdfields = explode(" ", "uuname"); + $reqdfieldsn = explode(",", "Unix username"); + + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + + /* check for overlaps */ + foreach ($t_users as $user) { + if (isset($id) && ($t_users[$id]) && ($t_users[$id] === $user)) { + continue; + } + if ($user['name'] == $_POST['uuname']) { + $input_errors[] = gettext("This username already 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) { + $user = array(); + $user['name'] = $_POST['uuname']; + $user['descr'] = $_POST['descr']; + + if (isset($id) && $t_users[$id]) + $t_users[$id] = $user; + else + $t_users[] = $user; + + 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