diff options
author | robiscool <robrob2626@yahoo.com> | 2011-08-02 15:54:21 -0700 |
---|---|---|
committer | robiscool <robrob2626@yahoo.com> | 2011-08-02 15:54:21 -0700 |
commit | 0841fc3fe30892fcbbf7ea9dc330ffae6bfb62a3 (patch) | |
tree | d3e4c1676c07d0f8a0a99e759795314dbe310712 /config/orionids-dev/snort_rules.php | |
parent | 91bbef635a549260d2e65c2d0e0411daa5734ae5 (diff) | |
download | pfsense-packages-0841fc3fe30892fcbbf7ea9dc330ffae6bfb62a3.tar.gz pfsense-packages-0841fc3fe30892fcbbf7ea9dc330ffae6bfb62a3.tar.bz2 pfsense-packages-0841fc3fe30892fcbbf7ea9dc330ffae6bfb62a3.zip |
orionids-dev, remake paths
Diffstat (limited to 'config/orionids-dev/snort_rules.php')
-rw-r--r-- | config/orionids-dev/snort_rules.php | 73 |
1 files changed, 39 insertions, 34 deletions
diff --git a/config/orionids-dev/snort_rules.php b/config/orionids-dev/snort_rules.php index 78134d52..09490a37 100644 --- a/config/orionids-dev/snort_rules.php +++ b/config/orionids-dev/snort_rules.php @@ -434,43 +434,48 @@ jQuery(document).ready(function() { <?php - /* - * NOTE: - * I could have used a php loop to build the table but I wanted to see if off loading to client is faster. - * Seems to be faster on embeded systems with low specs. On higher end systems there is no difference that I can see. - * WARNING: - * If Json string is to long browsers start asking to terminate javascript. - * FIX: - * Use julienlecomte()net/blog/2007/10/28/, the more reading I do about this subject it seems that off loading to a client is not recomended. - */ - if (!empty($newFilterRuleSigArray)) - { - $countSigList = count($newFilterRuleSigArray); - - echo "\n"; - - echo 'var snortObjlist = ['; - $i = 0; - foreach ($newFilterRuleSigArray as $val3) - { + /* + * NOTE: + * I could have used a php loop to build the table but I wanted to see if off loading to client is faster. + * Seems to be faster on embeded systems with low specs. On higher end systems there is no difference that I can see. + * WARNING: + * If Json string is to long browsers start asking to terminate javascript. + * FIX: + * Use julienlecomte()net/blog/2007/10/28/, the more reading I do about this subject it seems that off loading to a client is not recomended. + */ + if (!empty($newFilterRuleSigArray)) + { + $countSigList = count($newFilterRuleSigArray); + + echo "\n"; + + echo 'var snortObjlist = ['; + $i = 0; + foreach ($newFilterRuleSigArray as $val3) + { + + $i++; - $i++; - - if ( $i !== $countSigList ) - {// - echo '{"sid":"' . $val3['sid'] . '","enable":"' . $val3['enable'] . '","proto":"' . $val3['proto'] . '","src":"' . $val3['src'] . '","srcport":"' . $val3['srcport'] . '","dst":"' . $val3['dst'] . '", "dstport":"' . $val3['dstport'] . '","msg":"' . escapeJsonString($val3['msg']) . '"},'; - }else{ - echo '{"sid":"' . $val3['sid'] . '","enable":"' . $val3['enable'] . '","proto":"' . $val3['proto'] . '","src":"' . $val3['src'] . '","srcport":"' . $val3['srcport'] . '","dst":"' . $val3['dst'] . '", "dstport":"' . $val3['dstport'] . '","msg":"' . escapeJsonString($val3['msg']) . '"}'; - } - } - - echo '];' . "\n"; - } + if ( $i !== $countSigList ) + {// + echo '{"sid":"' . $val3['sid'] . '","enable":"' . $val3['enable'] . '","proto":"' . $val3['proto'] . '","src":"' . $val3['src'] . '","srcport":"' . $val3['srcport'] . '","dst":"' . $val3['dst'] . '", "dstport":"' . $val3['dstport'] . '","msg":"' . escapeJsonString($val3['msg']) . '"},'; + }else{ + echo '{"sid":"' . $val3['sid'] . '","enable":"' . $val3['enable'] . '","proto":"' . $val3['proto'] . '","src":"' . $val3['src'] . '","srcport":"' . $val3['srcport'] . '","dst":"' . $val3['dst'] . '", "dstport":"' . $val3['dstport'] . '","msg":"' . escapeJsonString($val3['msg']) . '"}'; + } + } + + echo '];' . "\n"; + } -?> - // disable Row Append if row count is less than 0 - var countRowAppend = <?=$countSig; ?>; + + if (!empty($countSig)) { + echo 'var countRowAppend = ' . $countSig . ';' . "\n"; + }else{ + echo 'var countRowAppend = 0;' . "\n"; + } + +?> // if rowcount is not empty do this if (countRowAppend > 0){ |