-#!/usr/bin/haserl --shell=luac --upload-limit=6144
+#!/usr/bin/haserl --shell=luac --upload-limit=16384
-- This is a bit hacky: remove -upload from SCRIPT_NAME
ENV.SCRIPT_NAME = ENV.SCRIPT_NAME:sub(1, #ENV.SCRIPT_NAME - 7)
dofile("ffluci")
\ No newline at end of file
-- Environment Table
ffluci.http.env = ENV
+-- Returns the main dispatcher URL
+function ffluci.http.dispatcher()
+ return ffluci.http.env.SCRIPT_NAME or ""
+end
+
+-- Returns the upload dispatcher URL
+function ffluci.http.dispatcher_upload()
+ return ffluci.http.dispatcher() .. "-upload"
+end
-- Returns a table of all COOKIE, GET and POST Parameters
function ffluci.http.formvalues()
local status_set = false
+-- Returns the main dispatcher URL
+function ffluci.http.dispatcher()
+ return ffluci.http.env.SCRIPT_NAME or ""
+end
+
+-- Returns the upload dispatcher URL
+function ffluci.http.dispatcher_upload()
+ -- To be implemented
+end
+
-- Returns a table of all COOKIE, GET and POST Parameters
function ffluci.http.formvalues()
return webuci.vars
module = module or "index"
action = action or "index"
- local pattern = ffluci.http.env.SCRIPT_NAME .. "/%s/%s/%s"
+ local pattern = ffluci.http.dispatcher() .. "/%s/%s/%s"
return pattern:format(category, module, action)
end
viewns = {
translate = function(...) return require("ffluci.i18n").translate(...) end,
config = function(...) return require("ffluci.model.uci").get(...) or "" end,
- controller = ffluci.http.env.SCRIPT_NAME or "",
+ controller = ffluci.http.dispatcher(),
+ uploadctrl = ffluci.http.dispatcher_upload(),
media = ffluci.config.main.mediaurlbase,
images = ffluci.config.main.imagebase,
write = io.write,
Das Format der Firmware ist plattformabhängig.%></p>
<br />
<% if sysupgrade and not ret then %>
-<form method="post" action="<%=controller%>-upload/admin/system/upgrade" enctype="multipart/form-data">
+<form method="post" action="<%=uploadctrl%>/admin/system/upgrade" enctype="multipart/form-data">
<div class="cbi-section-node">
<div class="cbi-value clear">
<div class="cbi-value-title left"><%:fwimage Firmwareimage%></div>