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 | |
parent | cce73ddb4d2371710ec9683c76b9b6a3fb932079 (diff) |
* DHCP-Splash fixes #1
-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 | ||||
-rw-r--r-- | contrib/package/ffluci/Makefile | 1 |
7 files changed, 19 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 341aaa4b56..11430f0acc 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 188ad7aa05..188ad7aa05 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 62088be52d..62088be52d 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 db4bd0f780..db4bd0f780 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 75aa026582..75aa026582 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 9c165802fb..9c165802fb 100644 --- a/applications/luci-splash/src/model/view/splash_splash/splash.htm +++ b/applications/luci-splash/src/model/v/splash_splash/splash.htm diff --git a/contrib/package/ffluci/Makefile b/contrib/package/ffluci/Makefile index af17aa57a1..8f1d7f0aa9 100644 --- a/contrib/package/ffluci/Makefile +++ b/contrib/package/ffluci/Makefile @@ -156,6 +156,7 @@ define Package/ffluci-app-splash/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/init.d/luci_splash $(1)/etc/init.d $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/etc/cron.minutely/luci_splash $(1)/etc/cron.minutely $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/usr/lib/luci-splash/htdocs/cgi-bin/index.cgi $(1)/usr/lib/luci-splash/htdocs/cgi-bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/applications/luci-splash/dist/www/cgi-bin/luci-splash $(1)/www/cgi-bin/luci-splash endef |