diff options
author | robiscool <robrob2626@yahoo.com> | 2011-07-30 14:14:02 -0700 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2011-07-30 14:14:02 -0700 |
commit | 42ca7a370212d1173809fb164019e1d27efa8f4f (patch) | |
tree | f82969d11a490679ccf7488ff5f1b14db3989797 /config/snort-dev/snort_json_post.php | |
parent | ddac412c976f6f5ffc54a9fbbc247c91df80c4df (diff) | |
download | pfsense-packages-42ca7a370212d1173809fb164019e1d27efa8f4f.tar.gz pfsense-packages-42ca7a370212d1173809fb164019e1d27efa8f4f.tar.bz2 pfsense-packages-42ca7a370212d1173809fb164019e1d27efa8f4f.zip |
snort-dev, update db clean up code add snort_rulesets_ips tab
Diffstat (limited to 'config/snort-dev/snort_json_post.php')
-rw-r--r-- | config/snort-dev/snort_json_post.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/config/snort-dev/snort_json_post.php b/config/snort-dev/snort_json_post.php index 721ee0cc..11b055c1 100644 --- a/config/snort-dev/snort_json_post.php +++ b/config/snort-dev/snort_json_post.php @@ -103,7 +103,7 @@ if ($_POST['snortSidRuleEdit'] == 1) { // row from db by uuid if ($_POST['snortSaveRuleSets'] == 1) { - if ($_POST['ifaceTab'] == 'snort_rulesets') { + if ($_POST['ifaceTab'] == 'snort_rulesets' || $_POST['ifaceTab'] == 'snort_rulesets_ips') { function snortSaveRuleSetsRulesetsFunc() { @@ -111,8 +111,13 @@ if ($_POST['snortSaveRuleSets'] == 1) { unset($_POST['snortSaveRuleSets']); unset($_POST['ifaceTab']); - snortJsonReturnCode(snortSql_updateRuleSetList()); - build_snort_settings($_POST['uuid']); + // save to database + snortJsonReturnCode(snortSql_updateRuleSetList()); + + // only build if uuid is valid + if (!empty($_POST['uuid'])) { + build_snort_settings($_POST['uuid']); + } } snortSaveRuleSetsRulesetsFunc(); } @@ -151,8 +156,14 @@ if ($_POST['RMlistDelRow'] == 1) { // rm ruledb and files if ($_POST['RMlistTable'] == 'Snortrules') { - $snortRuleDir = "/usr/local/etc/snort/snortDBrules/DB/{$_POST['RMlistUuid']}"; + // remove db tables vals + snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSets', 'rdbuuid', $_POST['RMlistUuid']); + snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleGenIps', 'rdbuuid', $_POST['RMlistUuid']); + snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSetsIps', 'rdbuuid', $_POST['RMlistUuid']); + snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSigs', 'rdbuuid', $_POST['RMlistUuid']); + // remove dir + $snortRuleDir = "/usr/local/etc/snort/snortDBrules/DB/{$_POST['RMlistUuid']}"; exec('/bin/rm -r ' . $snortRuleDir); } |