mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Implements captive portal users auto expiration
This commit is contained in:
parent
92b40eb2d0
commit
f304f9229f
11 changed files with 257 additions and 18 deletions
|
|
@ -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\" }")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue