Renamed reworked UCI API to uci2 to allow a peaceful coexistence with the old one
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_network / network.lua
index 3924e7c..fce84fe 100644 (file)
@@ -15,11 +15,7 @@ $Id$
 require("luci.sys")
 require("luci.tools.webadmin")
 
-luci.model.uci.load_state("network")
-local netstate = luci.model.uci.get_all("network")
-luci.model.uci.unload("network")
-
-
+local netstate = luci.model.uci.cursor_state():get_all("network")
 m = Map("network", translate("interfaces"))
 
 local created
@@ -43,6 +39,7 @@ end
 function s.parse(self, ...)
        TypedSection.parse(self, ...)
        if created then
+               m.uci:save("network")
                luci.http.redirect(luci.dispatcher.build_url("admin", "network", "network")
                 .. "/" .. created)
        end
@@ -70,7 +67,8 @@ end
 
 ifname.titleref = luci.dispatcher.build_url("admin", "network", "vlan")
 
-if luci.model.uci.load("firewall") then
+
+if luci.model.uci.cursor():load("firewall") then
        zone = s:option(DummyValue, "_zone", translate("zone"))
        zone.titleref = luci.dispatcher.build_url("admin", "network", "firewall", "zones")