diff options
author | Ermal <eri@pfsense.org> | 2011-08-04 17:50:07 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-08-04 17:58:47 +0000 |
commit | dc68f3e64befd48825ea897fcfc010dbe24d7ccd (patch) | |
tree | bd24ced1e301bc530c4a5517e872c88d94e2013b | |
parent | 7840c6f995002cd26f5fc9e0e48aed7f7f2cb5a6 (diff) | |
download | pfsense-packages-dc68f3e64befd48825ea897fcfc010dbe24d7ccd.tar.gz pfsense-packages-dc68f3e64befd48825ea897fcfc010dbe24d7ccd.tar.bz2 pfsense-packages-dc68f3e64befd48825ea897fcfc010dbe24d7ccd.zip |
Unbreak row_helpers and add some more checks to prevent errors
-rw-r--r-- | config/snort/snort.inc | 2 | ||||
-rw-r--r-- | config/snort/snort_interfaces_global.php | 2 | ||||
-rw-r--r-- | config/snort/snort_interfaces_whitelist_edit.php | 37 |
3 files changed, 23 insertions, 18 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 4647fc34..65086621 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -813,7 +813,6 @@ function snort_rm_blocked_install_cron($should_install) unset($config['cron']['item'][$x]); break; } - configure_cron(); } /* func to install snort update */ @@ -896,7 +895,6 @@ function snort_rules_up_install_cron($should_install) { unset($config['cron']['item'][$x]); break; } - configure_cron(); } function sync_snort_package_remove_old() diff --git a/config/snort/snort_interfaces_global.php b/config/snort/snort_interfaces_global.php index d9336fd3..37d389da 100644 --- a/config/snort/snort_interfaces_global.php +++ b/config/snort/snort_interfaces_global.php @@ -99,8 +99,8 @@ if (!$input_errors) { snort_rules_up_install_cron($snort_rules_up_false); + configure_cron(); write_config(); - $savemsg = get_std_save_message($retval); /* create whitelist and homenet file then sync files */ sync_snort_package_empty(); diff --git a/config/snort/snort_interfaces_whitelist_edit.php b/config/snort/snort_interfaces_whitelist_edit.php index 8c54ac5a..aa81e2bd 100644 --- a/config/snort/snort_interfaces_whitelist_edit.php +++ b/config/snort/snort_interfaces_whitelist_edit.php @@ -41,18 +41,20 @@ require_once("/usr/local/pkg/snort/snort_gui.inc"); require_once("/usr/local/pkg/snort/snort.inc"); if (!is_array($config['installedpackages']['snortglobal']['whitelist']['item'])) -$config['installedpackages']['snortglobal']['whitelist']['item'] = array(); + $config['installedpackages']['snortglobal']['whitelist']['item'] = array(); $a_whitelist = &$config['installedpackages']['snortglobal']['whitelist']['item']; $id = $_GET['id']; if (isset($_POST['id'])) -$id = $_POST['id']; - + $id = $_POST['id']; +if (is_null($id)) { + header("Location: /snort/snort_interfaces_whitelist.php"); + exit; +} /* gen uuid for each iface !inportant */ if ($config['installedpackages']['snortglobal']['whitelist']['item'][$id]['uuid'] == '') { - //$snort_uuid = gen_snort_uuid(strrev(uniqid(true))); $whitelist_uuid = 0; while ($whitelist_uuid > 65535 || $whitelist_uuid == 0) { $whitelist_uuid = mt_rand(1, 65535); @@ -231,9 +233,11 @@ include_once("head.inc"); include("fbegin.inc"); echo $snort_general_css; ?> -<div class="body2"><script type="text/javascript" - src="/snort/javascript/row_helper.js"></script> <input type='hidden' - name='address_type' value='textbox' /> <script type="text/javascript"> +<div class="body2"> +<script type="text/javascript" src="/javascript/row_helper.js"></script> + <input type='hidden' name='address_type' value='textbox' /> + <script type="text/javascript"> + rowname[0] = "address"; rowtype[0] = "textbox"; rowsize[0] = "30"; @@ -241,13 +245,15 @@ echo $snort_general_css; rowname[1] = "detail"; rowtype[1] = "textbox"; rowsize[1] = "50"; -</script> <?if($pfsense_stable == 'yes'){echo '<p class="pgtitle">' . $pgtitle . '</p>';}?> +</script> + +<?if($pfsense_stable == 'yes'){echo '<p class="pgtitle">' . $pgtitle . '</p>';}?> <?php if ($input_errors) print_input_errors($input_errors); ?> <div id="inputerrors"></div> -<form action="snort_interfaces_whitelist_edit.php?id=<?=$id?>" - method="post" name="iform" id="iform"><?php +<form action="snort_interfaces_whitelist_edit.php" method="post" name="iform" id="iform"> +<?php /* Display Alert message */ if ($input_errors) { print_input_errors($input_errors); // TODO: add checks @@ -448,11 +454,12 @@ echo $snort_general_css; </tr> <tr> <td width="22%" valign="top"> </td> - <td width="78%"><input id="submit" name="submit" type="submit" - class="formbtn" value="Save" /> <input id="cancelbutton" - name="cancelbutton" type="button" class="formbtn" value="Cancel" - onclick="history.back()" /> <?php if (isset($id) && $a_whitelist[$id]): ?> - <input name="id" type="hidden" value="<?=$id;?>" /> <?php endif; ?> + <td width="78%"> + <input id="submit" name="submit" type="submit" class="formbtn" value="Save" /> + <input id="cancelbutton" name="cancelbutton" type="button" class="formbtn" value="Cancel" onclick="history.back()" /> + <?php if (isset($id) && $a_whitelist[$id]): ?> + <input name="id" type="hidden" value="<?=$id;?>" /> + <?php endif; ?> </td> </tr> </table> |