Host Pools UI changes

- Do now show the "Not Assigned" group in user pool dropdown
- Show an alert message when creating a Captive Portal user and no pools are defined
- Improve unique member validator to account missing network prefixes
- Prevent deleting an Host Group when a captive portal user is defined on it
This commit is contained in:
emanuele-f 2017-01-20 13:28:24 +01:00
parent 1bd0d01658
commit 0db8abd83e
11 changed files with 120 additions and 39 deletions

View file

@ -2702,3 +2702,15 @@ function paramsPairsDecode(params, strict_mode)
return res
end
function isCaptivePortalActive(ifstats)
if not ntop.isEnterprise() then
return false
end
local ifstats = ifstats or interface.getStats()
local is_bridge_iface = (ifstats["bridge.device_a"] ~= nil) and (ifstats["bridge.device_b"] ~= nil)
local is_captive_portal_enabled = ntop.getPrefs()["is_captive_portal_enabled"]
return is_bridge_iface and is_captive_portal_enabled
end