summaryrefslogtreecommitdiff
path: root/www/gps_report.cgi.in
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-05-29 23:52:07 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-05-30 00:34:15 -0400
commit20ab3b377b8828acf93ffd4e963f7e5f8029e1f7 (patch)
tree914c7369135dfe623c45d9e12015f83f448cb634 /www/gps_report.cgi.in
parent2357afee1da3bdfdb51919478631b23d77519631 (diff)
downloadgpsd-20ab3b377b8828acf93ffd4e963f7e5f8029e1f7.tar.gz
Transmission from the CGI was successful.
Diffstat (limited to 'www/gps_report.cgi.in')
-rw-r--r--www/gps_report.cgi.in22
1 files changed, 7 insertions, 15 deletions
diff --git a/www/gps_report.cgi.in b/www/gps_report.cgi.in
index 0f0cfcfd..fbdd6f88 100644
--- a/www/gps_report.cgi.in
+++ b/www/gps_report.cgi.in
@@ -67,27 +67,23 @@ formfields = ("submitter",
)
if hasRequiredElements(form) and form.getvalue("action") == "Send Report":
- print cgi.print_form(form)
msg = ""
report = MIMEMultipart()
report['Subject'] = 'New device report'
report['To'] = to_address
report.preamble = "Part 1 is form data, part 2 is the sample"
- for field in formfields and not field.startswith('output_sample'):
- if form.getvalue(field):
+ for field in formfields:
+ if form.getvalue(field) and not field.startswith('output_sample'):
msg += "%s: %s\n" % (field, form.getvalue(field))
report.attach(MIMEText(msg))
content = MIMEText(output_sample_content)
encode_base64(content)
report.attach(content)
- print "<pre>"
- print report.as_string()
- 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()
+ msg = report.as_string()
+ 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)
@@ -123,10 +119,6 @@ print '''
<h1>GPSD Receiver Reporting Form</h1>
-<p><b>NOTE: Due to a Perl dependency coming unstuck, this form is in the
-process of being translated to Python and is not presently complete or
-usable. The management regrets any inconvenience.</b></p>
-
<form action="%(request_uri)s" method=POST enctype="multipart/form-data">
<p>Please use this form to report <code>gpsd</code> successes or