Added ability to set historical flow permission to users (#6330)

This commit is contained in:
MatteoBiscosi 2022-04-07 12:41:28 +02:00
parent 297b5d4edb
commit 61f74ce0a1
16 changed files with 454 additions and 290 deletions

View file

@ -13,6 +13,7 @@ local host_role = _POST["user_role"]
local networks = _POST["allowed_networks"]
local allowed_interface = _POST["allowed_interface"]
local allow_pcap_download = _POST["allow_pcap_download"]
local allow_historical_flow = _POST["allow_historical_flow"]
local language = _POST["user_language"]
-- for captive portal users
@ -64,6 +65,15 @@ if(not ntop.changeUserPermission(username, allow_pcap_download_enabled)) then
return
end
local allow_historical_flow_enabled = false
if allow_historical_flow and allow_historical_flow == "1" then
allow_historical_flow_enabled = true;
end
if(not ntop.changeHistoricalFlowPermission(username, allow_historical_flow_enabled)) then
print ("{ \"result\" : -1, \"message\" : \"Error in changing user historical flow permission\" }")
return
end
if(language ~= nil) then
if(not ntop.changeUserLanguage(username, language)) then
print ("{ \"result\" : -1, \"message\" : \"Error in changing the user language\" }")