diff options
Diffstat (limited to 'config/snort-dev/snort_json_post.php')
-rw-r--r-- | config/snort-dev/snort_json_post.php | 78 |
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 |