-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.htm
More file actions
49 lines (46 loc) · 1.26 KB
/
test.htm
File metadata and controls
49 lines (46 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--LUASCRIPT
math.randomseed(os.time())
local result = {}
local function prt(str)
table.insert(result, str.."\n")
end
local function exe(com)
local fd = io.popen(com)
local out = fd:read("*a")
fd:close()
prt ("\n--- Executing: "..com.."\n")
return out
end
prt("$SCRIPT_FILENAME = "..tostring(os.getenv("SCRIPT_FILENAME")))
prt("args.get="..tostring(FFTEMPL.args.get))
prt("stdin="..FFTEMPL.stdin.."("..#FFTEMPL.stdin.." chars)")
prt("_dash_argument="..tostring(FFTEMPL.args._dash_argument))
prt("-- FFTEMPL values:")
for k,v in pairs(FFTEMPL) do
local str = tostring(v)
if #str < 100 then
prt("FFTEMPL."..k.." = "..str)
end
end
prt(exe("whoami"))
prt(exe("sudo whoami"))
prt(exe("pwd"))
prt(exe("ls -al"))
prt(exe("export"))
local cookie = "c"..math.random(999999)
prt("set cookies = "..cookie)
FFTEMPL.extra_headers = "Set-Cookie: cookie="..cookie.."\nSet-Cookie: cookie2="..cookie.."_2"
FFTEMPL.add_dumb_tag("CONTENT", table.concat(result))
--/LUASCRIPT
((TITLE))
FFTempl test
((BODY))
FFtempl test:
<pre>
CONTENT
</pre>
<form action="test.htm" method="post">
First name: <input type="text" name="fname" value="fname_val"><br>
Last name: <input type="text" name="lname" value="lname_val"><br>
<input type="submit" value="Submit">
</form>