mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 01:10:10 +00:00
Use POST in change_ndpi_category
This commit is contained in:
parent
1345196ba2
commit
09a1facad0
2 changed files with 14 additions and 7 deletions
|
|
@ -11,16 +11,16 @@ sendHTTPContentTypeHeader('application/json')
|
|||
|
||||
interface.select(ifname)
|
||||
|
||||
if(haveAdminPrivileges()) then
|
||||
local app_id = tonumber(_GET["l7proto"])
|
||||
local new_cat_id = tonumber(_GET["ndpi_new_cat_id"])
|
||||
local old_cat_id = tonumber(_GET["ndpi_old_cat_id"])
|
||||
if(haveAdminPrivileges() and (_POST["l7proto"] ~= nil)) then
|
||||
local app_id = tonumber(_POST["l7proto"])
|
||||
local new_cat_id = tonumber(_POST["ndpi_new_cat_id"])
|
||||
local old_cat_id = tonumber(_POST["ndpi_old_cat_id"])
|
||||
|
||||
if new_cat_id ~= nil and old_cat_id ~= nil and new_cat_id ~= old_cat_id then
|
||||
setCustomnDPIProtoCategory(ifname, app_id, new_cat_id)
|
||||
end
|
||||
|
||||
local res = {status = "OK"}
|
||||
local res = {status = "OK", new_csrf = ntop.getRandomCSRFValue()}
|
||||
print(json.encode(res))
|
||||
else
|
||||
print({status = "ERROR"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue