mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-28 23:19:33 +00:00
Enforces admin user to always have admin privileges
This commit is contained in:
parent
841667837b
commit
4779f80fa8
2 changed files with 15 additions and 1 deletions
|
|
@ -15,12 +15,22 @@ local empty_string_dump = "00000600CB7634C0FA2A9E49"
|
|||
|
||||
-- ###########################################
|
||||
|
||||
local function set_admin_prefs()
|
||||
-- User admin is always an administrator, let's make sure serialized values are correct
|
||||
ntop.setCache("ntopng.user.admin.group", "administrator")
|
||||
ntop.setCache("ntopng.user.admin.allowed_nets", "0.0.0.0/0,::/0")
|
||||
end
|
||||
|
||||
-- ###########################################
|
||||
|
||||
local debug = false
|
||||
|
||||
function prefs_dump_utils.savePrefsToDisk()
|
||||
local dirs = ntop.getDirs()
|
||||
local where = os_utils.fixPath(dirs.workingdir.."/runtimeprefs.json")
|
||||
|
||||
set_admin_prefs()
|
||||
|
||||
local patterns = {"ntopng.prefs.*", "ntopng.user.*"}
|
||||
|
||||
local out = {}
|
||||
|
|
@ -84,6 +94,8 @@ function prefs_dump_utils.readPrefsFromDisk()
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
set_admin_prefs()
|
||||
end
|
||||
|
||||
return prefs_dump_utils
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue