Implements captive portal users auto expiration

This commit is contained in:
Simone Mainardi 2017-01-20 20:20:09 +01:00
parent 92b40eb2d0
commit f304f9229f
11 changed files with 257 additions and 18 deletions

View file

@ -13,6 +13,11 @@ host_role = _POST["host_role"]
networks = _POST["networks"]
allowed_interface = _POST["allowed_interface"]
-- for captive portal users
old_host_pool_id = _POST["old_host_pool_id"]
new_host_pool_id = _POST["host_pool_id"]
if(username == nil) then
print ("{ \"result\" : -1, \"message\" : \"Error in username\" }")
return
@ -39,4 +44,11 @@ if(allowed_interface ~= nil) then
end
end
if(new_host_pool_id ~= nil and old_host_pool_id ~= nil and new_host_pool_id ~= old_host_pool_id) then
if(not ntop.changeUserHostPool(username, new_host_pool_id)) then
print ("{ \"result\" : -1, \"message\" : \"Error in changing the host pool id\" }")
return
end
end
print ("{ \"result\" : 0, \"message\" : \"Parameters Updated\" }")