From 37bf7b0217c3058e3f8787c9c4f9c73520a40ba5 Mon Sep 17 00:00:00 2001
From: Manuel Munz
" ..
"It is possible to use the following markers: " ..
"###COMMUNITY###, ###COMMUNITY_URL###, ###CONTACTURL###, ###LEASETIME###, ###LIMIT### and ###ACCEPT###."))
@@ -39,4 +41,26 @@ function f.handle(self, state, data)
return true
end
-return f
+g = SimpleForm("splashtextinclude", translate("Include your own text in the default splash"),
+ translate("As an alternative to editing the complete splash text you can also just include some custom text in the default splash page by entering it here."))
+
+t = g:field(TextValue, "text")
+t.rmempty = true
+t.rows = 30
+function t.cfgvalue()
+ return fs.readfile(splashtextinclude) or ""
+end
+
+function g.handle(self, state, data)
+ if state == FORM_VALID then
+ if data.text then
+ fs.writefile(splashtextinclude, data.text:gsub("\r\n", "\n"))
+ else
+ fs.unlink(splashtextinclude)
+ end
+ end
+ return true
+end
+
+
+return f, g
diff --git a/applications/luci-splash/luasrc/view/splash/splash.htm b/applications/luci-splash/luasrc/view/splash/splash.htm
index fbb9c8b75..36aa80b93 100644
--- a/applications/luci-splash/luasrc/view/splash/splash.htm
+++ b/applications/luci-splash/luasrc/view/splash/splash.htm
@@ -13,6 +13,7 @@ You may obtain a copy of the License at
<%
local fs = require "luci.fs"
local has_custom_splash = fs.access("/usr/lib/luci-splash/splashtext.html")
+local has_custom_splashinclude = fs.access("/usr/lib/luci-splash/splashtextinclude.html")
function expand (e, R)
return (string.gsub(e, "###([A-Z_]+)###", R))
@@ -24,7 +25,12 @@ local contacturl = luci.dispatcher.build_url("freifunk", "contact")
local c = luci.model.uci.cursor():get_all("freifunk", "community")
if c and c.name then
- community = c.name
+ name = luci.model.uci.cursor():get('profile_' .. c.name, 'profile', 'name')
+ if name then
+ community = name
+ else
+ community = c.name
+ end
else
community = "Freifunk"
end
@@ -49,6 +55,10 @@ if limit_up and limit_down then
"to this project.") .. "
<%:If you use this network on a regular basis we ask for your support:%>
<%:By accepting these rules you can use this network for%> <%=leasetime%> - <%:hour(s). After this time you need to accept these rules again.%>
+ + <% + if has_custom_splashinclude then + local splashtextinclude = fs.readfile("/usr/lib/luci-splash/splashtextinclude.html") + %> + <%=splashtextinclude%> + <% end %> + ++ <%:The open and free wireless network of volunteers ("Operators") provides the necessary equipment and Internet connections ("Infrastructure") at their own expense.%> + <%:These Terms of Use govern the use of the network by its participants' computer, PDA, or similar device ("Devices") within the network.%> + <%:Access to the network is not guaranteed. It can be interrupted at any time without notice for any reason, for certain devices, and/or may be blocked for certain users.%> +
+ +<%:The participant agrees to not perform any action and refrain from acts which may violate the law or infringe upon the rights of third parties.%>
+ +<%:The participant agrees to not transfer content over the network which violates the law.%>
+ +<%:The participant agrees to not use the network in any way which will harm the infrastructure, the network itself, its operators or other participants.%>
+ +The network, like the Internet, is unencrypted and open. Each participant is responsible for the safety of their own connections and devices.
+ +<%:The operator claims no liability for loss of data, unauthorized access/damage to devices, or financial losses that participants may suffer from the use of the network.%>
+ +<%=accepttext%>
<% end %> diff --git a/contrib/package/luci/Makefile b/contrib/package/luci/Makefile index 10dcf071e..1ef3cde9e 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -297,6 +297,7 @@ endef define Package/luci-app-splash/conffiles /etc/config/luci_splash /usr/lib/luci-splash/splashtext.html +/usr/lib/luci-splash/splashtextinclude.html endef define Package/luci-app-statistics/conffiles -- 2.25.1