splash.htm 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <%#
  2. Copyright 2008 Steven Barth <steven@midlink.org>
  3. Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
  4. Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
  5. Licensed to the public under the Apache License 2.0.
  6. -%>
  7. <%
  8. local fs = require "nixio.fs"
  9. local has_custom_splash = fs.access("/usr/lib/luci-splash/splashtext.html")
  10. local has_custom_splashinclude = fs.access("/usr/lib/luci-splash/splashtextinclude.html")
  11. function expand (e, R)
  12. return (string.gsub(e, "###([A-Z_]+)###", R))
  13. end
  14. local community, homepage, leasetime, limit_up, limit_down
  15. local contacturl = luci.dispatcher.build_url("freifunk", "contact")
  16. local c = luci.model.uci.cursor():get_all("freifunk", "community")
  17. if c and c.name then
  18. name = luci.model.uci.cursor():get('profile_' .. c.name, 'profile', 'name')
  19. if name then
  20. community = name
  21. else
  22. community = c.name
  23. end
  24. else
  25. community = "Freifunk"
  26. end
  27. if c and c.homepage then
  28. homepage = c.homepage
  29. else
  30. homepage = "http://freifunk.net"
  31. end
  32. local s = luci.model.uci.cursor():get_all("luci_splash", "general")
  33. if s then
  34. leasetime = s.leasetime or ""
  35. limit_up = s.limit_up or nil
  36. limit_down = s.limit_down or nil
  37. end
  38. local limit_text = ""
  39. if limit_up and limit_down then
  40. limit_text = "<p>" .. translate("Your bandwidth is limited to") .. " " .. limit_down .. "/" .. limit_up ..
  41. " " .. translate("KB/s (Download/Upload). You may be able to remove this limit by actively contributing " ..
  42. "to this project.") .. "</p>"
  43. end
  44. local contact = translate('Get in %s with the operator of this access point.')
  45. contact = contact % ('<a href="' .. contacturl .. '">' .. translatef('Contact') .. '</a>')
  46. local accepttext = translate('By accepting these rules you can use this network for %s hour(s). After this time you need to accept these rules again.')
  47. accepttext = accepttext % leasetime
  48. if has_custom_splash then
  49. local R = {
  50. COMMUNITY = community,
  51. COMMUNITY_URL = homepage,
  52. LEASETIME = leasetime,
  53. ACCEPT = tostring(translate("Accept")),
  54. LIMIT = limit_text,
  55. CONTACTURL = contacturl
  56. }
  57. local splashtext = expand(fs.readfile("/usr/lib/luci-splash/splashtext.html"), R)
  58. %>
  59. <%=splashtext%>
  60. <% else %>
  61. <h2 name="content"><%:Welcome%></h2>
  62. <p><%:You are now connected to the free wireless mesh network%> <a href="<%=homepage%>"><%=community%></a>.
  63. <%:Please note that we are not an internet service provider but an experimental community network.%></p>
  64. <p><%:Access to the internet might be possible nevertheless, because some activists of this project share their
  65. private internet connections. These few connections are shared between all users. That means available bandwidth
  66. is limited and because of this we ask you not to do any of the following:%></p>
  67. <ul>
  68. <li><%:use filesharing applications on this network%></li>
  69. <li><%:waste bandwidth with unneccesary downloads or streams%></li>
  70. <li><%:perform any kind of illegal activities%></li>
  71. </ul>
  72. <br />
  73. <% if limit_up and limit_down then %>
  74. <%=limit_text%>
  75. <% end %>
  76. <p><%:If you use this network on a regular basis we ask for your support:%></p>
  77. <ul>
  78. <li><a href="<%=homepage%>"><%:Become an active member of this community and help by operating your own node%></a></li>
  79. <li><%=contact%></li>
  80. <li><%:Donate some money to help us keep this project alive.%></li>
  81. <li><%:If you operate your own wifi equipment use channels different from ours.%></li>
  82. </ul>
  83. <%
  84. if has_custom_splashinclude then
  85. local splashtextinclude = fs.readfile("/usr/lib/luci-splash/splashtextinclude.html")
  86. %>
  87. <%=splashtextinclude%>
  88. <% end %>
  89. <h2><%:Usage Agreement%></h2>
  90. <p>
  91. <%:The open and free wireless network of volunteers ("Operators") provides the necessary equipment and Internet connections ("Infrastructure") at their own expense.%>
  92. <%:These Terms of Use govern the use of the network by its participants' computer, PDA, or similar device ("Devices") within the network.%>
  93. <%: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.%>
  94. </p>
  95. <h3><%:Legally Prohibited Activities%></h3>
  96. <p><%: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.%></p>
  97. <h3><%:Legally Prohibited content%></h3>
  98. <p><%:The participant agrees to not transfer content over the network which violates the law.%></p>
  99. <h3><%:Fair Use Policy%></h3>
  100. <p><%:The participant agrees to not use the network in any way which will harm the infrastructure, the network itself, its operators or other participants.%></p>
  101. <h3><%:Safety%></h3>
  102. <p><%:The network, like the Internet, is unencrypted and open. Each participant is responsible for the safety of their own connections and devices.%></p>
  103. <h3>Disclaimer</h3>
  104. <p><%: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.%></p>
  105. <br /><p><b><%=accepttext%></b></p>
  106. <% end %>