diff options
-rw-r--r-- | www/gps_report.cgi.in | 22 |
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 |