-- -- (C) 2013-24 - ntop.org -- local dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path -- io.write ("Session:".._SESSION["session"].."\n") require "lua_utils" local captive_portal_utils = require("captive_portal_utils") if not ntop.isnEdge() then return end local info = ntop.getInfo() local remote_addr = _SERVER["REMOTE_ADDR"] local method = _SERVER["REQUEST_METHOD"] local is_logged = captive_portal_utils.is_logged(remote_addr) if method == "POST" then if is_logged then captive_portal_utils.logout(remote_addr) is_logged = false end end captive_portal_utils.print_header() if is_logged then print [[
]] else print [[ ]] end captive_portal_utils.print_footer()