49
48
# permissions issues unless all user's files are owned by the web server user.
50
49
HANDLE_WITH_TRAMPOLINE = True
52
fileservice_path = "/opt/ivle/services/fileservice" # Within jail
51
fileservice_path = os.path.join(ivle.conf.share_path, 'services/fileservice')
55
54
"""Handler for the File Services application."""
56
55
if len(req.path) == 0:
57
56
# If no path specified, default to the user's home directory
58
req.throw_redirect(common.util.make_path(os.path.join('fileservice',
57
req.throw_redirect(ivle.util.make_path(os.path.join('fileservice',
60
59
if not HANDLE_WITH_TRAMPOLINE:
61
fileservice_lib.handle(req)
60
ivle.fileservice_lib.handle(req)
63
interp_object = common.interpret.interpreter_objects["cgi-python"]
64
user_jail_dir = os.path.join(conf.jail_base, req.user.login)
65
common.interpret.interpret_file(req, req.user.login, user_jail_dir,
62
interp_object = ivle.interpret.interpreter_objects["cgi-python"]
63
user_jail_dir = os.path.join(ivle.conf.jail_base, req.user.login)
64
ivle.interpret.interpret_file(req, req.user.login, user_jail_dir,
66
65
fileservice_path, interp_object, gentle=False)