mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 23:49:33 +00:00
Review check enable/disable
This commit is contained in:
parent
17a843b47e
commit
e1a7bf63a5
2 changed files with 12 additions and 8 deletions
|
|
@ -18,26 +18,28 @@ local auth = require "auth"
|
|||
-- NOTE: in case of invalid login, no error is returned but redirected to login
|
||||
--
|
||||
|
||||
local subdir = _POST["check_subdir"]
|
||||
local script_key = _POST["script_key"]
|
||||
|
||||
-- ################################################
|
||||
|
||||
if not auth.has_capability(auth.capabilities.checks) then
|
||||
rest_utils.answer(rest_utils.consts.err.not_granted)
|
||||
return
|
||||
end
|
||||
|
||||
-- ################################################
|
||||
|
||||
local subdir = _POST["check_subdir"]
|
||||
if(subdir == nil) then
|
||||
rest_utils.answer(rest_utils.consts.err.invalid_args)
|
||||
return
|
||||
end
|
||||
|
||||
local script_type = checks.getScriptType(subdir)
|
||||
|
||||
if(script_type == nil) then
|
||||
rest_utils.answer(rest_utils.consts.err.invalid_args)
|
||||
return
|
||||
end
|
||||
|
||||
local script_key = _POST["script_key"]
|
||||
if(script_key == nil) then
|
||||
rest_utils.answer(rest_utils.consts.err.invalid_args)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue