summaryrefslogtreecommitdiff
path: root/www/gps_report.cgi.in
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-05-24 08:41:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-05-24 08:41:53 -0400
commite0dffab6492d9f1e6b916ad0a9f8abfa63737741 (patch)
tree0121ccd4891de30dedffdbc77243a10847f45f55 /www/gps_report.cgi.in
parentcf80274a1a2baa0413641fb4e9ccc44f241cec01 (diff)
downloadgpsd-e0dffab6492d9f1e6b916ad0a9f8abfa63737741.tar.gz
Remove a magic string in the CGI.
Diffstat (limited to 'www/gps_report.cgi.in')
-rw-r--r--www/gps_report.cgi.in29
1 files changed, 18 insertions, 11 deletions
diff --git a/www/gps_report.cgi.in b/www/gps_report.cgi.in
index d0228201..8aa3a44e 100644
--- a/www/gps_report.cgi.in
+++ b/www/gps_report.cgi.in
@@ -25,17 +25,6 @@ print ""
def hasNeededElements(form):
return True
-if hasNeededElements(form) and form.getvalue("action") == "Send Report":
- msg = "This is only a test"
- smtp = smtplib.SMTP(host="thyrsus.com")
- #smtp.set_debuglevel(1)
- smtp.sendmail(servaddr, ["esr@thyrsus.com"], msg)
- smtp.quit()
- print "<p>New device report accepted. Thanks for helping improve GPSD.\n";
- sys.exit(0)
-
-# Everything below here is page generation
-
defaults = {"submitter":"",
"vendor": "",
"model": "",
@@ -55,6 +44,24 @@ defaults = {"submitter":"",
"sample_notes": "",
}
+if hasNeededElements(form) and form.getvalue("action") == "Send Report":
+ print cgi.print_form(form)
+ msg = ""
+ for field in defaults:
+ msg += "%s: %s\n" % (field, form.getvalue(field))
+ print "<pre>"
+ print msg
+ print "</pre>"
+ msg = "This is only a test"
+ smtp = smtplib.SMTP(host=servaddr.split("@")[1])
+ #smtp.set_debuglevel(1)
+ smtp.sendmail(servaddr, ["esr@thyrsus.com"], msg)
+ smtp.quit()
+ print "<p>New device report accepted. Thanks for helping improve GPSD.\n";
+ sys.exit(0)
+
+# Everything below here is page generation
+
for key in form.keys():
if key in form.keys():
defaults[key] = form.getvalue(key)