aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort-dev/snort_json_get.php
diff options
context:
space:
mode:
authorrobiscool <robrob2626@yahoo.com>2011-06-16 13:10:29 -0700
committerrobiscool <robrob2626@yahoo.com>2011-06-16 13:10:29 -0700
commitb09f9b80567607884f88c28f694cdefe744ded1e (patch)
tree479d734a5b9f7b2b37dee5170c0b636454946f76 /config/snort-dev/snort_json_get.php
parent3a16379bd0e3afc1a0845c0ea57a669923a57a4d (diff)
downloadpfsense-packages-b09f9b80567607884f88c28f694cdefe744ded1e.tar.gz
pfsense-packages-b09f9b80567607884f88c28f694cdefe744ded1e.tar.bz2
pfsense-packages-b09f9b80567607884f88c28f694cdefe744ded1e.zip
snort-dev, redo the way users interact with the rules, update database names
Diffstat (limited to 'config/snort-dev/snort_json_get.php')
-rw-r--r--config/snort-dev/snort_json_get.php20
1 files changed, 8 insertions, 12 deletions
diff --git a/config/snort-dev/snort_json_get.php b/config/snort-dev/snort_json_get.php
index 1fdcc1e7..ecab3a13 100644
--- a/config/snort-dev/snort_json_get.php
+++ b/config/snort-dev/snort_json_get.php
@@ -2,13 +2,11 @@
require_once("guiconfig.inc");
require_once("/usr/local/pkg/snort/snort_new.inc");
-require_once("/usr/local/pkg/snort/snort_download_rules.inc");
session_start(); // alwaya at the very top of a php page or "Cannot send session cache limiter - headers already sent"
// upload created log tar to user
-if ($_GET['snortGetUpdate'] == 1)
-{
+if ($_GET['snortGetUpdate'] == 1) {
$tmpfname = "/usr/local/etc/snort/snort_download";
$snort_filename = "snortrules-snapshot-2905.tar.gz";
@@ -16,11 +14,9 @@ if ($_GET['snortGetUpdate'] == 1)
$snortSessionPath = $_SESSION['tmp']['snort']['snort_download_updates'];
- if (!file_exists("{$tmpfname}/{$snort_filename}"))
- {
+ if (!file_exists("{$tmpfname}/{$snort_filename}")) {
- if ($snortSessionPath['download']['working'] != '1')
- {
+ if ($snortSessionPath['download']['working'] != '1') {
unset($_SESSION['tmp']);
$snortSessionPath['download']['working'] = '1';
sendUpdateSnortLogDownload();
@@ -29,7 +25,9 @@ if ($_GET['snortGetUpdate'] == 1)
}
$time = time();
- while((time() - $time) < 30) {
+ while((time() - $time) < 30)
+ {
+
// query memcache, database, etc. for new data
$data = $datasource->getLatest();
@@ -49,8 +47,7 @@ if ($_GET['snortGetUpdate'] == 1)
// upload created log tar to user
-if ($_GET['snortlogdownload'] == 1)
-{
+if ($_GET['snortlogdownload'] == 1) {
sendFileSnortLogDownload();
@@ -58,8 +55,7 @@ if ($_GET['snortlogdownload'] == 1)
// send Json sid string
-if ($_GET['snortGetSidString'] == 1)
-{
+if ($_GET['snortGetSidString'] == 1) {
// unset
unset($_GET['snortGetSidString']);