Handles dismissable missing geoip notice

Implements #3395
This commit is contained in:
Simone Mainardi 2020-02-11 15:29:12 +01:00
parent b7f756c7ac
commit 20fe918d66
8 changed files with 81 additions and 48 deletions

View file

@ -0,0 +1,22 @@
--
-- (C) 2013-20 - ntop.org
--
local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
local json = require("dkjson")
require "lua_utils"
if _POST and isAdministrator() then
local dismiss_missing_geoip_reminder = _POST["dismiss_missing_geoip_reminder"]
if not isEmptyString(dismiss_missing_geoip_reminder) then
if dismiss_missing_geoip_reminder == "true" then
ntop.setPref("ntopng.prefs.geoip.reminder_dismissed", "true")
end
end
end
sendHTTPContentTypeHeader('application/json')
print(json.encode({status = "OK"}))