mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
enforced admin privileges on endpoint pages
This commit is contained in:
parent
ac03865c01
commit
237309fc58
7 changed files with 28 additions and 36 deletions
|
|
@ -2111,17 +2111,25 @@ end
|
|||
|
||||
-- ##############################################
|
||||
|
||||
function haveAdminPrivileges()
|
||||
if(isAdministrator()) then
|
||||
function haveAdminPrivileges(isJsonResponse)
|
||||
|
||||
if (isAdministrator()) then
|
||||
return(true)
|
||||
end
|
||||
|
||||
local isJson = isJsonResponse or false
|
||||
|
||||
if (isJson) then
|
||||
local json = require("dkjson")
|
||||
print(json.encode({}))
|
||||
else
|
||||
local page_utils = require("page_utils")
|
||||
|
||||
page_utils.print_header()
|
||||
dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua")
|
||||
print("<div class=\"alert alert-danger\"><img src=".. ntop.getHttpPrefix() .. "/img/warning.png> Access forbidden</div>")
|
||||
return(false)
|
||||
end
|
||||
|
||||
return(false)
|
||||
end
|
||||
|
||||
-- ##############################################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue