Adds per-user allowed interfaces (WIP)

This commit is contained in:
Simone Mainardi 2016-06-11 15:30:34 +02:00
parent 400ad58131
commit 4091c9c38d
11 changed files with 377 additions and 184 deletions

View file

@ -11,6 +11,7 @@ sendHTTPHeader('application/json')
username = _GET["username"]
host_role = _GET["host_role"]
networks = _GET["networks"]
allowed_interface = _GET["allowed_interface"]
if(username == nil) then
print ("{ \"result\" : -1, \"message\" : \"Error in username\" }")
@ -31,4 +32,11 @@ if(networks ~= nil) then
end
end
if(allowed_interface ~= nil) then
if(not ntop.changeAllowedIfname(username, allowed_interface)) then
print ("{ \"result\" : -1, \"message\" : \"Error in changing the allowed interface\" }")
return
end
end
print ("{ \"result\" : 0, \"message\" : \"Parameters Updated\" }")