#!/usr/bin/env python # vi: encoding=utf-8 ts=8 sts=4 sw=4 et # Printing errors (no SyntaxErrors though, but that's not a problem) import sys, os sys.stderr=sys.stdout contenttypesent=False def myexceptionhandler(type, value, traceback): if contenttypesent: print '
'
        sys.__excepthook__(type, value, traceback)
        print '
' else: print "Content-Type: text/plain\n" sys.__excepthook__(type, value, traceback) sys.exit(1) sys.excepthook=myexceptionhandler # End printing errors sys.path.insert(0, '../modules') import wwwiface, user opts, cks = wwwiface.getopts() u=user.User(cks, opts) if u.loggedin: wwwiface.addheader('Logged in: '+u.login) wwwiface.addmenu(file='loggedinmenu') import wwwcmds wwwcmds.handlecmds(opts) else: wwwiface.addheader('Login form') wwwiface.addcontent(file='regform') wwwiface.sendhttpheaders() contenttypesent=True wwwiface.sendhtml()