# 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
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()
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: