diff options
author | Steven Barth <steven@midlink.org> | 2008-05-08 15:37:41 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-05-08 15:37:41 +0000 |
commit | aa9ccf77c6648515ba58c37b9345cdbd561028db (patch) | |
tree | b0270202d47b6c5e179f8475302bb3ef0d1c9402 /applications/luci-splash/src | |
parent | a3a51464fd8cffa6d18fa3f18be9c699901abd0d (diff) |
* Mördercommit ;-)
* Major Repository Reorganisation
* API 0.4 Softfreeze to come
Diffstat (limited to 'applications/luci-splash/src')
6 files changed, 91 insertions, 0 deletions
diff --git a/applications/luci-splash/src/controller/controller.lua b/applications/luci-splash/src/controller/controller.lua new file mode 100644 index 0000000000..62088be52d --- /dev/null +++ b/applications/luci-splash/src/controller/controller.lua @@ -0,0 +1,19 @@ +module("ffluci.controller.splash.splash", package.seeall) + +function action_activate() + local mac = ffluci.sys.net.ip4mac(ffluci.http.env.REMOTE_ADDR) + if mac and ffluci.http.formvalue("accept") then + os.execute("luci-splash add "..mac.." >/dev/null 2>&1") + ffluci.http.redirect(ffluci.model.uci.get("freifunk", "community", "homepage")) + else + ffluci.http.redirect(ffluci.dispatcher.build_url()) + end +end + +function action_accepted() + ffluci.http.redirect(ffluci.dispatcher.build_url()) +end + +function action_unknown() + ffluci.http.redirect(ffluci.dispatcher.build_url()) +end
\ No newline at end of file diff --git a/applications/luci-splash/src/model/cbi/admin_services/splash.lua b/applications/luci-splash/src/model/cbi/admin_services/splash.lua new file mode 100644 index 0000000000..fe4d2c3ee8 --- /dev/null +++ b/applications/luci-splash/src/model/cbi/admin_services/splash.lua @@ -0,0 +1,30 @@ +-- ToDo: Translate, Add descriptions and help texts +require("ffluci.model.uci") + +m = Map("luci_splash", "Client-Splash", [[Client-Splash ist das Freifunk Hotspot-Authentifizierungs-System.]]) + +s = m:section(NamedSection, "general", "core", "Allgemein") +s:option(Value, "leasetime", "Freigabezeit", "h") + +s = m:section(TypedSection, "iface", "Schnittstellen") +s.addremove = true +s.anonymous = true + +iface = s:option(ListValue, "network", "Schnittstelle") +for k, v in pairs(ffluci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + iface:value(k) + end +end + +s = m:section(TypedSection, "whitelist", "Automatische Freigabe") +s.addremove = true +s.anonymous = true +s:option(Value, "mac", "MAC-Adresse") + +s = m:section(TypedSection, "blacklist", "Automatische Sperrung") +s.addremove = true +s.anonymous = true +s:option(Value, "mac", "MAC-Adresse") + +return m
\ No newline at end of file diff --git a/applications/luci-splash/src/model/menu/50luci-splash.lua b/applications/luci-splash/src/model/menu/50luci-splash.lua new file mode 100644 index 0000000000..99f7caa52b --- /dev/null +++ b/applications/luci-splash/src/model/menu/50luci-splash.lua @@ -0,0 +1,2 @@ +sel("admin", "services") +act("splash", "Client-Splash")
\ No newline at end of file diff --git a/applications/luci-splash/src/model/view/splash/splash.htm b/applications/luci-splash/src/model/view/splash/splash.htm new file mode 100644 index 0000000000..db4bd0f780 --- /dev/null +++ b/applications/luci-splash/src/model/view/splash/splash.htm @@ -0,0 +1,31 @@ +<h1><%:welcome Willkommen%>!</h1> +<p> +Du bist jetzt mit dem freien Funknetz +<a href="<%~freifunk.community.homepage%>"><%~freifunk.community.name%></a> verbunden.<br /> +Wir sind ein experimentelles Gemeinschaftsnetzwerk, aber kein Internetanbieter. +</p> + +<p> +Ein Zugang <strong>ins Internet</strong> ist trotzdem möglich, +da einige Freifunker ihre privaten Internetzugänge zur Verfügung stellen. +Diese Zugänge müssen sich hier alle teilen. +Bitte sei Dir dessen bewusst und verhalte Dich dementsprechend: +<ul> +<li>bitte <strong>keine Filesharing-Programme</strong> betreiben!</li> +<li>bitte <strong>keine unnötigen Downloads oder Streams</strong> starten!</li> +<li>bitte <strong>keine illegalen Aktivitäten</strong>!</li> +</ul> +</p> + +<p> +Wenn Du unsere Idee gut findest, kannst Du uns unterstützen: +<ul> +<li><a href="<%~freifunk.community.homepage%>">Werde selbst Freifunker oder teile deinen Internetzugang!</a></li> +<li>Betreibe deine anderen WLAN-Geräte <em>NICHT</em> auf den Kanälen 1-5, diese stören oft unser Netz.</li> +</ul> +</p> + +<p> +Mit einem Klick auf <em><%:accept Annehmen%></em> kannst du für <%~luci_splash.general.leasetime%> Stunden +über unser Netz das Internet verwenden. Dann wirst du erneut aufgefordet, diese Bedingungen zu akzeptieren. +</p>
\ No newline at end of file diff --git a/applications/luci-splash/src/model/view/splash_splash/index.htm b/applications/luci-splash/src/model/view/splash_splash/index.htm new file mode 100644 index 0000000000..75aa026582 --- /dev/null +++ b/applications/luci-splash/src/model/view/splash_splash/index.htm @@ -0,0 +1,2 @@ +<%+header%> +<%+footer%>
\ No newline at end of file diff --git a/applications/luci-splash/src/model/view/splash_splash/splash.htm b/applications/luci-splash/src/model/view/splash_splash/splash.htm new file mode 100644 index 0000000000..9c165802fb --- /dev/null +++ b/applications/luci-splash/src/model/view/splash_splash/splash.htm @@ -0,0 +1,7 @@ +<%+header%> +<%+splash/splash%> +<form method="get" action="<%=controller%>/splash/splash/activate"> + <input type="submit" value="<%:decline Ablehnen%>" /> + <input type="submit" name="accept" value="<%:accept Annehmen%>" /> +</form> +<%+footer%>
\ No newline at end of file |