<%# Opennet Firmware Copyright 2010 Rene Ejury Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -%> <%+header%>

<%:Opennet ID%>

<%+cbi/apply_xhr%> <% local uci = require "luci.model.uci" local cursor = uci.cursor() local form_id = luci.http.formvalue("form_id") local on_id = cursor:get("on-core", "settings", "on_id") local devices = { "on_eth_", "on_wifi_" } if (form_id) then function split(str) local t = { } str:gsub("%d+", function (w) table.insert(t, w) end) return t end local t = split(form_id) local replace_id = false if #t == 1 then t[2] = t[1] t[1] = "1" replace_id = true elseif #t == 2 then replace_id = true elseif form_id:match("^(%d+)%.(%d+)%.(%d+)%.(%d+)$") then t[1] = t[3] t[2] = t[4] replace_id = true end if replace_id then on_function("set_opennet_id", {form_id}) else form_id = on_id end else form_id = on_id end %>

<%:Opennet-ID / Network ID%>

<%=luci.i18n.translatef('Great that you decided to take part in Opennet. Register the IP of your Access-Point in the %sOpennet-Wiki%s and aquire a free IP-Address. Please read the information %sin the wiki%s for further details.', '', '', '', '')%>

<%:Please enter your Opennet-ID (1.X or 2.X etc.) or the IP-Address of your first Opennet-Network-Interface, any change will reconfigure your network settings immediately.%>

<%:related network addresses%>

<% for index = 1, #devices do local count = 0 while (cursor:get_all("network", devices[index]..count)) do local v = cursor:get_all("network", devices[index]..count) %> <% count = count + 1 end end local free = cursor:get_all("network", "free") if free then %> <% end %>

<%=v[".name"]%> (<%:device%> <%=v.ifname%>)

<%=v.ipaddr%> / <%=v.netmask%>

<%=free[".name"]%> (<%:device%> <%=free.ifname%>)

<%=free.ipaddr%> / <%=free.netmask%>
<%+footer%>