- Timestamp:
- Oct 8, 2007, 3:39:40 AM (17 years ago)
- Location:
- trunk/web/templates
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/templates/main.py
r139 r140 14 14 import datetime 15 15 16 print 'Content-Type: text/html\n'17 16 sys.stderr = sys.stdout 18 17 sys.path.append('/home/ecprice/.local/lib/python2.5/site-packages') … … 65 64 if name[0] in '-_' or len(name) > 22: 66 65 return False 67 return all(x in charset for x in name) 66 for x in name: 67 if x not in charset: 68 return False 69 return True 68 70 69 71 def kinit(username = 'tabbott/extra', keytab = '/etc/tabbott.keytab'): … … 542 544 email = 'moo@cow.com' 543 545 u = User() 546 if 'SSL_CLIENT_S_DN_Email' in os.environ: 547 username = os.environ[ 'SSL_CLIENT_S_DN_Email'].split("@")[0] 548 u.username = username 549 u.email = os.environ[ 'SSL_CLIENT_S_DN_Email'] 550 else: 551 u.username = 'nobody' 552 u.email = None 553 connect('postgres://sipb-xen@sipb-xen-dev/sipb_xen') 544 554 operation = os.environ.get('PATH_INFO', '') 555 #print 'Content-Type: text/plain\n' 556 #print operation 545 557 if not operation: 546 pass 547 #XXX do redirect 558 print "Status: 301 Moved Permanently" 559 print 'Location: ' + os.environ['SCRIPT_NAME']+'/\n' 560 sys.exit(0) 561 print 'Content-Type: text/html\n' 548 562 549 563 if operation.startswith('/'):
Note: See TracChangeset
for help on using the changeset viewer.