mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Force username login always being lowercase
This commit is contained in:
parent
d3debf04ef
commit
ac07c48b7c
7 changed files with 33 additions and 12 deletions
|
|
@ -9,15 +9,15 @@ require "lua_utils"
|
|||
sendHTTPHeader('application/json')
|
||||
|
||||
if(haveAdminPrivileges()) then
|
||||
key = "ntopng.user.".. _GET["username"] ..".password"
|
||||
key = "ntopng.user.".. string.lower(_GET["username"]) ..".password"
|
||||
existing = ntop.getCache(key)
|
||||
|
||||
if(string.len(existing) > 0) then
|
||||
print('{ "valid" : 0, "user": "'.. _GET["username"]..'", "msg": "User already existing" }\n')
|
||||
print('{ "valid" : 0, "user": "'.. string.lower(_GET["username"])..'", "msg": "User already existing" }\n')
|
||||
return
|
||||
else
|
||||
valid = 1
|
||||
end
|
||||
|
||||
print('{ "valid" : 1, "user": "'.. _GET["username"]..'", "msg": "Ok" }\n')
|
||||
print('{ "valid" : 1, "user": "'.. string.lower(_GET["username"])..'", "msg": "Ok" }\n')
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue