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,11 +8,10 @@ require "lua_utils"
sendHTTPHeader('text/html; charset=iso-8859-1')
if(_GET["csrf"] ~= nil) then
username = _GET["username"]
old_password = _GET["old_password"]
new_password = _GET["new_password"]
confirm_new_password = _GET["confirm_new_password"]
username = _POST["username"]
old_password = _POST["old_password"]
new_password = _POST["new_password"]
confirm_new_password = _POST["confirm_new_password"]
user_group = ntop.getUserGroup()
if(user_group == "administrator") then
@ -37,4 +36,3 @@ if(ntop.resetUserPassword(_SESSION["user"], username, old_password, new_password
else
print ("{ \"result\" : -1, \"message\" : \"Unable to set the new user password: perhaps the old password was invalid ?\" }")
end
end