%
include("language.html")
if _SESSION["username"] ~= nil and _SESSION["currentpath"] ~= nil then
local oldpassword = _POST["oldpassword"] or _GET["oldpassword"] or nil
local newpassword = _POST["newpassword"] or _GET["newpassword"] or nil
local result = 0
if oldpassword ~= nil and newpassword ~= nil then
result = c_ChangeUserPass(_SESSION["username"], oldpassword, newpassword, _REMOTE_IP)
if result == 0 then
c_AddWebLog(_SESSION["username"].." changed the user password successfully",_SESSION_ID,DOMAIN_LOG_WEB_RESPOND)
c_DoWebEvent(WEB_CHANGE_PASSWORD,_SESSION_ID)
else
c_AddWebLog("Changing user password failed",_SESSION_ID,DOMAIN_LOG_WEB_RESPOND)
end
else
result = 4
end
print(CHANGEPASS_STR[tonumber(result)])
else
print("session expired")
end
%>