mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Initial import from SVN
This commit is contained in:
parent
1601f6bbf2
commit
730d76b9f5
1612 changed files with 715104 additions and 0 deletions
23
scripts/lua/admin/validate_new_user.lua
Normal file
23
scripts/lua/admin/validate_new_user.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
--
|
||||
-- (C) 2013 - ntop.org
|
||||
--
|
||||
|
||||
dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
require "lua_utils"
|
||||
|
||||
sendHTTPHeader('application/json')
|
||||
|
||||
if(haveAdminPrivileges()) then
|
||||
key = "ntopng.user.".. _GET["user"] ..".password"
|
||||
existing = ntop.getCache(key)
|
||||
|
||||
if(string.len(existing) > 0) then
|
||||
print('{ "valid" : 0, "user": "'.. _GET["user"]..'", "msg": "User already existing" }\n')
|
||||
return
|
||||
else
|
||||
valid = 1
|
||||
end
|
||||
|
||||
print('{ "valid" : 1, "user": "'.. _GET["user"]..'", "msg": "Ok" }\n')
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue