-- -- (C) 2013-15 - ntop.org -- dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path if ( (dirs.scriptdir ~= nil) and (dirs.scriptdir ~= "")) then package.path = dirs.scriptdir .. "/lua/modules/?.lua;" .. package.path end require "lua_utils" active_page = "if_stats" id = _GET["id"] -- First switch interfaces so the new cookie will have effect ifname = interface.setActiveInterfaceId(tonumber(id)) --print("@"..ifname.."="..id.."@") if((ifname ~= nil) and (_SESSION["session"] ~= nil)) then key = getRedisPrefix("ntopng.prefs") .. ".ifname" ntop.setCache(key, ifname) sendHTTPHeaderIfName('text/html', ifname, 3600) ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") print("
The selected interface " .. getHumanReadableInterfaceName(id)) print(" [id: ".. id .."] is now active
") ntop.setCache(getRedisPrefix("ntopng.prefs")..'.iface', id) print('\n') else sendHTTPHeader('text/html; charset=iso-8859-1') ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") print("
Error while switching interfaces
") if(_SESSION["session"] == nil) then print("
Empty session
") end end dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")