diff --git a/Makefile b/Makefile index 7b71e7a..d644fd8 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ all: ctf.tce target: $(PYC) $(INSTALL) -d --mode=0755 --owner=100 $(DESTDIR)/var/lib/ctf + + $(INSTALL) -d --mode=0755 --owner=100 $(DESTDIR)/var/lib/ctf/survey + $(INSTALL) -d $(DESTDIR)/var/lib/ctf/disabled touch $(DESTDIR)/var/lib/ctf/disabled/survey diff --git a/puzzles/survey/1000000/submit.cgi b/puzzles/survey/1000000/,submit.cgi similarity index 57% rename from puzzles/survey/1000000/submit.cgi rename to puzzles/survey/1000000/,submit.cgi index 58549a7..39a9a08 100755 --- a/puzzles/survey/1000000/submit.cgi +++ b/puzzles/survey/1000000/,submit.cgi @@ -1,6 +1,8 @@ #! /usr/bin/env python3 import cgi +import time +import os f = cgi.FieldStorage() if f.getfirst('submit'): @@ -8,7 +10,13 @@ if f.getfirst('submit'): print() print('Thanks for filling in the survey.') print() - print(dir(f)) + try: + fn = '/var/lib/ctf/survey/%s.%d.%d.txt' % (time.strftime('%Y-%m-%d'), time.time(), os.getpid()) + o = open(fn, 'w') + for k in f.keys(): + o.write('%s: %r\n' % (k, f.getlist(k))) + except IOError: + pass print('The key is:') print(' quux blorb frotz') else: diff --git a/puzzles/survey/1000000/,survey.html b/puzzles/survey/1000000/,survey.html new file mode 100644 index 0000000..0ed037b --- /dev/null +++ b/puzzles/survey/1000000/,survey.html @@ -0,0 +1,44 @@ + + + +
+