* Removed section titles
[project/luci.git] / modules / admin-core / luasrc / model / cbi / admin_network / dhcp.lua
index 63ef0aa..e02238e 100644 (file)
@@ -5,17 +5,18 @@ require("luci.sys")
 m = Map("dhcp", "DHCP", [[Mit Hilfe von DHCP können Netzteilnehmer automatisch
 ihre Netzwerkkonfiguration (IP-Adresse, Netzmaske, DNS-Server, DHCP, ...) beziehen.]])
 
-s = m:section(TypedSection, "dhcp")
+s = m:section(TypedSection, "dhcp", "")
 s.addremove = true
 s.anonymous = true
 
 iface = s:option(ListValue, "interface", "Schnittstelle")
-for k, v in pairs(luci.model.uci.sections("network")) do
-       if v[".type"] == "interface" and k ~= "loopback" then
-               iface:value(k)
-               s:depends("interface", k) -- Only change sections with existing interfaces
-       end
-end
+luci.model.uci.foreach("network", "interface",
+       function (section)
+               if section[".name"] ~= "loopback" then
+                       iface:value(section[".name"])
+                       s:depends("interface", section[".name"])
+               end
+       end)
 
 s:option(Value, "start", "Start", "Erste vergebene Adresse (letztes Oktett)").rmempty = true