diff --git a/comments.py b/comments.py index 440ef40..d25728c 100755 --- a/comments.py +++ b/comments.py @@ -11,29 +11,18 @@ import time, string print("Content-type: text/html\r\n\r\n") form=cgi.FieldStorage() aid=int(form["aid"].value) -print("1") try: seed=int(form["seed"].value) - print("2") random.seed(seed) - print("3") checkstr="".join(random.choice(string.digits+string.ascii_lowercase) for _ in range(5)) - print(checkstr) - print("4") if not checkstr == form["checkstr"].value: print("Captcha's wrong") raise Exception() - print("5") username=form["username"].value - print("6") message=form["message"].value - print("7") timestamp=int(time.time()) - print("8") - data={"name":"","markdown":message,"author":username,"date":timestamp} - print("9") + data={"name":form["title"],"markdown":message,"author":username,"date":timestamp} storage.append("comments-%i"%aid,data) - print("10") except KeyError: pass @@ -47,6 +36,7 @@ html=htmlgen.HTMLgen(pagelayout.getLayoutXML().decode('utf-8'),"Comments") html.appendHTML("