diff options
author | robiscool <robrob2626@yahoo.com> | 2011-08-05 18:19:02 -0700 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2011-08-05 18:19:02 -0700 |
commit | 556474c5b9db2afff94d288870b203bed3ff2cfb (patch) | |
tree | b5bcd08949ad075974e7445c11edab323f4a4a6c /config/orionids-dev/snort_new.inc | |
parent | 3bd2e6738affb0c731993dcdc06d756e23a0dd24 (diff) | |
download | pfsense-packages-556474c5b9db2afff94d288870b203bed3ff2cfb.tar.gz pfsense-packages-556474c5b9db2afff94d288870b203bed3ff2cfb.tar.bz2 pfsense-packages-556474c5b9db2afff94d288870b203bed3ff2cfb.zip |
orionids-dev, fix db save changes, fix foward slash error on chrom and ie9, add no cache php code
Diffstat (limited to 'config/orionids-dev/snort_new.inc')
-rw-r--r-- | config/orionids-dev/snort_new.inc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/config/orionids-dev/snort_new.inc b/config/orionids-dev/snort_new.inc index 75535ab8..93de4a21 100644 --- a/config/orionids-dev/snort_new.inc +++ b/config/orionids-dev/snort_new.inc @@ -59,6 +59,7 @@ if (file_exists('/usr/local/pkg/snort/snortDBtemp')) { exec('/bin/cp /usr/local/pkg/snort/snortDBtemp /var/snort/snortDBtemp'); } + /* * make dir for the new iface, if iface exists or rule dir has changed redo soft link */ @@ -147,8 +148,9 @@ function createNewIfaceDir($pathToSnortDir, $newSnortDir) { function escapeJsonString($escapeString) { + // NOTE: foward slash has added spaces on each side ie and chrome were giving issues with $search = array('\\', '\n', '\r', '\u', '\t', '\f', '\b', '/', '"'); - $replace = array('\\\\', '\\n', '\\r', '\\u', '\\t', '\\f', '\\b', '\/', '\"'); + $replace = array('\\\\', '\\n', '\\r', '\\u', '\\t', '\\f', '\\b', ' \/ ', '\"'); $encoded_string = str_replace($search, $replace, $escapeString); return $encoded_string; @@ -412,7 +414,8 @@ function snortSql_updateRulesSigsIps() // if $listGenRules empty list defaults if (empty($listGenRules)) { - $listGenRules[0] = array( + $listGenRules[0] = array( + 'id' => 1, 'rdbuuid' => $_POST['rdbuuid'], 'enable' => 'on', 'who' => 'src', @@ -430,6 +433,7 @@ function snortSql_updateRulesSigsIps() $listGenRulesEnable = 'off'; } + // TODO: inprove this foreach so we only interact with db once foreach ($_POST['snortsam']['db'] as $singleSig) { @@ -461,9 +465,7 @@ function snortSql_updateRulesSigsIps() "); - } - - if ( !empty($chktable) ) { + }else{ $query_ck = sqlite_query($db, // @ supress warnings usonly in production "UPDATE {$_POST['dbTable']} SET date ='{$addDate}', enable = '{$singleSigEnable}', who = '{$singleSig['who']}', timeamount = '{$singleSig['timeamount']}', timetype = '{$singleSig['timetype']}' WHERE rdbuuid = '{$_POST['rdbuuid']}' and sigfilename = '{$singleSig['sigfilename']}'; |