Use POST requests when required

This commit is contained in:
emanuele-f 2017-01-14 20:24:24 +01:00
parent 910fdcdc4a
commit 397d525d85
25 changed files with 282 additions and 451 deletions

View file

@ -8,15 +8,14 @@ require "lua_utils"
sendHTTPHeader('text/html; charset=iso-8859-1')
if(_GET["csrf"] ~= nil) then
if(haveAdminPrivileges()) then
username = _GET["username"]
full_name = _GET["full_name"]
password = _GET["password"]
confirm_password = _GET["confirm_password"]
host_role = _GET["host_role"]
networks = _GET["allowed_networks"]
allowed_interface = _GET["allowed_interface"]
username = _POST["username"]
full_name = _POST["full_name"]
password = _POST["password"]
confirm_password = _POST["confirm_password"]
host_role = _POST["host_role"]
networks = _POST["allowed_networks"]
allowed_interface = _POST["allowed_interface"]
if(username == nil or full_name == nil or password == nil or confirm_password == nil or host_role == nil or networks == nil or allowed_interface == nil) then
print ("{ \"result\" : -1, \"message\" : \"Invalid parameters\" }")
@ -34,4 +33,3 @@ if(haveAdminPrivileges()) then
print ("{ \"result\" : -1, \"message\" : \"Error while adding new user\" }")
end
end
end