diff options
author | Steven Barth <steven@midlink.org> | 2008-05-11 10:29:45 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-05-11 10:29:45 +0000 |
commit | 045d9c1942146eb971609b637029911e4802a2e9 (patch) | |
tree | 8dac5aa0687fbc50bd68c566f37155ad2c1d2a7a /applications | |
parent | cce73ddb4d2371710ec9683c76b9b6a3fb932079 (diff) |
* DHCP-Splash fixes #1
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-splash/root/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi | 38 | ||||
-rw-r--r-- | applications/luci-splash/root/www/cgi-bin/luci-splash (renamed from applications/luci-splash/root/www/cgi-bin/luci_splash.cgi) | 0 | ||||
-rw-r--r-- | applications/luci-splash/src/controller/splash/splash.lua (renamed from applications/luci-splash/src/controller/controller.lua) | 0 | ||||
-rw-r--r-- | applications/luci-splash/src/model/v/splash/splash.htm (renamed from applications/luci-splash/src/model/view/splash/splash.htm) | 0 | ||||
-rw-r--r-- | applications/luci-splash/src/model/v/splash_splash/index.htm (renamed from applications/luci-splash/src/model/view/splash_splash/index.htm) | 0 | ||||
-rw-r--r-- | applications/luci-splash/src/model/v/splash_splash/splash.htm (renamed from applications/luci-splash/src/model/view/splash_splash/splash.htm) | 0 |
6 files changed, 18 insertions, 20 deletions
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 index 341aaa4b5..11430f0ac 100644 --- 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 @@ -29,24 +29,22 @@ end if not srv then ffluci.http.prepare_content("text/plain") - return print("Unable to detect network settings!") -end - -if not stat then + print("Unable to detect network settings!") +elseif not stat then ffluci.http.redirect("http://" .. srv) -end - -local action = "splash" - -local mac = ffluci.sys.net.ip4mac(ip) -if not mac then - action = "unknown" -end - -local status = ffluci.sys.execl("luci-splash status "..mac)[1] - -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 +else + local action = "splash" + + local mac = ffluci.sys.net.ip4mac(ip) + if not mac then + action = "unknown" + end + + local status = ffluci.sys.execl("luci-splash status "..mac)[1] + + if status == "whitelisted" or status == "lease" then + action = "allowed" + end + + ffluci.http.redirect("http://" .. srv .. "/cgi-bin/luci-splash/" .. action) +end
\ No newline at end of file diff --git a/applications/luci-splash/root/www/cgi-bin/luci_splash.cgi b/applications/luci-splash/root/www/cgi-bin/luci-splash index 188ad7aa0..188ad7aa0 100644 --- a/applications/luci-splash/root/www/cgi-bin/luci_splash.cgi +++ b/applications/luci-splash/root/www/cgi-bin/luci-splash diff --git a/applications/luci-splash/src/controller/controller.lua b/applications/luci-splash/src/controller/splash/splash.lua index 62088be52..62088be52 100644 --- a/applications/luci-splash/src/controller/controller.lua +++ b/applications/luci-splash/src/controller/splash/splash.lua diff --git a/applications/luci-splash/src/model/view/splash/splash.htm b/applications/luci-splash/src/model/v/splash/splash.htm index db4bd0f78..db4bd0f78 100644 --- a/applications/luci-splash/src/model/view/splash/splash.htm +++ b/applications/luci-splash/src/model/v/splash/splash.htm diff --git a/applications/luci-splash/src/model/view/splash_splash/index.htm b/applications/luci-splash/src/model/v/splash_splash/index.htm index 75aa02658..75aa02658 100644 --- a/applications/luci-splash/src/model/view/splash_splash/index.htm +++ b/applications/luci-splash/src/model/v/splash_splash/index.htm diff --git a/applications/luci-splash/src/model/view/splash_splash/splash.htm b/applications/luci-splash/src/model/v/splash_splash/splash.htm index 9c165802f..9c165802f 100644 --- a/applications/luci-splash/src/model/view/splash_splash/splash.htm +++ b/applications/luci-splash/src/model/v/splash_splash/splash.htm |