You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
812 B
26 lines
812 B
local etlua = require "etlua"
|
|
local utils = require "utils"
|
|
|
|
local yqtemplateform = utils.readfile("yqform.etlua")
|
|
|
|
local form = etlua.compile(yqtemplateform)
|
|
|
|
return {
|
|
desc = "Creates Yokoka’s quest-style personal status page",
|
|
run = function(fcgi)
|
|
fcgi.print("Content-Type: text/html; charset=utf-8\r\n\r\n")
|
|
local data = ""
|
|
if fcgi.getenv("REQUEST_METHOD") == "POST" then
|
|
local content_type = fcgi.getenv("CONTENT_TYPE")
|
|
local boundary = content_type:match("; boundary=(.*)$")
|
|
local post_data = fcgi.post()
|
|
data = "Content type:" .. content_type .. "\n Boundary: "..boundary.."\n"
|
|
local args = {}
|
|
for w in string.gmatch(post_data, "(.-)"..boundary) do
|
|
args[#args+1] = w
|
|
end
|
|
data = table.concat(args, "\n\n")
|
|
end
|
|
fcgi.print(form{data = data})
|
|
end
|
|
}
|