From dc68f3e64befd48825ea897fcfc010dbe24d7ccd Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 4 Aug 2011 17:50:07 +0000 Subject: Unbreak row_helpers and add some more checks to prevent errors --- config/snort/snort.inc | 2 -- config/snort/snort_interfaces_global.php | 2 +- config/snort/snort_interfaces_whitelist_edit.php | 37 ++++++++++++++---------- 3 files changed, 23 insertions(+), 18 deletions(-) (limited to 'config') 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; ?> -
+ + ' . $pgtitle . '

';}?> + + +' . $pgtitle . '

';}?>
-
+   - - + + + + + + -- cgit v1.2.3