]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blame - cgi-bin/index.py
- removed dobule slash in path
[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
20sys.excepthook=ziew=myexceptionhandler
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:
31 from ftptree import FtpTree
32 import config
33 srctree=FtpTree(config.value['default_to'], loadall=True)
34 wwwiface.addheader('Logged in: '+u.login)
35 wwwiface.addmenu(file='loggedinmenu')
36 wwwiface.addcontent('<form action="index.py" method="post"><table border="1">')
37 wwwiface.addcontent('<tr><td>Mv</td><td>Package</td></tr>\n')
38 pkglist=srctree.keys()
39 pkglist.sort()
40 for pkg in pkglist:
41 wwwiface.addcontent('<tr><td><input type="checkbox"></td><td>'+srctree[pkg].name+'</td></tr>\n')
42 wwwiface.addcontent('<tr><td>&nbsp;</td><td><input type="submit" value="Move"></td></tr>')
43 wwwiface.addcontent('</table></form>')
44else:
45 wwwiface.addheader('Login form')
46 wwwiface.addcontent(file='regform')
47
48wwwiface.sendhttpheaders()
49contenttypesent=True
50
51wwwiface.sendhtml()
52
This page took 0.058575 seconds and 4 git commands to generate.