]> git.donarmstrong.com Git - neurodebian.git/blobdiff - survey/surveycollector.cgi
Also for stats report which repo and which job number use our setup
[neurodebian.git] / survey / surveycollector.cgi
index 6ab3f3345d9377228d315b04ba141f3f68b129f0..a06cec23a0d0211ab820f4bec8585b4770049acc 100755 (executable)
@@ -61,6 +61,8 @@ def extract_results(form, result):
     # IP
     if 'REMOTE_ADDR' in os.environ:
         result['remote_addr'] = os.environ['REMOTE_ADDR']
+    if 'HTTP_USER_AGENT' in os.environ:
+        result['user_agent'] = os.environ['HTTP_USER_AGENT']
 
     return result
 
@@ -83,7 +85,7 @@ def main():
             result['success'] = True
             result = extract_results(form, result)
             try:
-                logfile = open('/home/neurodebian/surveydata/%s.json' % result['timestamp'], 'w+')
+                logfile = open('/home/neurodebian/survey/data/%s.json' % result['timestamp'], 'w+')
                 logfile.write(json.write(result))
                 logfile.write('\n')
                 logfile.close()
@@ -92,7 +94,7 @@ def main():
                 result['message'] = 'We are very sorry, but the server is unable to store your submission. Please contact team@neuro.debian.net.'
             # send HTML snippet to let the submitter see the results
             try:
-                result['results'] = open('/home/www/neuro.debian.net/www/survey/results_snippet.html').read()
+                result['results'] = open('/home/neurodebian/survey/results_snippet.html').read()
             except:
                 result['results'] = 'We are very sorry, but the statistics could not be displayed. Please contact team@neuro.debian.net to get access.'
         else: