mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
This migration is necessary since Lua scripts sources use the UTF-8 encoding while the web browser sees the iso-8859-1 encoding, and this incongruence breaks the visualization of some non-ascii characters.
35 lines
1.3 KiB
Lua
35 lines
1.3 KiB
Lua
--
|
|
-- (C) 2013 - ntop.org
|
|
--
|
|
|
|
dirs = ntop.getDirs()
|
|
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
|
require "lua_utils"
|
|
|
|
--[[ Note: keep the old iso-8859-1 encoding to avoid breaking existing passwords ]]
|
|
sendHTTPContentTypeHeader('text/html', nil, 'iso-8859-1')
|
|
|
|
if(haveAdminPrivileges()) then
|
|
interface.select(ifname)
|
|
|
|
is_captive_portal_active = isCaptivePortalActive()
|
|
|
|
ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc")
|
|
|
|
active_page = "admin"
|
|
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
|
|
|
|
dofile(dirs.installdir .. "/scripts/lua/inc/users.lua")
|
|
|
|
local ifstats = interface.getStats()
|
|
local is_captive_portal_enabled = ntop.getPrefs()["is_captive_portal_enabled"]
|
|
if(ifstats.inline and not(is_captive_portal_enabled)) then
|
|
print('<small><b>NOTE:</b> <A HREF="'.. ntop.getHttpPrefix() ..'/lua/admin/prefs.lua?tab=bridging">Enabling the captive portal</A> allows you to define captive portal users.</small>')
|
|
end
|
|
|
|
dofile(dirs.installdir .. "/scripts/lua/inc/password_dialog.lua")
|
|
dofile(dirs.installdir .. "/scripts/lua/inc/add_user_dialog.lua")
|
|
dofile(dirs.installdir .. "/scripts/lua/inc/delete_user_dialog.lua")
|
|
|
|
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
|
|
end
|