diff options
author | robiscool <robrob2626@yahoo.com> | 2011-05-18 00:14:26 -0700 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2011-05-18 00:14:26 -0700 |
commit | bda6fd2c6306af23251a7b476c04c8adc62042ac (patch) | |
tree | 5bf1540f2910d80d6f0c705d232994920da1024e /config/snort-dev/snort_json_post.php | |
parent | b407b3896374abdeb6bf488e83a1f7a1b5b39639 (diff) | |
download | pfsense-packages-bda6fd2c6306af23251a7b476c04c8adc62042ac.tar.gz pfsense-packages-bda6fd2c6306af23251a7b476c04c8adc62042ac.tar.bz2 pfsense-packages-bda6fd2c6306af23251a7b476c04c8adc62042ac.zip |
snort-dev, Add more tabs update sqlight dbs
Diffstat (limited to 'config/snort-dev/snort_json_post.php')
-rw-r--r-- | config/snort-dev/snort_json_post.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/config/snort-dev/snort_json_post.php b/config/snort-dev/snort_json_post.php index 3fea91c0..2431beec 100644 --- a/config/snort-dev/snort_json_post.php +++ b/config/snort-dev/snort_json_post.php @@ -43,6 +43,25 @@ $snortJsonReturnCode_fail = ' } + + // row from db by uuid +if ($_POST['snortSaveRuleSets'] == 1) +{ + + // unset POSTs that are markers not in db + unset($_POST['snortSaveSettings']); + unset($_POST['ifaceTab']); + + if(snortSql_updateRuleSetList($_POST['dbName'], $_POST['dbTable'], $_POST['filenamcheckbox'], $_POST['ifaceuuid'])) + { + echo $snortJsonReturnCode_success; + return true; + }else{ + echo $snortJsonReturnCode_fail; + return false; + } + +} // END of rulesSets // row from db by uuid if ($_POST['RMlistDelRow'] == 1) @@ -161,6 +180,23 @@ if ($_POST['snortSaveSettings'] == 1) // convert textbox to base64 $_POST['configpassthru'] = base64_encode($_POST['configpassthru']); + + /* + * make dir for the new iface + * may need to move this as a func to new_snort,inc + */ + if (!is_dir('/usr/local/etc/snort/sn_' . $_POST['uuid'] . '_' . $_POST['interface'])) + { + $newSnortDirCraete = 'mkdir -p /usr/local/etc/snort/sn_' . $_POST['uuid'] . '_' . $_POST['interface']; + exec($newSnortDirCraete); + // NOTE: code only works on php5 + $listRulesDir = snortScanDirFilter('/usr/local/etc/snort/rules', '.rules'); + if (!empty($listRulesDir) && file_exists('/usr/local/etc/snort/base_rules.tar.gz')) + { + $newSnortDir = 'sn_' . $_POST['uuid'] . '_' . $_POST['interface']; + exec('/usr/bin/tar xvfz /usr/local/etc/snort/base_rules.tar.gz ' . '-C /usr/local/etc/snort/' . $newSnortDir); + } + } } |