Implements captive portal users

This commit is contained in:
Simone Mainardi 2017-01-17 19:57:48 +01:00
parent d9af0c8025
commit 4e2c7b8e8b
12 changed files with 138 additions and 30 deletions

View file

@ -16,6 +16,7 @@ if(haveAdminPrivileges()) then
host_role = _POST["host_role"]
networks = _POST["allowed_networks"]
allowed_interface = _POST["allowed_interface"]
host_pool_id = _POST["host_pool_id"]
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\" }")
@ -27,7 +28,7 @@ if(haveAdminPrivileges()) then
return
end
if(ntop.addUser(username, full_name, password, host_role, networks, getInterfaceName(allowed_interface))) then
if(ntop.addUser(username, full_name, password, host_role, networks, getInterfaceName(allowed_interface), host_pool_id)) then
print ("{ \"result\" : 0, \"message\" : \"User added successfully\" }")
else
print ("{ \"result\" : -1, \"message\" : \"Error while adding new user\" }")