aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort-dev/testing.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/snort-dev/testing.php')
-rw-r--r--config/snort-dev/testing.php43
1 files changed, 35 insertions, 8 deletions
diff --git a/config/snort-dev/testing.php b/config/snort-dev/testing.php
index 87d98e26..20411304 100644
--- a/config/snort-dev/testing.php
+++ b/config/snort-dev/testing.php
@@ -1,25 +1,52 @@
<?php
-require_once('/usr/local/pkg/snort/snort_new.inc');
+//require_once("/usr/local/pkg/snort/snort_new.inc");
-$uuid = '2565656';
-$a_list = snortSql_fetchAllWhitelistTypes('SnortWhitelist');
+// fetch db Settings NONE Json
+function snortSql_fetchAllSettings($dbrule, $table, $type, $id_uuid)
+{
+ if ($table == '')
+ {
+ return false;
+ }
+
+ $db = sqlite_open("/usr/local/pkg/snort/$dbrule");
+
+ if ($type == 'id')
+ {
+ $result = sqlite_query($db,
+ "SELECT * FROM {$table} where id = '{$id_uuid}';
+ ");
+ }
+
+ if ($type == 'uuid')
+ {
+ $result = sqlite_query($db,
+ "SELECT * FROM {$table} where uuid = '{$id_uuid}';
+ ");
+ }
+ $chktable = sqlite_fetch_array($result, SQLITE_ASSOC);
- echo '<pre>' . "\n\n";
-
-
- print_r($a_list);
+ sqlite_close($db);
+ return $chktable;
- echo "\n" . '</pre>';
+} // end func
+$generalSettings = snortSql_fetchAllSettings('snortDB', 'SnortWhitelist', 'uuid', '2565656');
+ echo '<pre>' . "\n\n";
+
+ print_r($generalSettings);
+
+ echo "\n" . '</pre>';
+
?>