From d25293151743c44ffef9121d10c0568f04066054 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 10 Jul 2012 07:20:09 +0000 Subject: Some validation and whitespace fixes --- config/snort/snort_interfaces_whitelist.php | 149 +++++++++++++--------------- 1 file changed, 69 insertions(+), 80 deletions(-) (limited to 'config/snort/snort_interfaces_whitelist.php') diff --git a/config/snort/snort_interfaces_whitelist.php b/config/snort/snort_interfaces_whitelist.php index 805fffe9..56d6cdc2 100644 --- a/config/snort/snort_interfaces_whitelist.php +++ b/config/snort/snort_interfaces_whitelist.php @@ -39,28 +39,23 @@ require_once("guiconfig.inc"); require_once("/usr/local/pkg/snort/snort.inc"); - +if (!is_array($config['installedpackages']['snortglobal']['whitelist'])) + $config['installedpackages']['snortglobal']['whitelist'] = array(); if (!is_array($config['installedpackages']['snortglobal']['whitelist']['item'])) -$config['installedpackages']['snortglobal']['whitelist']['item'] = array(); - -//aliases_sort(); << what ? + $config['installedpackages']['snortglobal']['whitelist']['item'] = array(); $a_whitelist = &$config['installedpackages']['snortglobal']['whitelist']['item']; -if (isset($config['installedpackages']['snortglobal']['whitelist']['item'])) { +if (isset($config['installedpackages']['snortglobal']['whitelist']['item'])) $id_gen = count($config['installedpackages']['snortglobal']['whitelist']['item']); -}else{ +else $id_gen = '0'; -} - -$d_whitelistdirty_path = '/var/run/snort_whitelist.dirty'; if ($_GET['act'] == "del") { if ($a_whitelist[$_GET['id']]) { /* make sure rule is not being referenced by any nat or filter rules */ - unset($a_whitelist[$_GET['id']]); write_config(); - filter_configure(); + sync_snort_package_config(); header("Location: /snort/snort_interfaces_whitelist.php"); exit; } @@ -68,21 +63,17 @@ if ($_GET['act'] == "del") { $pgtitle = "Services: Snort: Whitelist"; include_once("head.inc"); - ?> ' . $pgtitle . '

';} +if ($savemsg) print_info_box($savemsg); ?> -' . $pgtitle . '

';}?> - - -

You must apply the changes in order for them to take effect.");?> - -

+ - - -
-
- - - - - - - - - - - - - - - - - - - - + + +
File NameValuesDescription
- - -   - - - - - - -
-
- - - - - -
 
+
+ + + + + + + + $list): ?> + + + + + + + + + +
File NameValuesDescription
+ + +   + + + + + + +
+
+ + + + + +
 
-- cgit v1.2.3