summaryrefslogtreecommitdiffhomepage
path: root/libs/sgi-webuci/root
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-27 09:33:52 +0000
committerSteven Barth <steven@midlink.org>2008-05-27 09:33:52 +0000
commit93ff578ac8f0cd4772285a6ea983cf02cc9be620 (patch)
treef766e8c0be94fe317673cefee879fbf73bc8cbd9 /libs/sgi-webuci/root
parent30c8b259e1b7012f7c16c1ee5aeb1997e44dcbdc (diff)
* 3rd Package reorgnaisation
* Moved core, web, cbi to libs * Refactored OpenWRT Makefile to separate Libraries, Webinterface Components, Freifunk packages
Diffstat (limited to 'libs/sgi-webuci/root')
-rw-r--r--libs/sgi-webuci/root/lib/webuci/main.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/sgi-webuci/root/lib/webuci/main.lua b/libs/sgi-webuci/root/lib/webuci/main.lua
new file mode 100644
index 000000000..cb2730d14
--- /dev/null
+++ b/libs/sgi-webuci/root/lib/webuci/main.lua
@@ -0,0 +1,20 @@
+module("webuci", package.seeall)
+
+function prepare_req(uri)
+ require("luci.dispatcher").createindex()
+ env = {}
+ env.REQUEST_URI = uri
+end
+
+function handle_req(context)
+ env.SERVER_PROTOCOL = context.server_proto
+ env.REMOTE_ADDR = context.remote_addr
+ env.REQUEST_METHOD = context.request_method
+ env.PATH_INFO = context.uri
+ env.REMOTE_PORT = context.remote_port
+ env.SERVER_ADDR = context.server_addr
+ env.SCRIPT_NAME = env.REQUEST_URI:sub(1, #env.REQUEST_URI - #env.PATH_INFO)
+
+ luci.sgi.webuci.initenv(env)
+ luci.dispatcher.httpdispatch()
+end \ No newline at end of file