mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
parent
6274946e08
commit
473b90e9ae
6 changed files with 31 additions and 31 deletions
|
|
@ -19,7 +19,7 @@ local rest_utils = require("rest_utils")
|
|||
|
||||
sendHTTPHeader('application/json')
|
||||
|
||||
local rc = rest_utils.consts_ok
|
||||
local rc = rest_utils.consts.success.ok
|
||||
local res = {}
|
||||
|
||||
for ifid, ifname in pairs(interface.getIfNames()) do
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ local rest_utils = require("rest_utils")
|
|||
|
||||
sendHTTPHeader('application/json')
|
||||
|
||||
local rc = rest_utils.consts_ok
|
||||
local rc = rest_utils.consts.success.ok
|
||||
local res = {}
|
||||
|
||||
local username = _POST["username"]
|
||||
|
||||
if username == nil then
|
||||
print(rest_utils.rc(rest_utils.consts_invalid_args))
|
||||
print(rest_utils.rc(rest_utils.consts.err.invalid_args))
|
||||
return
|
||||
end
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ username = string.lower(username)
|
|||
res.session = ntop.createUserSession(username)
|
||||
|
||||
if isEmptyString(res.session) then
|
||||
print(rest_utils.rc(rest_utils.consts_invalid_args))
|
||||
print(rest_utils.rc(rest_utils.consts.err.invalid_args))
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ local rest_utils = require("rest_utils")
|
|||
|
||||
sendHTTPHeader('application/json')
|
||||
|
||||
local rc = rest_utils.consts_ok
|
||||
local rc = rest_utils.consts.success.ok
|
||||
|
||||
if not haveAdminPrivileges() then
|
||||
local res = {}
|
||||
print(rest_utils.rc(rest_utils.consts_not_granted, res))
|
||||
print(rest_utils.rc(rest_utils.consts.err.not_granted, res))
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue