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

@ -15,8 +15,9 @@ if(haveAdminPrivileges()) then
confirm_password = _GET["confirm_password"]
host_role = _GET["host_role"]
networks = _GET["allowed_networks"]
allowed_interface = _GET["allowed_interface"]
if(username == nil or full_name == nil or password == nil or confirm_password == nil or host_role == nil or networks == nil) then
if(username == nil or full_name == nil or password == nil or confirm_password == nil or host_role == nil or networks == nil or allowed_interface == nil) then
print ("{ \"result\" : -1, \"message\" : \"Invalid parameters\" }")
return
end
@ -26,7 +27,7 @@ if(haveAdminPrivileges()) then
return
end
if(ntop.addUser(username, full_name, password, host_role, networks)) then
if(ntop.addUser(username, full_name, password, host_role, networks, allowed_interface)) then
print ("{ \"result\" : 0, \"message\" : \"User added successfully\" }")
else
print ("{ \"result\" : -1, \"message\" : \"Error while adding new user\" }")