aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort-dev/snort_json_post.php
diff options
context:
space:
mode:
authorrobiscool <robrob2626@yahoo.com>2011-05-26 07:20:27 -0700
committerrobiscool <robrob2626@yahoo.com>2011-05-26 09:17:10 -0700
commitbd664276c67a11b92c027ba569157460481d37e6 (patch)
treea3d18c74483349297caaf25c5e43e62ff3ede449 /config/snort-dev/snort_json_post.php
parent54c49bf2b5358b35602cae3cf6a9fead0ba886e5 (diff)
downloadpfsense-packages-bd664276c67a11b92c027ba569157460481d37e6.tar.gz
pfsense-packages-bd664276c67a11b92c027ba569157460481d37e6.tar.bz2
pfsense-packages-bd664276c67a11b92c027ba569157460481d37e6.zip
snort-dev, add rules and rulesets tabs
Diffstat (limited to 'config/snort-dev/snort_json_post.php')
-rw-r--r--config/snort-dev/snort_json_post.php78
1 files changed, 39 insertions, 39 deletions
diff --git a/config/snort-dev/snort_json_post.php b/config/snort-dev/snort_json_post.php
index 2431beec..8cf72f67 100644
--- a/config/snort-dev/snort_json_post.php
+++ b/config/snort-dev/snort_json_post.php
@@ -11,55 +11,55 @@ if(isset($_POST['__csrf_magic']))
}
// return codes
-$snortJsonReturnCode_success = '
-{
-"snortgeneralsettings": "success"
+$snortJsonReturnCode_success = '{"snortgeneralsettings":"success"}';
+
+$snortJsonReturnCode_fail = '{"snortgeneralsettings":"fail"}';
+
+function snortJsonReturnCode($returnStatus)
+{
+ if ($returnStatus == true)
+ {
+ echo '{"snortgeneralsettings":"success","snortUnhideTabs":"true"}';
+ }else{
+ echo '{"snortgeneralsettings":"fail"}';
+ }
}
-';
-$snortJsonReturnCode_fail = '
+// row from db by uuid
+if ($_POST['snortSidRuleEdit'] == 1)
{
-"snortgeneralsettings": "fail"
+
+ unset($_POST['snortSidRuleEdit']);
+
+ snortSidStringRuleEditGUI();
+
}
-';
-
- function snortJsonReturnCode($returnStatus)
- {
-
- if ($returnStatus == true)
- {
- echo '
- {
- "snortgeneralsettings": "success", "snortUnhideTabs": "true"
- }
- ';
- }else{
- echo '
- {
- "snortgeneralsettings": "fail"
- }
- ';
- }
-
- }
- // row from db by uuid
+// row from db by uuid
if ($_POST['snortSaveRuleSets'] == 1)
{
- // unset POSTs that are markers not in db
- unset($_POST['snortSaveSettings']);
- unset($_POST['ifaceTab']);
+ if ($_POST['ifaceTab'] == 'snort_rulesets')
+ {
+ // unset POSTs that are markers not in db
+ unset($_POST['snortSaveRuleSets']);
+ unset($_POST['ifaceTab']);
+
+ snortJsonReturnCode(snortSql_updateRuleSetList());
+
+ }
+
+
+ if ($_POST['ifaceTab'] == 'snort_rules')
+ {
+ // unset POSTs that are markers not in db
+ unset($_POST['snortSaveRuleSets']);
+ unset($_POST['ifaceTab']);
+
+ snortJsonReturnCode(snortSql_updateRuleSigList());
+ }
- 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