blob: 3d61c560521407cf3665026fbd527850c5d37168 [file] [log] [blame]
Rushabh Mehta66ac2b02011-09-05 18:43:09 +05301#!/usr/bin/python
2# main handler file
3
4import cgi, cgitb, os, sys
5cgitb.enable()
6
7# import libs
8sys.path.append('lib/py')
9sys.path.append('erpnext')
10
11import webnotes
Rushabh Mehta66ac2b02011-09-05 18:43:09 +053012
13webnotes.form = cgi.FieldStorage()
14
15# make the form_dict
16for key in webnotes.form.keys():
17 webnotes.form_dict[key] = webnotes.form.getvalue(key)
18
Rushabh Mehta5ede3e82011-09-08 14:16:34 +053019# url comes with sid, redirect to html, sid set and all
20if 'sid' in webnotes.form_dict:
21 import webnotes.auth
22 import webnotes.widgets.page_body
23
24 webnotes.auth.HTTPRequest()
25
26 print "Content-Type: text/html"
27
28 # print cookies, if there ar additional cookies defined during the request, add them here
29 if webnotes.cookies or webnotes.add_cookies:
30 for c in webnotes.add_cookies.keys():
31 webnotes.cookies[c] = webnotes.add_cookies[c]
32
33 print webnotes.cookies
34
35 print
36 print webnotes.widgets.page_body.redirect_template % ('Redirecting...', 'index.html')
37
38else:
39 # pass on to legacy handler
40 import webnotes.handler
41