]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blame - cgi-bin/index.py
fix arg passing
[projects/pld-ftp-admin.git] / cgi-bin / index.py
CommitLineData
1610d209
MM
1#!/usr/bin/env python
2# vi: encoding=utf-8 ts=8 sts=4 sw=4 et
3
4# Printing errors (no SyntaxErrors though, but that's not a problem)
5import sys, os
6sys.stderr=sys.stdout
7
8contenttypesent=False
9
10def myexceptionhandler(type, value, traceback):
11 if contenttypesent:
12 print '<pre>'
13 sys.__excepthook__(type, value, traceback)
14 print '</pre>'
15 else:
16 print "Content-Type: text/plain\n"
17 sys.__excepthook__(type, value, traceback)
18 sys.exit(1)
19
b0253fd1 20sys.excepthook=myexceptionhandler
1610d209
MM
21# End printing errors
22
26f8b573 23sys.path.insert(0, '../modules')
1610d209
MM
24
25import wwwiface, user
26
27opts, cks = wwwiface.getopts()
28u=user.User(cks, opts)
29
30if u.loggedin:
1610d209
MM
31 wwwiface.addheader('Logged in: '+u.login)
32 wwwiface.addmenu(file='loggedinmenu')
db087717
MM
33 import wwwcmds
34 wwwcmds.handlecmds(opts)
1610d209
MM
35else:
36 wwwiface.addheader('Login form')
37 wwwiface.addcontent(file='regform')
38
39wwwiface.sendhttpheaders()
40contenttypesent=True
41
42wwwiface.sendhtml()
43
This page took 0.573661 seconds and 4 git commands to generate.