mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +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
|
|
@ -12,21 +12,10 @@ local notification_endpoints = require("notification_endpoints")
|
|||
|
||||
local action = _POST["action"]
|
||||
|
||||
local function reportError(msg)
|
||||
print(json.encode({ message = msg, success = false, }))
|
||||
end
|
||||
|
||||
sendHTTPContentTypeHeader('application/json')
|
||||
|
||||
if (not isAdministrator()) then
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "The user doesn't have the privileges to edit a notification endpoint!")
|
||||
reportError("The user doesn't have the privileges to edit a notification endpoint!")
|
||||
end
|
||||
|
||||
if (action == nil) then
|
||||
traceError(TRACE_ERROR, TRACE_CONSOLE, "Missing 'action' parameter. Bad CSRF?")
|
||||
reportError("Missing 'action' parameter. Bad CSRF?")
|
||||
return
|
||||
if not haveAdminPrivileges() then
|
||||
return
|
||||
end
|
||||
|
||||
local endpoint_conf_name = _POST["endpoint_conf_name"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue