summaryrefslogtreecommitdiffstats
path: root/info.cgi
blob: e7e27431ba7b9032a65fdccd1b54efec24a794a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/python

import cgi, cgitb, os, time, urllib, sch
cgitb.enable()

form = cgi.FieldStorage()

if not form.has_key("fname"):
    sch.error("No file name passed to script file")

fname = form["fname"].value

if not sch.valid_fname(fname):
    sch.error("Fuck off!")

sch.print_header("File Info for '%s'" % fname)

print '<p><a href="%s/%s">Download the file</a></p>' % (sch.repository_directory, fname)

sch.run_proc('%s --info "%s/%s" ' % (sch.syrep_binary, sch.repository_directory, fname))
sch.print_footer()