summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/ffluci-splash/src/luci-splash
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-04-27 11:06:07 +0000
committerSteven Barth <steven@midlink.org>2008-04-27 11:06:07 +0000
commitace012a0325a4ad2249b137a0d7c7edcc2a71f54 (patch)
tree71051f83388ea5a5092f86f13e3bd6aa4a519591 /contrib/package/ffluci-splash/src/luci-splash
parent706da44cf275dc20426a55a4d01ed79026d3eb80 (diff)
Diffstat (limited to 'contrib/package/ffluci-splash/src/luci-splash')
-rw-r--r--contrib/package/ffluci-splash/src/luci-splash/htdocs/cgi-bin/index.cgi39
-rw-r--r--contrib/package/ffluci-splash/src/luci-splash/htdocs/index.html10
2 files changed, 0 insertions, 49 deletions
diff --git a/contrib/package/ffluci-splash/src/luci-splash/htdocs/cgi-bin/index.cgi b/contrib/package/ffluci-splash/src/luci-splash/htdocs/cgi-bin/index.cgi
deleted file mode 100644
index 4cbddc0c5b..0000000000
--- a/contrib/package/ffluci-splash/src/luci-splash/htdocs/cgi-bin/index.cgi
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/haserl --shell=luac
-package.path = "/usr/lib/lua/?.lua;/usr/lib/lua/?/init.lua;" .. package.path
-package.cpath = "/usr/lib/lua/?.so;" .. package.cpath
-
-require("ffluci.http")
-require("ffluci.sys")
-require("ffluci.model.uci")
-
-local srv
-local ip = ffluci.http.remote_addr()
-for k, v in pairs(ffluci.model.uci.show("network").network) do
- if v[".type"] == "interface" and v.ipaddr then
- local p = ffluci.sys.net.mask4prefix(v.netmask)
- if ffluci.sys.net.belongs(ip, v.ipaddr, p) then
- srv = v.ipaddr
- break
- end
- end
-end
-
-if not srv then
- ffluci.http.textheader()
- return print("Unable to detect network settings!")
-end
-
-local action = "splash"
-
-local mac = ffluci.sys.net.ip4mac(ip)
-if not mac then
- action = "unknown"
-end
-
-local status = ffluci.sys.exec("luci-splash status "..mac)
-
-if status == "whitelisted" or status == "lease" then
- action = "allowed"
-end
-
-ffluci.http.redirect("http://" .. srv .. "/cgi-bin/luci-splash/" .. action) \ No newline at end of file
diff --git a/contrib/package/ffluci-splash/src/luci-splash/htdocs/index.html b/contrib/package/ffluci-splash/src/luci-splash/htdocs/index.html
deleted file mode 100644
index 58387a5fec..0000000000
--- a/contrib/package/ffluci-splash/src/luci-splash/htdocs/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="refresh" content="0; URL=/cgi-bin/index.cgi" />
-</head>
-<body style="background-color: black">
-<a style="color: white; text-decoration: none" href="/cgi-bin/index.cgi">FFLuCI - Freifunk Lua Configuration Interface</a>
-</body>
-</html> \ No newline at end of file