def process_dl(self, req, start_response): params = req['PATH_INFO'].split('/', 3) self.log.debug('Dispatching download: %s'%req['PATH_INFO']) path = PluginLoader.get_plugin_path(self.app, params[2]) file = os.path.join(path, params[2], 'files', params[3]) return wsgi_serve_file(req, start_response, file)
def process_htdocs(self, req, start_response): params = req['PATH_INFO'].split('/', 2) self.log.debug('Dispatching htdocs: %s'%req['PATH_INFO']) path = self.app.config.get('ajenti', 'htdocs') file = os.path.join(path, params[2]) file = os.path.normpath(os.path.realpath(file)) if not file.startswith(path): start_response('404 Not Found', []) return '' return wsgi_serve_file(req, start_response, file)
def process_dl(self, req, start_response): params = req['PATH_INFO'].split('/', 3) self.log.debug('Dispatching download: %s'%req['PATH_INFO']) # Check if we have module in content path if params[2] not in self.app.content: start_response('404 Not Found', []) return '' path = self.app.content[params[2]] file = os.path.join(path, params[3]) return wsgi_serve_file(req, start_response, file)
def process(self, req, start_response): file = os.path.join('/var/lib/sarg/', req['PATH_INFO'][13:]) return wsgi_serve_file(req, start_response, file)