Fixs for manage users lifetime

This commit is contained in:
emanuele-f 2017-02-01 12:19:18 +01:00
parent 62899d4385
commit bd6106e19c
5 changed files with 47 additions and 3 deletions

View file

@ -17,6 +17,7 @@ local allowed_interface = _POST["allowed_interface"]
local old_host_pool_id = _POST["old_host_pool_id"]
local new_host_pool_id = _POST["host_pool_id"]
local limited_lifetime = _POST["lifetime_limited"]
local unlimited_lifetime = _POST["lifetime_unlimited"]
local lifetime_secs = tonumber((_POST["lifetime_secs"] or -1))
if(username == nil) then
@ -50,6 +51,11 @@ if(limited_lifetime ~= nil) then
print ("{ \"result\" : -1, \"message\" : \"Error in changing the host lifetime\" }")
return
end
elseif(unlimited_lifetime ~= nil) then
if not ntop.clearUserLifetime(username) then
print ("{ \"result\" : -1, \"message\" : \"Error in clearing the host lifetime\" }")
return
end
end
if(new_host_pool_id ~= nil and old_host_pool_id ~= nil and new_host_pool_id ~= old_host_pool_id) then