From ee324cb3a70d39dc9522a1ee63af12137d433533 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 29 Jun 2008 14:42:53 +0000 Subject: * applications/luci-splash: Rewrote luci-splash using an own daemon implementation * Minor tweaks in luci.dispatcher --- .../usr/lib/luci-splash/htdocs/cgi-bin/index.cgi | 53 ---------------------- .../root/usr/lib/luci-splash/htdocs/index.html | 10 ---- 2 files changed, 63 deletions(-) delete mode 100755 applications/luci-splash/root/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi delete mode 100644 applications/luci-splash/root/usr/lib/luci-splash/htdocs/index.html (limited to 'applications/luci-splash/root/usr/lib') diff --git a/applications/luci-splash/root/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi b/applications/luci-splash/root/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi deleted file mode 100755 index 29679a21cf..0000000000 --- a/applications/luci-splash/root/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/lua - -require("luci.sys") -require("luci.model.uci") - -luci.model.uci.set_savedir(luci.model.uci.savedir_state) - -local srv -local net -local ip = os.getenv("REMOTE_ADDR") -luci.model.uci.foreach("network", "interface", - function (section) - if section.ipaddr then - local p = luci.sys.net.mask4prefix(section.netmask) - if luci.sys.net.belongs(ip, section.ipaddr, p) then - net = section[".name"] - srv = section.ipaddr - return - end - end - end) - -local stat = false -luci.model.uci.foreach("luci_splash", "iface", - function (section) - if section.network == net then - stat = true - end - end) - -if not srv then - print("Content-Type: text/plain\n") - print("Unable to detect network settings!") -elseif not stat then - print("Status: 302 Found") - print("Location: http://" .. srv) -else - local action = "splash" - - local mac = luci.sys.net.ip4mac(ip) - if not mac then - action = "unknown" - end - - local status = luci.sys.execl("luci-splash status "..mac)[1] - - if status == "whitelisted" or status == "lease" then - action = "allowed" - end - - print("Status: 302 Found") - print("Location: http://" .. srv .. "/cgi-bin/luci-splash/" .. action) -end diff --git a/applications/luci-splash/root/usr/lib/luci-splash/htdocs/index.html b/applications/luci-splash/root/usr/lib/luci-splash/htdocs/index.html deleted file mode 100644 index 39ba558dfb..0000000000 --- a/applications/luci-splash/root/usr/lib/luci-splash/htdocs/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - -LuCI - Lua Configuration Interface - - \ No newline at end of file -- cgit v1.2.3